Rime integration guide

How to use the Rime TTS plugin for LiveKit Agents.

Overview

Rime provides text-to-speech synthesis (TTS) optimized for speed and quality. With LiveKit's Rime integration and the Agents framework, you can build voice AI applications that are responsive and sound realistic.

To learn more about TTS and generating agent speech, see Agent speech.

Quick reference

This section includes a basic usage example and some reference material. For links to more detailed documentation, see Additional resources.

Installation

Install the plugin from PyPI:

pip install "livekit-agents[rime]~=1.0rc"

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 rime
session = AgentSession(
tts=rime.TTS(
model="mist",
speaker="rainforest",
speed_alpha=0.9,
reduce_latency=True,
),
# ... llm, stt, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

modelstringOptionalDefault: mist

ID of the model to use. To learn more, see Models.

speakerstringOptionalDefault: lagoon

ID of the voice to use for speech generation. To learn more, see Voices.

audio_formatTTSEncodingOptionalDefault: pcm

Audio format to use. Valid values are: pcm and mp3.

sample_rateintegerOptionalDefault: 16000

Sample rate of the generated audio. Set this rate to best match your application needs. To learn more, see Recommendations for reducing response time.

speed_alphafloatOptionalDefault: 1.0

Adjusts the speed of speech. Lower than 1.0 results in faster speech; higher than 1.0 results in slower speech.

reduce_latencybooleanOptionalDefault: false

When 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. To learn more, see Recommendations for reducing response time.

phonemize_between_bracketsbooleanOptionalDefault: false

When set to true, allows the use of custom pronunciation strings in text. To learn more, see Custom pronunciation.

api_keystringOptionalEnv: RIME_API_KEY

Rime API Key. Required if the environment variable isn't set.

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.

Voice AI quickstart

Get started with LiveKit Agents and Rime TTS.