Rime provides a migration guide for moving your LiveKit agent to Rime TTS.
Create a new agent in your browser using this model
Overview
Rime text-to-speech is available in LiveKit Agents through LiveKit Inference and the Rime plugin. With LiveKit Inference, your agent runs on LiveKit's infrastructure to minimize latency. No separate provider API key is required, and usage and rate limits are managed through LiveKit Cloud. Use the plugin instead if you want to manage your own billing and rate limits. Pricing for LiveKit Inference is available on the pricing page .
LiveKit Inference
Use LiveKit Inference to access Rime TTS without a separate Rime API key.
A checkmark in the EU endpoint column means the model has a dedicated EU endpoint, in addition to the global endpoint. To learn more, see Data residency.
| Model name | Model ID | Languages | EU endpoint |
|---|---|---|---|
Coda | rime/coda | enesfrdehijaptar | No EU endpoint |
Mist | rime/mist | en | No EU endpoint |
Mist v2 | rime/mistv2 | enesfrde | No EU endpoint |
Mist v3 | rime/mistv3 | enesfrdehi | No EU endpoint |
Arcana Retired | rime/arcana | enesfrdehihejaptar | No EU endpoint |
Usage
To use Rime, use the TTS class from the inference module:
from livekit.agents import AgentSession, inferencesession = AgentSession(tts=inference.TTS(model="rime/coda",voice="celeste",language="en"),# ... tts, stt, vad, turn_handling, etc.)
import { AgentSession, inference } from '@livekit/agents';const session = new AgentSession({tts: new inference.TTS({model: "rime/coda",voice: "celeste",language: "en"}),// ... tts, stt, vad, turnHandling, etc.});
Parameters
modelstringThe model ID from the models list.
voicestringSee voices for guidance on selecting a voice.
languageLanguageCodeLanguage code for the input text. The framework automatically converts to the format expected by the Rime API.
extra_kwargsdictAdditional parameters to pass to the Rime TTS API. See model parameters for supported fields.
In Node.js this parameter is called modelOptions.
Model parameters
Pass the following parameters inside extra_kwargs (Python) or modelOptions (Node.js). Each parameter applies only to the models listed in the Models column.
| Parameter | Type | Default | Models | Notes |
|---|---|---|---|---|
speed_alpha | float | 1.0 | coda, mist, mistv2, mistv3 | Speed multiplier. Values less than 1.0 produce faster speech; values greater than 1.0 produce slower speech. |
pause_between_brackets | bool | False | mist, mistv2, mistv3 | Whether to insert a pause at bracket positions in the text. |
phonemize_between_brackets | bool | False | mist, mistv2, mistv3 | Whether to interpret text between brackets as phonemes for custom pronunciation . |
inline_speed_alpha | str | mist, mistv2, mistv3 | Comma-separated list of speed multipliers applied inline to segments of text. | |
no_text_normalization | bool | False | mist, mistv2, mistv3 | Whether to skip text normalization (disabling expansion of numbers, abbreviations, etc.). Might reduce latency but can affect pronunciation of digits and abbreviations. |
time_scale_factor | float | 1.0 | coda, mistv3 | Controls audio playback speed. Values greater than 1.0 slow the audio; values less than 1.0 speed it up. Serialized as timeScaleFactor to match the Rime API. |
Voices
LiveKit Inference supports all of the voices available in the Rime API. You can view the default voices and explore the wider set in the API in the Rime voices documentation , and use the voice by copying its name into your LiveKit agent session.
The following is a small sample of the Rime voices available in LiveKit Inference.
String descriptors
As a shortcut, you can also pass a descriptor with the model ID and voice directly to the tts argument in your AgentSession:
from livekit.agents import AgentSessionsession = AgentSession(tts="rime/coda:celeste",# ... llm, stt, vad, turn_handling, etc.)
import { AgentSession } from '@livekit/agents';const session = new AgentSession({tts: "rime/coda:celeste",// ... tts, stt, vad, turnHandling, etc.});
Plugin
LiveKit's plugin support for Rime lets you connect directly to Rime's TTS API with your own API key.
Installation
Install the plugin:
uv add "livekit-agents[rime]~=1.5"
pnpm add @livekit/agents-plugin-rime@1.x
Authentication
The Rime plugin requires a Rime API key .
Set RIME_API_KEY in your .env file.
Usage
Use Rime TTS within an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.
from livekit.plugins import rimesession = AgentSession(tts=rime.TTS(model="coda",speaker="celeste",speed_alpha=0.9,),# ... llm, stt, etc.)
import * as rime from '@livekit/agents-plugin-rime';const session = new voice.AgentSession({tts: new rime.TTS({modelId: "coda",speaker: "celeste",}),// ... llm, tts, etc.});
WebSocket streaming
By default, the plugin synthesizes speech over Rime's HTTP API. Set use_websocket=True to opt into WebSocket streaming, which lowers latency and emits word-level timestamps for TTS-aligned transcriptions. Streaming and aligned transcripts are enabled automatically when WebSocket mode is active.
from livekit.plugins import rimesession = AgentSession(tts=rime.TTS(model="coda",speaker="celeste",use_websocket=True,segment="bySentence",),# ... llm, stt, etc.)
import * as rime from '@livekit/agents-plugin-rime';const session = new voice.AgentSession({tts: new rime.TTS({modelId: "coda",speaker: "celeste",useWebsocket: true,segment: "bySentence",}),// ... llm, tts, etc.});
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
The coda model supports repetition_penalty, temperature, top_p, and max_tokens. The pause_between_brackets and phonemize_between_brackets parameters apply to the mist models only, and reduce_latency applies to mistv2 only.
modelstringDefault: codaID of the model to use. To learn more, see Models .
speakerstringID of the voice to use for speech generation. To learn more, see Voices .
When unset, the default depends on the SDK and on whether you also set model. In Python, omitting model gives astra, setting model="coda" gives lyra, and setting a mist model gives cove. In Node.js, setting modelId: "coda" gives lyra and every other case gives luna.
langTTSLangs | stringDefault: engLanguage of the input text. The TTSLangs type covers eng, spa, fra, ger, and hin, and you can pass any other language code that the Rime API accepts. To learn more, see Models .
In Node.js, this parameter has no default. When you leave it unset, the plugin omits it from the request and Rime applies its own default.
sample_rateintegerDefault: 22050Sample rate of the generated audio. Set this rate to best match your application needs. To learn more, see Recommendations for reducing response time .
In Node.js, this parameter is called samplingRate, and its default varies by model: 16000 for mistv2 and 24000 for every other model.
speed_alphafloatDefault: 1.0Adjusts the speed of speech. Lower than 1.0 results in faster speech while higher than 1.0 results in slower speech. Supported on all models, and the only speed control that works over WebSocket streaming.
In Node.js, this parameter is called speedAlpha and applies to the mist models only.
time_scale_factorfloatDefault: 1.0Controls audio playback speed. Values greater than 1.0 slow the audio while values less than 1.0 speed it up. Supported on the coda and mistv3 models only. Passing it with mistv2 raises an error. It applies to HTTP synthesis only; Rime ignores it over WebSocket streaming, where speed_alpha is the only speed control.
In Node.js, this parameter is called timeScaleFactor.
reduce_latencybooleanDefault: falseWhen set to true, turns off text normalization to reduce the amount of time spent preparing input text for TTS inference. This might result in the mispronunciation of digits and abbreviations. Supported on mistv2 only. To learn more, see Recommendations for reducing response time .
phonemize_between_bracketsbooleanDefault: falseWhen set to true, allows the use of custom pronunciation strings in text. To learn more, see Custom pronunciation . Supported on the mist models (mist, mistv2, mistv3) only.
api_keystringEnv: RIME_API_KEYRime API Key. Required if the environment variable isn't set.
use_websocketbooleanDefault: falseOpts into WebSocket streaming. When false, the plugin uses Rime's HTTP API. WebSocket mode enables streaming and word-level timestamps automatically. To learn more, see WebSockets .
In Node.js, this parameter is called useWebsocket.
base_urlstringOverrides the Rime endpoint URL. Defaults to https://users.rime.ai/v1/rime-tts for HTTP synthesis and wss://users-ws.rime.ai for WebSocket streaming. Passing a ws:// or wss:// URL sets use_websocket=True.
In Node.js, this parameter is called baseURL.
segmentstringDefault: bySentenceRequires use_websocket=True. Controls server-side text segmentation:
"bySentence"(default) synthesizes at sentence boundaries."immediate"synthesizes as soon as text arrives in the buffer."never"waits for explicit flush commands.
To learn more, see Segment values .
tokenizerSentenceTokenizerRequires use_websocket=True. Client-side sentence tokenizer used to split text into sentences before streaming to Rime. Defaults to the SDK's built-in sentence tokenizer.
Customizing pronunciation
Rime TTS supports customizing pronunciation. To learn more, see Custom Pronunciation guide .
Additional resources
The following resources provide more information about using Rime with LiveKit Agents.