LiteLLM
Connect LiteLLM (library or proxy) to Radicas — native gen_ai telemetry via its built-in OTel callback.
Status: experimental — implemented (best-effort activation per the LiteLLM docs), not yet
fixture-verified; no registry card yet. LiteLLM is a router/proxy, not an agent framework:
you get LLM-request spans only, no agent/tool tree — still enough for cost estimation, and an
ideal capture point for opaque clients routed through the proxy.
Install
pip install "radicas[litellm]" # = radicas + litellmUse (library mode)
import radicas
radicas.init(service="router", feature="shared-llm")
# instrument="auto" detects litellm, registers the "otel" callback and sets
# LITELLM_OTEL_V2=true (one gen_ai-compliant trace per request).
import litellm
response = litellm.completion(model="claude-sonnet-4-5", messages=[...])
radicas.shutdown()Proxy mode: the callback is configured server-side in the proxy's own config
(litellm_settings: callbacks: ["otel"]) with the standard OTEL_EXPORTER_OTLP_* env — the
SDK strategy applies to library usage in your process.
What it emits
- Scope name:
litellm— expected, pending fixture. - Namespace: native
gen_ai.*(withLITELLM_OTEL_V2=true), including its owngen_ai.cost.*estimates. - Coverage: expected, pending fixture — model + token usage documented as emitted; cache tokens depend on the upstream provider.
Shim behavior
- Client-side adapter: none expected (
gen_ai.*native) — a light card may still be added for theradicas.source_frameworkstamp and any name drift. - Server-side OTTL: pending the same card.
Known limitations
- LLM-request spans only: no
invoke_agentroot, noexecute_tool— the tree views stay empty for this source; the LLM/cost views populate. - LiteLLM's
gen_ai.cost.*is an estimate feeding reconciliation, not a replacement for authoritative invoice data. - Content capture uses LiteLLM's own kill switches (
turn_off_message_logging) in addition to the SDK's opt-in.
Verify it works
SELECT model, input_tokens, output_tokens, estimated_cost_usd
FROM otel.llm_call ORDER BY ts DESC LIMIT 5;Bench recipe: providers/litellm/python in radicas-integrations (recipe only — the runnable
example is part of the pending deep-dive).