LiveKit Agents builds realtime voice agents
around an AgentSession. Bodhi provides the speech-to-text stage as a standard
LiveKit stt.STT provider, so transcription behaves like any other LiveKit STT
plugin.
Install
pip install "livekit-plugins-bodhi"Needs livekit-agents 1.0 or newer. Verified against 1.8.6. For a full voice agent you will also want a VAD and an LLM plugin:
pip install "livekit-plugins-bodhi" "livekit-agents[silero]" "livekit-plugins-openai"Add it to a session
import os
from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli
from livekit.plugins import bodhi, silero, openai
async def entrypoint(ctx: JobContext):
session = AgentSession(
stt=bodhi.STT(
model="hi-general-v2-8khz",
sample_rate=8000,
hotwords=[bodhi.BodhiHotword("बजाज फिनसर्व", 2.0)],
),
vad=silero.VAD.load(),
llm=openai.LLM(model="gpt-4o-mini"),
tts=bodhi.TTS(language="hi", voice="default_female"),
)
await session.start(
agent=Agent(instructions="You are a helpful voice assistant."),
room=ctx.room,
)
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))model is the only argument you usually set. The API key is read from
$BODHI_API_KEY when api_key is omitted, and base_url defaults to
wss://stt.navana.ai.
Arguments
| Argument | Required | Description |
|---|---|---|
api_key |
No | Your platform API key, sent as the x-api-key header. Falls back to $BODHI_API_KEY. |
model |
No | Any transcription model. Defaults to hi-general-v2-8khz. See Models and languages. |
base_url |
No | Override the endpoint, usually to point at a different deployment. Defaults to wss://stt.navana.ai. |
sample_rate |
No | Rate audio is sent at, in Hz. The session’s audio is resampled to it automatically. Defaults to 16000. |
language |
No | Language tag for transcripts. Defaults to the model’s prefix. |
interim_results |
No | Emit INTERIM_TRANSCRIPT events from partials. Defaults to on. |
parse_number |
No | Normalise spoken numbers, dates, and currency in the returned text. |
aux |
No | Attach timing and confidence metadata to each result. Required for min_confidence. |
min_confidence |
No | Drop finals below this utterance confidence. Defaults to 0.5; pass 0 to keep everything. |
hotwords |
No | Phrase boosting, as bodhi.BodhiHotword(phrase, score). score is optional, and roughly 1.0 to 3.0 is useful. See Advanced features. |
endpoint_silence_duration |
No | Trailing silence before an utterance is finalised, in seconds. Clamped to 0.44 to 1.2. |
How it maps onto LiveKit
Partial transcripts arrive as INTERIM_TRANSCRIPT speech events and endpointed
finals as FINAL_TRANSCRIPT, which is the contract every LiveKit STT plugin
follows. VAD, turn detection, and interruption handling are driven by the
session, so swapping another provider for Bodhi does not touch the rest of the
agent.