Testing With Real LLM Providers
TraceLLM is provider-agnostic. Users can call OpenAI, Anthropic Claude, Gemini, or any other provider. The SDK records normalized sessions, spans, events, errors, and usage.
Use your normal application or a small test route in your app. The important part is that TraceLLM wraps the real provider call, not a demo response.
Common Variables
TRACELLM_ENDPOINT=https://api.tracellm.in
TRACELLM_API_KEY=trllm_your_key_from_the_ui
TRACELLM_SERVICE_NAME=my-ai-service
OpenAI
The app calls:
TraceLLM records:
- provider:
openai - model
- response id
- output text, if content capture allows it
- token usage, if returned
Anthropic Claude
The app calls:
TraceLLM records:
- provider:
anthropic - model
- response id
- output text, if content capture allows it
- input and output tokens
Gemini
The app calls:
TraceLLM records:
- provider:
gemini - model
- output text, if content capture allows it
- prompt, candidate, and total token counts when returned
What To Trace
A good provider test usually traces:
- Start a session for one user request.
- Start an
llmspan before calling the provider. - Record a
provider.request.startedevent. - Call the real provider.
- Record a
provider.response.receivedevent. - End the span with status, usage, and output.
- End the session.
This lets you compare TraceLLM behavior across providers while keeping the same session/span model.