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.
ai7: the AI SDK no longer emits spans itself. They come from@ai-sdk/otel, andinit()registers it for you. Node 22 or newer is required, the same floor asai7.ai5 and 6: telemetry is built in but off until a call setsexperimental_telemetrywithisEnabledset 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
serviceNameyou pass toinit().session.idanduser.idkeep 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
-
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. -
Install the SDK, and on
ai7 the telemetry package:npm install @glassflow-ai/rius @opentelemetry/api npm install @ai-sdk/otel -
Replace your Phoenix registration and exporter code with
init(). Awaitreadyso the AI SDK integration is registered before the first call, and callshutdown()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 -
On
ai5 or 6, skip@ai-sdk/oteland enable telemetry on each call:const { text } = await generateText({ model: openai('gpt-4o-mini'), prompt: 'Summarize this ticket', experimental_telemetry: { isEnabled: true }, }) -
Carry over your sessions and users. Phoenix’s
session.idanduser.idare the same attributes Rius reads. In TypeScript you set them withwithSessionandwithUser. Put them on every span, the root included. -
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
otlphttpexporter for Rius there, then make the switch toinit()once the numbers match. The Migrate from Arize Phoenix guide shows the side-by-side setup in Python and ends with a cutover checklist. -
Verify one call. On
ai7,await rius.readylistsvercel-ai, andinit()warns if it findsai7 without@ai-sdk/otel. Onai5 and 6,readydoes not listvercel-aieven when tracing works, so check the trace in the console instead. A missingexperimental_telemetrysetting is the usual cause of an empty trace. -
Once you have switched, remove the Phoenix exporter and revoke its key. If you installed
@arizeai/openinference-vercelearlier, 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, achatspan for each model call and anexecute_toolspan 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: falseand amaskapply 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.