Skip to main content

livekit-plugins-relay-speech

LiveKit Agents plugin for Relay Speech — a universal TTS adapter that serves from your reserved pool. Routes synthesis through a Relay Speech (OpenTTS) server which fronts multiple upstream TTS providers behind a single API, serves repeated sentences from your reserved pool, and tracks usage per API key.

Supported Providers

The plugin itself is provider-agnostic — it forwards your provider choice to the Relay Speech server. The server currently supports:

provider value Upstream Notes
cartesia Cartesia Models: sonic-3, sonic-2, etc.
elevenlabs ElevenLabs Multilingual + monolingual models
sarvam Sarvam AI Indic languages

Installation

pip install livekit-plugins-relay-speech

Usage

from livekit.plugins import relay_speech

tts = relay_speech.TTS(
    provider="cartesia",
    voice_id=tts_voice,
    model=tts_model or "sonic-3",
    language="hi-IN",
    emotion=["positivity:high", "curiosity"],   # Cartesia sonic-3 emotion controls
    pronunciation_dict_id="my_dict_id",         # Cartesia pronunciation dictionary
    api_key=CARTESIA_API_KEY,                   # provider key (or set CARTESIA_API_KEY env var)
    relay_speech_api_key=RELAY_API_KEY,         # Relay Speech server key
    reserve_pool=True,                          # serve repeated sentences from your reserved pool
)

Hand tts to your LiveKit AgentSession / VoicePipelineAgent like any other LiveKit TTS plugin.

Constructor Parameters

Param Type Default Description
provider str "cartesia" Upstream provider — cartesia, elevenlabs, sarvam.
voice_id str (required) Provider-specific voice identifier.
model str "sonic-3" TTS model name (provider-specific).
language str "en" BCP-47 language code (en, hi-IN, …).
speed float 0.0 -1.0 (slowest) → 1.0 (fastest); 0.0 = normal.
volume float 1.0 0.5 → 2.0; 1.0 = normal.
emotion list[str] | None None Provider voice-emotion tags (e.g. Cartesia sonic-3 emotion controls). Forwarded as-is.
pronunciation_dict_id str | None None Provider pronunciation-dictionary ID for custom pronunciations.
duration float | None None Target duration in seconds for the generated audio (Cartesia sonic-3).
max_buffer_delay_ms int | None None Max buffer delay (ms) before flushing a chunk (Cartesia sonic-3).
add_timestamps bool | None None Include word-level timestamps in the response (Cartesia sonic-3).
add_phoneme_timestamps bool | None None Include phoneme-level timestamps (Cartesia sonic-3).
use_normalized_timestamps bool | None None Return timestamps in normalized form (Cartesia sonic-3).
sample_rate int 24000 PCM sample rate (Hz). Must match server config.
api_key str | None env
relay_speech_api_key str | None env
reserve_pool bool False Serve repeated sentences from your reserved pool on the server.

tts.synthesize(text) uses a one-shot HTTP POST /v1/tts instead of the WebSocket path.

Metadata

Release files for livekit-plugins-relay-speech 0.1.2

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-relay-speech 0.1.2
File Size Uploaded Provenance Actions
livekit_plugins_relay_speech-0.1.2.tar.gz 9.0 kB Without provenance Details for livekit_plugins_relay_speech-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-relay-speech 0.1.2
File Interpreter ABI Platform Actions
livekit_plugins_relay_speech-0.1.2-py3-none-any.whl Python 3 none any Details for livekit_plugins_relay_speech-0.1.2-py3-none-any.whl

Total release size: 20.6 kB

Release files / livekit_plugins_relay_speech-0.1.2.tar.gz

Download URL livekit_plugins_relay_speech-0.1.2.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
09b06bd7453b57dcd5763d13179bdac90f1bb1f7934abc71510f0b26d321f5fe
BLAKE2b-256 checksum
How to use checksums
4e00a777ad3e1f8ad41df9d227a0e251e17aaedaed77878ebd8c49135f79ab43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / livekit_plugins_relay_speech-0.1.2-py3-none-any.whl

Download URL livekit_plugins_relay_speech-0.1.2-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
991c48cd3a3d3aa5ca5b2872690475834e0ceaf0c5bac6b0835c287169d44708
BLAKE2b-256 checksum
How to use checksums
1e76d284b2fe2724ee2e65dbd448be64b8b48dfd6f8f0657cbfc319ed7af0c52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for livekit-plugins-relay-speech 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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