Skip to main content

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://coda.api.rime.ai/ws",
    model="coda",
    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. Public model endpoints use port 443 and the /ws path. Pass model="coda" for wss://coda.api.rime.ai/ws, which serves Coda v2. Pass model="mistv3" for wss://mist.api.rime.ai/ws. The model name is not inferred from the hostname.

Dedicated deployment endpoints also require model when the path is /ws:

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 old api.rime.ai/<model> routes are scheduled for retirement. For compatibility, the plugin still reads the model from a path such as /coda/ws; omit model for those routes. Use the model hosts above for new configurations.

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://coda.api.rime.ai/ws",
    model="coda",
    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.

Metadata

Release files for livekit-plugins-rime 1.8.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livekit-plugins-rime 1.8.8
File Size Uploaded
livekit_plugins_rime-1.8.8.tar.gz 21.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-rime 1.8.8
File Interpreter ABI Platform
livekit_plugins_rime-1.8.8-py3-none-any.whl Python 3 none any Details

Total release size: 48.2 kB

Release files / livekit_plugins_rime-1.8.8.tar.gz

Download URL livekit_plugins_rime-1.8.8.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9f561929b99a13a1d78d6a2354911178b54ee060c871bcde20f31e5e5228bb20
BLAKE2b-256 checksum
How to use checksums
1bbe575c2afb8880c8bfb305795e8ddc328a63e2a118b1dfa93e858ea13c8184
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / livekit_plugins_rime-1.8.8-py3-none-any.whl

Download URL livekit_plugins_rime-1.8.8-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20ba19ab20d03424d474d2ddeb14e22bfa4897c098afa71cb3ce0156e8961acc
BLAKE2b-256 checksum
How to use checksums
211d32dafd2a08bbea9676e60e8a4b48107662a75df2a8bfe2bee15ddc2f97b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.8 This release

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.5

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.10

2 release files

1.6.9

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.15

2 release files

1.5.14

2 release files

1.5.13

2 release files

1.5.12

2 release files

1.5.11

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.3.12

2 release files

1.3.11

2 release files

1.3.10

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.17

2 release files

1.2.16

2 release files

1.2.15

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.17

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page