wrapLiteLLM() to trace all calls regardless of provider.
Installation
Setup
Example
What gets captured
| Field | Details |
|---|---|
| Model | The model string passed to LiteLLM (e.g. gpt-4o, claude-sonnet-4-6, gemini/gemini-2.5-flash) |
| Input tokens | From LiteLLM’s normalized usage field |
| Output tokens | From LiteLLM’s normalized usage field |
| Cost | From LiteLLM’s _hidden_params.response_cost if available, otherwise token-based |
| Latency | Total call duration |
LiteLLM normalizes provider responses. If a provider returns cost data, LiteLLM exposes it in
_hidden_params.response_cost — Zespan uses this when available for more accurate cost attribution.
