livekit-plugins-rime 1.8.3


pip install livekit-plugins-rime

  Latest version

Released: Sep 23, 2026


Meta
Author: LiveKit
Requires Python: >=3.10.0

Classifiers

Intended Audience
  • Developers

Programming Language
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.11
  • Python :: 3.12

Topic
  • Multimedia :: Sound/Audio
  • Scientific/Engineering :: Artificial Intelligence

Rime plugin for LiveKit Agents

Support for voice synthesis with the Rime API.

See https://docs.livekit.io/agents/integrations/tts/rime/ for more information.

Installation

pip install livekit-plugins-rime

Pre-requisites

You'll need an API key from Rime. It can be set as an environment variable: RIME_API_KEY

Streaming WebSocket v1 API

The Rime v1 WebSocket protocol accepts streaming text and returns audio before the input turn is complete. The plugin aggregates input fragments into complete sentences before it sends them to Rime. All sentences in one LiveKit output turn use one continuous synthesis context.

import os

from livekit.plugins import rime

tts = rime.TTS(
    websocket_url="wss://api.rime.ai/coda/ws",
    speaker="lyra",
    api_key=os.environ["RIME_API_KEY"],
)

Pass the active model WebSocket endpoint explicitly. The presence of websocket_url selects WebSocket v1 streaming. For a route such as /coda/ws, the plugin reads the model from the path segment before /ws. Do not also pass model for this type of route.

Some dedicated Rime endpoints end with /ws and do not contain a model path segment. Pass model for these endpoints:

tts = rime.TTS(
    websocket_url="wss://tigerstripe-dialpad.aws-us-east-1.whiteglove.rime.ai/ws",
    model="coda",
    api_key=os.environ["RIME_API_KEY"],
)

The plugin sends the Rime API key to the endpoint. It trusts rime.ai and its subdomains by default. To use an endpoint on a different domain, confirm that you trust it and set allow_custom_endpoint=True. This opt-in also applies to base_url.

The websocket_protocol option accepts binary or json. It defaults to binary, which uses the rime.v1.binary subprotocol and protobuf binary frames. Set websocket_protocol="json" to use the rime.v1.json subprotocol and canonical proto3 JSON text frames.

The speaker defaults to lyra for Coda and cove for Mist across all transports. This also applies when the model is omitted and defaults to Coda. An explicit speaker is preserved. The plugin uses livekit.agents.tokenize.blingfire.SentenceTokenizer by default and configures it to emit one complete sentence at a time. Pass tokenizer to select another LiveKit sentence tokenizer. A custom tokenizer must emit complete sentence units that are safe for Rime text normalization.

The plugin sends the resolved sample rate in every HTTP, WS3, and WebSocket v1 request so it matches the audio emitter's rate. Pass sample_rate to override the model default.

The public WebSocket v1 endpoint currently supports Coda. The future Mist route will use /mist/ws, not /mistv3/ws.

Select the Rime output format with audio_format. It defaults to audio/pcm. The adapter supports all canonical formats from the Rime interface:

  • audio/pcm
  • audio/wav
  • audio/mpeg
  • audio/ogg;codecs=opus
  • audio/webm;codecs=opus
  • audio/pcmu

Both WebSocket protocols support every format. The binary protocol sends the encoded audio bytes directly. The JSON protocol sends the same bytes as base64 text.

PCMU uses the selected sample rate. Choosing audio/pcmu keeps the model default, which is 24,000 Hz for Coda. The plugin decodes PCMU to 16-bit PCM at the same rate. To request 8,000 Hz, set sample_rate explicitly:

tts = rime.TTS(
    websocket_url="wss://api.rime.ai/coda/ws",
    audio_format="audio/pcmu",
    sample_rate=8000,
    api_key=os.environ["RIME_API_KEY"],
)

The v1 interface uses time_scale_factor for speed control. The deprecated speed_alpha option applies only to the older Rime interfaces.

One LiveKit stream uses one continuous Rime synthesis context. These stream methods map to the Rime lifecycle as follows:

LiveKit method Local action Rime operation
stream.push_text() Buffer and sentence-tokenize text. Send text for each completed sentence.
stream.flush() Release the current tokenizer buffer and keep the context open. Send released content as text; no flush operation exists.
stream.end_input() Drain final text and finalize input. Send end.
stream.aclose() Stop active synthesis. Send cancel when needed.

You can send more text after flush(). The same Rime context remains active, and an input pause needs no wire message. Only end_input() ends normal input and causes Rime to send done. Each outgoing text value must be a stable sentence-sized unit. Calling flush() drains any buffered fragment, so call it only after a complete sentence or a stable clause.

The v1 implementation has these limits:

  • It does not provide aligned word timestamps.
  • The adapter reuses WebSocket connections between sequential LiveKit streams. It does not run concurrent contexts on one WebSocket. Concurrent LiveKit streams use separate pooled WebSocket connections.
