Overview
This plugin allows you to use Gradium as an STT provider for your voice agents. Gradium streams transcription over a WebSocket connection and returns both interim and final transcripts.
Installation
Install the plugin from PyPI:
uv add "livekit-agents[gradium]~=1.5"
Authentication
The Gradium plugin requires a Gradium API key .
Set GRADIUM_API_KEY in your .env file:
GRADIUM_API_KEY=<your-gradium-api-key>
Usage
Use Gradium STT in an AgentSession or as a standalone transcription service. For example, you can use this STT in the Voice AI quickstart.
from livekit.agents import AgentSessionfrom livekit.plugins import gradiumsession = AgentSession(stt=gradium.STT(model_name="default",language="en",),# ... llm, tts, etc.)
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
api_keystringEnv: GRADIUM_API_KEYGradium API key. Required if the environment variable isn't set.
model_namestringDefault: defaultGradium STT model to use.
languagestringDefault: enLanguage code for the input audio. Override it per stream with stt.stream(language="..."), which applies to that stream only and leaves the instance default unchanged. It can't be changed with update_options(). The plugin sends the base language subtag, so en-US is sent as en.
sample_rateintegerDefault: 24000Input audio sample rate in Hz. 24000 is the only supported value; any other value raises a ValueError.
encodingstringDefault: pcm_s16leInput audio encoding. pcm_s16le is the only supported value.
temperaturefloatDefault: NoneTemperature used for decoding. Leave it unset for greedy sampling. The plugin passes the value through to Gradium without validating its range.
vad_thresholdfloatDefault: 0.9Inactivity probability, as reported by Gradium's voice activity detection, above which the selected bucket counts as silence for endpointing.
vad_bucketintegerDefault: 2Index of the bucket to read from Gradium's voice activity detection predictions. Set it to None to disable endpointing.
vad_flushbooleanDefault: trueFlush the recognizer state the first time voice activity detection triggers, so text that's still being processed is returned as soon as possible.
buffer_size_secondsfloatDefault: 0.08Audio buffer size in seconds. This is the only parameter that update_options() accepts, and changing it reconnects the WebSocket.
Additional resources
The following resources provide more information about using Gradium with LiveKit Agents.
Python package
The livekit-plugins-gradium package on PyPI.
Plugin reference
Reference for the Gradium STT plugin.
GitHub repo
View the source or contribute to the LiveKit Gradium STT plugin.
Gradium docs
Gradium API documentation.
Voice AI quickstart
Get started with LiveKit Agents and Gradium.
Gradium TTS
Guide to the Gradium TTS plugin with LiveKit Agents.