I trace LiteLLM with Arize Phoenix. How do I switch to Rius?
Rius replaces your Phoenix setup for LiteLLM with one install and one init call. Swap register() for rius.init(), install the litellm extra, and every routed completion arrives as a span with model, tokens and cost. Or keep your OpenInference instrumentation and re-point its exporter at Rius. You can run both backends side by side until you cut over.
How it works
Phoenix is built on OpenTelemetry and OpenInference, and Rius reads OpenInference spans, so the move is a routing change rather than a rewrite. You have two paths, described in the Phoenix migration guide:
- Replace
register()withrius.init(). The Rius SDK ships the same kind of instrumentation as optional extras. Thelitellmextra covers every provider behind the router, so you delete your own instrumentor calls and theauto_instrument=Trueflag along withregister(). - Keep your instrumentation and re-point the exporter. This is the smallest diff, and it is also how you send to Phoenix and Rius at the same time.
The rest of this page follows the first path, because it is the one that uses the LiteLLM integration.
Two things change in your vocabulary. A Phoenix project becomes a Rius agent, named by service.name, so pass service_name to rius.init(). Cost is computed by Rius from the model and token counts, so you never send a cost value.
The LiteLLM integration is Python only. See Integrations for the full support matrix. If you call a LiteLLM proxy from TypeScript, the OpenAI integration traces those calls, and the model recorded is the one you ask the proxy for.
Set it up
-
Install the Rius instrumentation for LiteLLM, and remove the Phoenix package once you have cut over (step 5). The extra installs the instrumentation, not
litellmitself, so namelitellmin a fresh environment. Without it,init()logs aDependencyConflictand the integration stays off.pip install "glassflow-rius[litellm]" litellm -
Replace the
register()call withrius.init(), and swap Phoenix’susing_sessionforrius.session.# Before from phoenix.otel import register from openinference.instrumentation import using_session import litellm register(project_name="my-agent", auto_instrument=True) with using_session(conversation_id): response = litellm.completion( model="gpt-4o-mini", messages=[{"role": "user", "content": "hi"}], )# After import rius import litellm rius.init(api_key="ri_...", service_name="my-agent") with rius.session(conversation_id): response = litellm.completion( model="gpt-4o-mini", messages=[{"role": "user", "content": "hi"}], ) -
Switch
using_usertorius.userin the same change. The OpenInference context managers do not stamp spans you start with@rius.observe, which are usually the root, so the trace would lose its session and user. -
Run one completion and open the trace in the console. Check that the span shows the model, token counts and a cost.
-
To compare before you cut over, do this in place of step 2: keep
register()pointed at Phoenix and add Rius as a second span processor withreplace_default_processor=False, as the Phoenix guide shows. Once Rius shows what you need, make the swap in step 2 and runpip uninstall arize-phoenix-otel.
If you run LiteLLM as a proxy server rather than as a library, the proxy is a separate process. Instrument the proxy itself, or send its OpenTelemetry traces through the interoperability path.
What you get
- One span per routed completion. It carries the model, token usage and messages, and Rius computes the cost from the model and tokens as a list-price estimate in US dollars.
- Model analytics across providers. LiteLLM normalizes providers behind one API, so switching a provider keeps your tracing unchanged.
- Cleaner model names. When LiteLLM’s routing prefix names the provider, Rius stores the model without it, so
openai/gpt-4o-minilands asgpt-4o-miniwith the provideropenai. Update any model filter that matched the prefixed form. - Tokens and cost counted once. If the
openaiextra is also installed, the underlying client call appears as a second LLM span under the LiteLLM span. The call still counts once, and the LiteLLM span shows the run’s total. A few setups, such as streamed calls on some instrumentation versions, can still count twice. - Sessions and users.
rius.sessionandrius.userstamp every span in scope, root included.
Some Phoenix features have no Rius equivalent: evals, datasets and experiments, prompt management and the playground, annotations, custom model prices, and import of historical traces. Your old traces stay in Phoenix, and Rius starts from the first span you send. The Migrate to Rius overview lists what carries over for each tool.
When something else fits
- If evals, datasets or annotations are central to your workflow, keep Phoenix for those pieces and run the side-by-side setup instead of cutting over completely.
- If you want the smallest diff, keep your OpenInference instrumentation and only re-point the exporter at Rius, following Path A in the Phoenix guide.