LiveKit Agents builds realtime voice agents
around an AgentSession. Bodhi provides the text-to-speech stage as a standard
LiveKit tts.TTS provider — audio streams out as it is generated, and an
interruption cancels it mid-utterance.
Install
pip install "livekit-plugins-bodhi"Needs livekit-agents 1.0 or newer. Verified against 1.8.6.
Add it to a session
from livekit.agents import AgentSession
from livekit.plugins import bodhi
session = AgentSession(
# ... stt, vad, llm
tts=bodhi.TTS(
voice="bhavana",
language="hi",
),
)api_key is read from $BODHI_API_KEY when omitted, and base_url defaults to
https://tts.navana.ai. Everything else has a default.
Arguments
| Argument | Required | Description |
|---|---|---|
api_key |
No | Your platform API key, sent as the Authorization: Bearer and x-api-key headers. Falls back to $BODHI_API_KEY. |
voice |
No | Voice id. Defaults to default_female. See Voices and languages. |
language |
No | Language to synthesize in, as a two-letter code (hi, gu, en, …). Defaults to Hindi. |
sample_rate |
No | Output rate in Hz: 8000, 16000 or 24000. Defaults to 24000. |
base_url |
No | Override the endpoint, usually to point at a different deployment. Defaults to https://tts.navana.ai. |
use_fast |
No | Use the distilled model where one is available. Faster, slightly lower quality. |
num_step |
No | Flow-matching steps, 1 to 100. Higher is slower and cleaner. Omit for the voice’s own default. |
guidance_scale |
No | Classifier-free guidance. Omit for the voice’s own default. |
How it maps onto LiveKit
Audio is produced as SynthesizedAudio frames, which is the contract every
LiveKit TTS plugin follows. Because the audio flows through the session, an
interruption cancels the utterance in progress rather than letting it play to
the end, so barge-in works the same as with any other provider.
Sentences are sent as they arrive from the LLM, and the first audio comes back while the rest is still being synthesized.