Package
GitHub Repository
View source code and contribute
Supported Providers
| Provider | Package | Status |
|---|---|---|
| OpenAI | openai | Full support (Chat Completions, streaming, tools) |
| Anthropic | anthropic | Full support (Messages API, streaming, tools) |
| Google Gemini | google-generativeai | Full support (generateContent, chat) |
Framework Compatibility
| Framework | Integration |
|---|---|
| PydanticAI | Full integration support |
| LangChain | Instruments underlying providers |
| LangGraph | Sync and async modes |
| LlamaIndex | Works with instrumented providers |
| LiveKit Voice Agents | Specialized voice agent support |
Sync vs Async
| Your Context | Instrumentation | Uninstrumentation |
|---|---|---|
| Sync (no event loop) | instrument() | uninstrument() |
| Async (inside event loop) | await instrument_async() | await uninstrument_async() |
Metrics Captured
| Metric | Description |
|---|---|
input_tokens | Prompt/input tokens used |
output_tokens | Completion/output tokens generated |
cached_tokens | Tokens served from prompt cache |
reasoning_tokens | Reasoning tokens (o1/o3 models) |
latency_ms | Request duration in milliseconds |
model | Model name (e.g., gpt-4o, claude-3-5-sonnet) |
provider | Provider name (openai, anthropic, gemini) |
tool_calls | Function/tool calls made |
trace_id | OpenTelemetry-compatible trace ID |