LLM Providers
Every provider is auto-instrumented by init() — construct and use the client as normal.
All providers below are auto-instrumented by `init()` — just construct and use the client as normal. The manual patch_* / patch* call is shown for completeness (use it for a client created before init(), or in async/edge setups).
Anthropic (Claude)
import evalkit, anthropic
evalkit.init(subscription_key="tk_live_...", service_name="claude-app")
client = anthropic.Anthropic() # auto-traced
resp = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain tracing in one line."}],
)
# Async
from anthropic import AsyncAnthropic
aclient = AsyncAnthropic() # auto-traced
# Manual (optional): client created before init / custom wrapper
evalkit.patch_anthropic_client(client)
evalkit.patch_async_anthropic_client(aclient)Captures: model, prompt, completion, input/output tokens, stop reason, streaming deltas, and tool use blocks — each tool the model requests is attached to the call, no manual spans needed.
Claude via Amazon Bedrock
import boto3, evalkit
bedrock = boto3.client("bedrock-runtime")
evalkit.patch_bedrock_client(bedrock) # then invoke_model / converse as usualClaude via Google Vertex
from anthropic import AnthropicVertex
v = AnthropicVertex(region="us-east5", project_id="my-proj")
evalkit.patch_anthropic_vertex_client(v)OpenAI
import evalkit, openai
evalkit.init(subscription_key="tk_live_...")
client = openai.OpenAI() # auto-traced (sync)
# async: openai.AsyncOpenAI() auto-traced
# manual: evalkit.patch_openai_client(client) / evalkit.patch_async_openai_client(aclient)OpenAI-compatible providers (Groq, Together, Fireworks, xAI, …): point the OpenAI client at their
base_url — they trace through the OpenAI instrumentation automatically. In Python you can also route them through LiteLLM (below).Google Gemini
# New unified SDK (google-genai) — also used by Google ADK
import evalkit
evalkit.init(subscription_key="tk_live_...")
evalkit.patch_google_genai() # patches google.genai Models
# Legacy google-generativeai:
# evalkit.patch_google_ai_model(model)Cohere
evalkit.patch_cohere_client(cohere_client)Mistral (Python)
from mistralai import Mistral
client = Mistral(api_key=...)
evalkit.patch_mistral_client(client) # async: patch_async_mistral_client(aclient)LiteLLM (Python)
import evalkit, litellm
evalkit.init(subscription_key="tk_live_...") # litellm.completion/acompletion auto-traced
# manual: evalkit.patch_litellm()
resp = litellm.completion(model="claude-opus-4-8", messages=[{"role":"user","content":"hi"}])Support matrix
| Provider | Python | TypeScript |
|---|---|---|
| OpenAI (sync/async) | ✅ | ✅ |
| Anthropic / Claude (sync/async) | ✅ | ✅ |
| Claude via Bedrock | ✅ | ✅ |
| Claude via Vertex | ✅ | ✅ |
| Google Gemini (genai / legacy / Vertex) | ✅ | ✅ |
| Cohere | ✅ | ✅ |
| Mistral | ✅ | — |
| LiteLLM | ✅ | — |
| Groq / OpenAI-compatible | ✅ (OpenAI client / LiteLLM) | ✅ (OpenAI client) |