Skip to main content

LLM Providers

ProviderStatusInstrumentation MethodFeatures
OpenAI✅ Supportedinstrument()Streaming, Tool calls, Vision, JSON mode
Anthropic✅ Supportedinstrument()Streaming, Tool calls, Prompt caching
Google Gemini✅ Supportedinstrument()Streaming, Tool calls, Chat sessions

Agent Frameworks

FrameworkStatusInstrumentation MethodNotes
Vercel AI SDK✅ SupportedinstrumentFetch()generateText, streamText, generateObject
LangChain.js✅ SupportedinstrumentFetch()Chains, LCEL, agents, tool binding
LlamaIndex.ts✅ SupportedinstrumentFetch()RAG pipelines, chat engines
Mastra✅ SupportedinstrumentFetch() + withAgent()Agents, tools, workflows
Frameworks that bundle their own SDK copies require instrumentFetch() to intercept HTTP calls. Direct SDK usage can use instrument().

Feature Support

FeatureOpenAIAnthropicGemini
Basic completions
Streaming
Tool/Function calls
Token tracking
Cached token tracking
Rate limit tracking
Latency metrics
Error tracking
Multi-agent tracking
Cost control

Instrumentation Methods

instrument() - SDK Instrumentation

Best for direct SDK usage. Patches SDK prototypes at startup.
import { instrument } from "aden";
import OpenAI from "openai";
import Anthropic from "@anthropic-ai/sdk";
import { GoogleGenerativeAI } from "@google/generative-ai";

await instrument({
  emitMetric: myEmitter,
  sdks: { OpenAI, Anthropic, GoogleGenerativeAI },
});
Use when:
  • Using OpenAI, Anthropic, or Gemini SDKs directly
  • Building custom agents without a framework

instrumentFetch() - HTTP Instrumentation

Best for frameworks that make direct HTTP calls or bundle their own SDK copies.
import { instrumentFetch } from "aden";

await instrumentFetch({
  emitMetric: myEmitter,
});
Use when:
  • Using Vercel AI SDK
  • Using LangChain.js
  • Using LlamaIndex.ts
  • Using Mastra or other fetch-based frameworks

Examples

ExampleDescriptionFile
OpenAI BasicCompletions, streaming, tool callsopenai-basic.ts
Anthropic BasicMessages, streaming, prompt cachinganthropic-basic.ts
Gemini BasicContent generation, chat sessionsgemini-basic.ts
Vercel AI SDKgenerateText, streamText, generateObjectvercel-ai-sdk.ts
LangChainLCEL chains, multi-model, tool bindinglangchain-example.ts
LlamaIndexRAG pipelines, chat interfacellamaindex-example.ts
MastraAgents, tools, multi-agent workflowsmastra-example.ts
Multi-AgentSequential, parallel, debate patternsmulti-agent-example.ts
Cost ControlLocal policy engine without servercost-control-local.ts
Control ActionsAll 5 control actions democontrol-actions.ts

View Examples on GitHub

Browse complete example code

Coming Soon

FrameworkStatusETA
CrewAI.js🔜 Planned-
AutoGen.js🔜 Planned-
Want support for another framework? Open an issue on GitHub.