I trace LiteLLM with Helicone. How do I switch to Rius?
Rius traces LiteLLM with one Python integration, so you install the litellm extra, call rius.init(), and remove the Helicone setup from your LiteLLM calls. Each routed completion then arrives as a span with the model, token counts and a server-side cost. You can keep Helicone in place while you compare the two, then cut over.
How it works
Helicone mainly works as a proxy. Your client sends requests through a Helicone base URL, and Helicone logs them on the way through. Rius works inside your process. The Rius SDK instruments LiteLLM itself and exports spans, so nothing sits between your code and the provider.
Because one integration covers LiteLLM, it covers every provider behind the router. Rius computes cost from the model and token counts. You never send a cost value.
A few details apply to LiteLLM in particular:
- Model names. LiteLLM’s routing prefix is dropped when it names the provider, so
openai/gpt-4o-miniis stored asgpt-4o-miniwith the provideropenai. Update any model filter that matched the prefixed form. - OpenAI-compatible providers. LiteLLM calls them through the
openaiclient library. If theopenaiextra is also installed, that call appears as a second span under the LiteLLM span. Tokens and cost are still counted once, and the LiteLLM span shows the run’s total. - Python only. The LiteLLM integration exists for Python. From TypeScript, calls to a LiteLLM proxy over its OpenAI-compatible endpoint are traced by the OpenAI integration, and the model recorded is the one you ask the proxy for.
The full list of supported libraries and frameworks is on the Integrations page.
Set it up
-
Install the Rius integration for LiteLLM. The extra installs the instrumentation, not
litellmitself, so the package is named for a fresh environment. A project that already calls LiteLLM has it.pip install "glassflow-rius[litellm]" litellm -
Call
rius.init()once at startup, before your first LiteLLM call. Your completion code does not change.import rius import litellm rius.init(api_key="ri_...", service_name="my-agent") response = litellm.completion( model="gpt-4o-mini", # or any provider LiteLLM routes to messages=[{"role": "user", "content": "hi"}], ) -
Run both tools side by side if you want to compare.
- If you reach providers through the Helicone proxy or gateway, you can leave the Helicone base URL and headers in place. Rius patches the client library in your process, not the network path, so calls are traced whatever base URL they use.
- Use plain model names such as
gpt-4o-mini, not the gateway’sgpt-4o-mini/openaiform, or calls show tokens but no cost. - A response Helicone serves from its cache is recorded in Rius like any other call, so Rius cost is higher than Helicone’s by your cache-hit share.
- If you use Helicone’s async logger, do not run it in the same process as the Rius SDK. Both register the process-wide OpenTelemetry tracer provider, and only the first registration is kept. Run each in a separate service, or compare one deploy on each.
-
Move your Helicone headers onto Rius equivalents.
Helicone-Session-Idbecomes a session scope andHelicone-User-Idbecomes a user scope. Every span inside a scope, including the LiteLLM call, carriessession.idanduser.id.with rius.session(session_id): with rius.user(request.user_id): response = litellm.completion(model="gpt-4o-mini", messages=messages)For
Helicone-Property-*values, set span attributes on the span that wraps the work. The Helicone migration guide maps each header and property in full. -
Verify one call. Run a completion and open the trace in the console. The span shows the model, token counts and a cost. Compare request counts, token totals and cost with Helicone for a few days, then remove the Helicone base URL,
Helicone-*headers or async logger, and revoke the Helicone API key once nothing sends to it.
What you get
- A span for each routed LiteLLM completion with the model, token usage and messages, and a cost that Rius computes. Costs are list-price estimates in US dollars.
- Model analytics across every provider you route to. Switching providers keeps your tracing unchanged.
- Sessions and users that you set with
rius.sessionandrius.user, shown on the trace and on the Users page. - A trace tree that comes from how your spans nest, instead of a Helicone session path string.
- Alerts, plus an MCP server that lets your coding agent query production traces.
The overview of moving from other tools is in Migrate to Rius.
When something else fits
- Rius is not a gateway. If you depend on Helicone for caching, rate limits, retries or fallbacks, keep the gateway and add Rius next to it.
- Rius has no prompt management, scores, datasets or evals, and it cannot import your Helicone history. Keep Helicone for those, and start Rius traces from the cutover.
- If you run LiteLLM as a proxy server, the proxy is a separate process. Instrument the proxy itself, or send its OpenTelemetry traces to Rius.