Overview
This plugin allows you to use Gnani Vachana as a TTS provider for your voice agents. Gnani provides low-latency, natural-sounding speech synthesis for Indian languages, with batch and streaming synthesis over REST, Server-Sent Events (SSE), and WebSocket.
Installation
Install the plugin from PyPI:
uv add "livekit-agents[gnani]~=1.5"
Authentication
The Gnani plugin requires a Gnani Vachana API key .
Set GNANI_API_KEY in your .env file:
GNANI_API_KEY=<your-gnani-api-key>
Usage
Use Gnani TTS within an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.
from livekit.agents import AgentSessionfrom livekit.plugins import gnanisession = AgentSession(tts=gnani.TTS(voice="Karan",language="hi",model="vachana-voice-v3",sample_rate=16000,),# ... llm, stt, etc.)
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
voicestringDefault: KaranVoice to use for synthesis. Supported voices: Karan, Simran, Nara, Riya, Viraj, Raju.
modelstringDefault: vachana-voice-v3The Gnani TTS model to use.
languagestringDefault: hiLanguage code for the generated speech. Defaults to Hindi (hi).
sample_rateintegerDefault: 16000Output sample rate in Hz. Supported values: 8000, 16000, 22050, 44100.
encodingstringDefault: linear_pcmOutput audio encoding. Supported values: linear_pcm, oggopus.
containerstringDefault: wavOutput audio container. Supported values: raw, mp3, wav, mulaw, ogg.
num_channelsintegerDefault: 1Number of audio channels in the output.
synthesize_methodstringDefault: restTransport used for batch synthesis through synthesize(). One of rest (single-request HTTP), sse (chunked Server-Sent Events for lower latency), or websocket (lowest latency). Realtime streaming through stream() always uses WebSocket, regardless of this setting.
Additional resources
The following resources provide more information about using Gnani with LiveKit Agents.
Python package
The livekit-plugins-gnani package on PyPI.
Plugin reference
Reference for the Gnani TTS plugin.
GitHub repo
View the source or contribute to the LiveKit Gnani TTS plugin.
Gnani site
Gnani's official site and product documentation.
Voice AI quickstart
Get started with LiveKit Agents and Gnani.
Gnani STT
Guide to the Gnani STT plugin with LiveKit Agents.