What you’ll need
- A Rime API key. If you don’t have one, create one.
- A LiveKit Cloud project, with its URL, an API key, and the key’s secret. Your own LiveKit server works too.
- uv 0.9.26 or later, which installs Python for the project if needed. The Rime SDK needs Python 3.11 or later.
- A browser with a microphone.
Build the agent
1
Create the project
Create a Python project:Before you install anything, add this to Now install the packages, pinned to the versions we tested. The Rime plugin is a preview build from Rime’s fork of LiveKit Agents, because no LiveKit release has Prism support yet. Its
pyproject.toml, so the plugin’s Git workspace doesn’t replace the published LiveKit Agents:pyproject.toml
realtime extra adds the Rime SDK:2
Set your credentials
Create
.env.local in your project folder with your own values. Your LiveKit Cloud project’s settings show its URL and let you create an API key and secret:.env.local
3
Save the agent
Save this script as Here’s what each part does:
agent.py in your project folder. It registers an agent named prism-agent, which starts a Prism session in the aurora voice and greets the caller in each room it joins.agent.py
rime.realtime.RealtimeModel: Prism, passed toAgentSessionas itsllm. It connects towss://prism.api.rime.ai/v1/realtimeby default. Prism does all three jobs, so the session has nostt,tts,vad, orturn_detection.voice:aurora,wawona,brando, orastra.CafeAgent: Prism’s instructions and tools.@function_tool: makesget_opening_hoursa tool, described to Prism by its docstring. Prism decides when to call it, LiveKit runs it in your agent, and Prism replies with the result.text_input=False: keeps this example voice only. It’s optional, because the plugin also takes typed input through the history.ctx.add_shutdown_callback(model.aclose): closes the model and its SDK client when the job ends.generate_reply: asks Prism to speak first.
4
Start the agent
Run it in development mode from your project folder:The agent connects to your LiveKit project and logs
registered worker with "agent_name": "prism-agent". Leave it running. You can ignore the warning that dev is deprecated, or use lk agent dev from the LiveKit CLI instead.5
Talk to the agent
- In LiveKit Cloud, open your project’s Agent Console.
- Set the agent name to
prism-agent. - Select Start a session.
- When your browser asks, allow microphone access.
get_opening_hours: 8 a.m. to 4 p.m. Only the tool result has them, so hearing 4 p.m. means the room, the Prism session, turn detection, and your tool all work.Next, try to cut in: talk while Prism replies, and it stops to answer you.If the call doesn’t work:- The agent never joins: check that the console’s agent name is
prism-agentand the terminal showsregistered worker. - The agent joins but stays silent: look for a Rime plugin error in the terminal, and look up its code in Errors and limits.
How Prism changes a LiveKit agent
Prism runs the whole conversation, so a few LiveKit features work differently than in a pipeline agent:
To choose your own speech-to-text and LLM instead, build a pipeline agent with the LiveKit text-to-speech quickstart, where Rime gives the agent its voice.
Use your own LiveKit server
On your own server, which has no Agent Console, send the agent to a room with the LiveKit CLI:-
In
.env.local, setLIVEKIT_URL,LIVEKIT_API_KEY, andLIVEKIT_API_SECRETto your server’s values, and start the agent the same way. -
Send the agent to a room. Pass your server details with
--url,--api-key, and--api-secret, or set the same three variables in your shell. -
Join the
prism-testroom from any LiveKit client with a microphone, such as an app built with LiveKit’s frontend SDKs.
Next steps
Now that your agent answers, you can:- Take phone calls with LiveKit telephony.
- Write instructions for a phone call, starting with rules for speech.
- Choose a voice that suits your callers.
- Move an OpenAI Realtime agent on LiveKit to Prism.

