Skip to main content

Rime TTS plugin guide

How to use the Rime TTS plugin for LiveKit Agents.

Available in
Python
|
Node.js

Overview

This plugin allows you to use Rime as a TTS provider for your voice agents.

LiveKit Inference

Rime TTS is also available in LiveKit Inference, with billing and integration handled automatically. See the docs for more information.

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:

pip install "livekit-agents[rime]~=1.2"
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 rime
session = AgentSession(
tts=rime.TTS(
model="mist",
speaker="rainforest",
speed_alpha=0.9,
reduce_latency=True,
),
# ... llm, stt, etc.
)
import * as rime from '@livekit/agents-plugin-rime';
const session = new voice.AgentSession({
tts: new rime.TTS({
modelId: "mist",
speaker: "rainforest",
speedAlpha: 0.9,
reduceLatency: true,
}),
// ... llm, tts, 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.