Documentation Index
Fetch the complete documentation index at: https://docs.inya.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
livekit-plugins-gnani is a thin LiveKit Agents adapter that wraps the Vachana STT and TTS APIs into LiveKit’s standard stt.STT and tts.TTS base classes. Drop it into any LiveKit voice agent pipeline and get high-accuracy Indian-language speech recognition and low-latency synthesis without managing WebSocket connections yourself.
gnani-vachana ← Core SDK (REST, WebSocket, SSE clients)
↑
livekit-plugins-gnani ← This package (LiveKit Agents adapter)
↑
Your LiveKit voice agent
All connection logic, authentication, and audio format handling live in the core SDK. The plugin is purely an adapter layer.
Installation
pip install livekit-plugins-gnani
This also installs gnani-vachana (the core SDK) as a dependency.
Requirements: Python 3.10+
Prerequisites
You need a Gnani API key. Email speechstack@gnani.ai to get started — all new accounts receive free credits, no credit card required.
Set your credentials as environment variables:
export GNANI_API_KEY="your-api-key"
# For REST STT only (optional — streaming STT and TTS need only GNANI_API_KEY):
export GNANI_ORGANIZATION_ID="your-org-id"
export GNANI_USER_ID="your-user-id"
Quick Start
Speech-to-Text
from livekit.plugins.gnani import STT
stt = STT(language="hi-IN")
# Pass to your LiveKit voice agent pipeline
Text-to-Speech
from livekit.plugins.gnani import TTS
tts = TTS(voice="sia")
# Pass to your LiveKit voice agent pipeline
STT — Speech-to-Text
The plugin exposes two STT modes matching the underlying Vachana API:
| Mode | Method | Best for |
|---|
| Streaming (WebSocket) | Default | Live conversations, real-time agents |
| Batch (REST) | STT(mode="rest") | Pre-recorded audio, file-based pipelines |
Streaming (default)
Real-time transcription via WebSocket with Voice Activity Detection. This is the recommended mode for live voice agents.
from livekit.plugins.gnani import STT
stt = STT(
language="hi-IN", # BCP-47 language code
sample_rate=16000, # 8000 or 16000 Hz
)
Batch (REST)
File-based transcription in a single synchronous request. Audio clips up to 60 seconds.
from livekit.plugins.gnani import STT
stt = STT(
language="hi-IN",
mode="rest",
)
Code-switching (multilingual)
For audio that mixes Hindi and English, use the experimental Hinglish codes:
# Code-mixed: Latin + Devanagari output
stt = STT(language="en-hi-in-cm")
# Hinglish in Latin script only
stt = STT(language="en-hi-IN-latn")
TTS — Text-to-Speech
The plugin exposes Vachana TTS synthesis with 8 Indian voices.
from livekit.plugins.gnani import TTS
tts = TTS(
voice="sia", # Voice ID — see Available Voices below
sample_rate=16000, # Output sample rate: 8000–44100 Hz
encoding="linear_pcm", # linear_pcm or oggopus
)
Available Voices
| Voice | ID |
|---|
| Sia | sia |
| Raju | raju |
| Kanika | kanika |
| Nikita | nikita |
| Ravan | ravan |
| Simran | simran |
| Karan | karan |
| Neha | neha |
Supported Languages
| Language | Code |
|---|
| Bengali | bn-IN |
| English (India) | en-IN |
| Gujarati | gu-IN |
| Hindi | hi-IN |
| Kannada | kn-IN |
| Malayalam | ml-IN |
| Marathi | mr-IN |
| Punjabi | pa-IN |
| Tamil | ta-IN |
| Telugu | te-IN |
| Hinglish (experimental) | en-hi-in-cm |
| Hinglish Latin (experimental) | en-hi-IN-latn |
Further Reading