1.8.3 Sep 23, 2026
1.8.2 Sep 15, 2026
1.8.1 Sep 10, 2026
1.8.0 Sep 05, 2026
1.7.1 Aug 27, 2026
1.7.0 Aug 20, 2026
1.6.11rc1 Aug 13, 2026
1.6.10 Aug 13, 2026
1.6.9 Aug 07, 2026
1.6.8 Aug 03, 2026
1.6.7 Jul 25, 2026
1.6.6 Jul 18, 2026
1.6.5 Jul 09, 2026
1.6.4 Jun 24, 2026
1.6.3 Jun 22, 2026
1.6.2 Jun 19, 2026
1.6.1 Jun 17, 2026
1.6.0 Jun 11, 2026
1.6.0rc2 May 29, 2026
1.6.0rc1 May 27, 2026
1.5.19rc1 Jun 08, 2026
1.5.18 Jun 05, 2026
1.5.17 Jun 03, 2026
1.5.16 Jun 01, 2026
1.5.15 May 29, 2026
1.5.14 May 27, 2026
1.5.13 May 25, 2026
1.5.12 May 21, 2026
1.5.11 May 19, 2026
1.5.10 May 18, 2026
1.5.9 May 13, 2026
1.5.8 May 05, 2026
1.5.7 Apr 30, 2026
1.5.6 Apr 22, 2026
1.5.5 Apr 20, 2026
1.5.4 Apr 16, 2026
1.5.3 Apr 15, 2026
1.5.2 Apr 08, 2026
1.5.1 Mar 23, 2026
1.5.0 Mar 19, 2026
1.5.0rc2 Mar 06, 2026
1.5.0rc1 Feb 13, 2026
1.4.6 Mar 16, 2026
1.4.5 Mar 11, 2026
1.4.4 Mar 03, 2026
1.4.3 Feb 23, 2026
1.4.2 Feb 17, 2026
1.4.1 Feb 06, 2026
1.4.0rc2 Jan 23, 2026
1.4.0rc1 Dec 23, 2025
1.3.12 Jan 21, 2026
1.3.11 Jan 14, 2026
1.3.10 Dec 23, 2025
1.3.9 Dec 19, 2025
1.3.8 Dec 17, 2025
1.3.7 Dec 16, 2025
1.3.6 Dec 03, 2025
1.3.5 Nov 25, 2025
1.3.4 Nov 24, 2025
1.3.3 Nov 19, 2025
1.3.2 Nov 17, 2025
1.3.1 Nov 17, 2025
1.3.0rc2 Nov 15, 2025
1.3.0rc1 Nov 06, 2025
1.2.18 Nov 05, 2025
1.2.17 Oct 29, 2025
1.2.16 Oct 27, 2025
1.2.15 Oct 15, 2025
1.2.14 Oct 01, 2025
1.2.13 Oct 01, 2025
1.2.12 Sep 29, 2025
1.2.11 Sep 18, 2025
1.2.9 Sep 15, 2025
1.2.8 Sep 02, 2025
1.2.7 Aug 28, 2025
1.2.6 Aug 18, 2025
1.2.5 Aug 10, 2025
1.2.4 Aug 07, 2025
1.2.3 Aug 04, 2025
1.2.2 Jul 24, 2025
1.2.1 Jul 17, 2025
1.2.0 Jul 17, 2025
1.1.7 Jul 15, 2025
1.1.6 Jul 10, 2025
1.1.5 Jun 30, 2025
1.1.4 Jun 25, 2025
1.1.3 Jun 21, 2025
1.1.2 Jun 20, 2025
1.1.1 Jun 10, 2025
1.1.0 Jun 10, 2025
1.0.23 May 29, 2025
1.0.22 May 17, 2025
1.0.21 May 15, 2025
1.0.20 May 08, 2025
1.0.19 May 03, 2025
1.0.18 May 01, 2025
1.0.17 Apr 24, 2025
1.0.16 Apr 22, 2025
1.0.15 Apr 22, 2025
1.0.14 Apr 22, 2025
1.0.13 Apr 15, 2025
1.0.12 Apr 15, 2025
1.0.11 Apr 10, 2025
1.0.0rc9 Apr 07, 2025
1.0.0rc8 Apr 07, 2025
1.0.0rc7 Apr 07, 2025
1.0.0rc6 Apr 03, 2025
1.0.0rc5 Apr 03, 2025
1.0.0rc4 Mar 29, 2025
1.0.0rc3 Mar 27, 2025
1.0.0rc2 Mar 27, 2025
1.0.0rc1 Mar 26, 2025
1.0.0.dev5 Mar 19, 2025
1.0.0.dev4 Mar 19, 2025
0.2.3 May 19, 2025
0.2.2 Mar 19, 2025
0.2.1 Mar 06, 2025
0.2.0 Jan 22, 2025
Extras: None
Dependencies:
livekit-agents[codecs] (>=1.8.3)
protobuf (>=6.33.5)
rime-api (>=0.0.1)