Skip to Content

How do I switch from Arize Phoenix to Rius for the Vercel AI SDK?

Rius traces the Vercel AI SDK from a single init() call, so you swap your Phoenix setup for the Rius SDK. After the switch, each call shows up with its messages, model, tokens and cost. This page covers the TypeScript steps for ai 7 and for ai 5 and 6, and what changes in your traces.

How it works

The Vercel AI SDK is JavaScript only, so this path uses the TypeScript SDK, @glassflow-ai/rius. Rius reads the AI SDK’s own OpenTelemetry telemetry, so there is no extra translation layer to run.

  • ai 7: the AI SDK no longer emits spans itself. They come from @ai-sdk/otel, and init() registers it for you. Node 22 or newer is required, the same floor as ai 7.
  • ai 5 and 6: telemetry is built in but off until a call sets experimental_telemetry with isEnabled set to true. There is nothing else to install, and Node 18 or newer works.
  • Phoenix concepts map across. A Phoenix project becomes a Rius agent, named by the serviceName you pass to init(). session.id and user.id keep the same attribute names. Rius computes cost on its side, so you send tokens and never a cost.
  • Each model call counts once. The span that wraps the calls, such as the agent span, still shows the run’s total.

See Vercel AI SDK for the full recipe and Integrations for the other libraries Rius covers.

Set it up

  1. Create a Rius workspace and an API key. Keys start with ri_. If you used separate Phoenix projects per environment, give each environment its own workspace and API key, because Rius groups traces by agent name, not by Phoenix project.

  2. Install the SDK, and on ai 7 the telemetry package:

    npm install @glassflow-ai/rius @opentelemetry/api npm install @ai-sdk/otel
  3. Replace your Phoenix registration and exporter code with init(). Await ready so the AI SDK integration is registered before the first call, and call shutdown() before a short script exits, because the TypeScript SDK does not flush spans on exit:

    import { init } from '@glassflow-ai/rius' import { openai } from '@ai-sdk/openai' import { generateText } from 'ai' const rius = init({ apiKey: 'ri_...', serviceName: 'my-agent' }) await rius.ready // the AI SDK integration is registered before the first call const { text } = await generateText({ model: openai('gpt-4o-mini'), prompt: 'Summarize this ticket', }) await rius.shutdown() // export queued spans before the process exits
  4. On ai 5 or 6, skip @ai-sdk/otel and enable telemetry on each call:

    const { text } = await generateText({ model: openai('gpt-4o-mini'), prompt: 'Summarize this ticket', experimental_telemetry: { isEnabled: true }, })
  5. Carry over your sessions and users. Phoenix’s session.id and user.id are the same attributes Rius reads. In TypeScript you set them with withSession and withUser. Put them on every span, the root included.

  6. To run Phoenix and Rius side by side while you compare, do it before step 3, with your Phoenix setup still in place: if you route through an OpenTelemetry Collector, add one extra otlphttp exporter for Rius there, then make the switch to init() once the numbers match. The Migrate from Arize Phoenix guide shows the side-by-side setup in Python and ends with a cutover checklist.

  7. Verify one call. On ai 7, await rius.ready lists vercel-ai, and init() warns if it finds ai 7 without @ai-sdk/otel. On ai 5 and 6, ready does not list vercel-ai even when tracing works, so check the trace in the console instead. A missing experimental_telemetry setting is the usual cause of an empty trace.

  8. Once you have switched, remove the Phoenix exporter and revoke its key. If you installed @arizeai/openinference-vercel earlier, Rius no longer uses it, so you can uninstall it.

What you get

  • A clear trace for each call. You see input and output messages, the request’s tool definitions, the resolved model, and token usage including cache reads, cache writes when the AI SDK reports them, and reasoning tokens.
  • The loop structure. An agent span (invoke_agent) wraps a tool-calling loop, with a span for each step, a chat span for each model call and an execute_tool span for each tool execution.
  • Time to first token on streamed calls.
  • Cost per call. Rius computes it from the model and tokens as a list-price estimate in US dollars.
  • Content controls. captureContent: false and a mask apply to prompts, responses, tool definitions, the system prompt and tool arguments and results.
  • Fresh history. Rius starts from the first span you send it, and existing Phoenix traces stay in Phoenix.

On ai 5 and 6, image, speech and transcription calls are not traced. On ai 7 they are.

When something else fits

  • If you depend on Phoenix evals, datasets, experiments, prompt management or annotations, keep Phoenix for those. Rius does not offer them, so run both rather than cutting over fully.
  • If you want to keep your OpenInference instrumentation and only change where it exports, the Migrate from Arize Phoenix guide covers that route, and Migrate to Rius lists the other tools.
  • If you add custom model prices in Phoenix, note that Rius prices calls at public list prices only.

Still stuck? Get help

Last updated on