Skip to main content

Gnani STT plugin guide

How to use the Gnani STT plugin for LiveKit Agents.

Available inPython

Overview

This plugin allows you to use Gnani  Vachana as an STT provider for your voice agents. Gnani provides high-accuracy speech recognition for Indian languages, including multilingual and code-switching scenarios, with both batch recognition and realtime WebSocket streaming.

Installation

Install the plugin from PyPI:

uv add "livekit-agents[gnani]~=1.5"

Authentication

The Gnani plugin requires a Gnani Vachana API key .

Set the following in your .env file:

GNANI_API_KEY=<your-gnani-api-key>
# Optional
GNANI_ORGANIZATION_ID=<your-organization-id>
GNANI_USER_ID=<your-user-id>

Usage

Use Gnani 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 AgentSession
from livekit.plugins import gnani
session = AgentSession(
stt=gnani.STT(
language="en-IN",
sample_rate=16000,
),
# ... llm, tts, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

languageLanguageCodeDefault: en-IN

Language code for the input audio. Supported languages vary by mode:

  • Streaming (WebSocket): bn-IN, en-IN, gu-IN, hi-IN, kn-IN, ml-IN, mr-IN, pa-IN, ta-IN, te-IN, en-hi-IN-latn, en-hi-in-cm.
  • Batch (REST): bn-IN, en-IN, gu-IN, hi-IN, kn-IN, ml-IN, mr-IN, pa-IN, ta-IN, te-IN, en-IN,hi-IN.

Use en-hi-IN-latn or en-hi-in-cm for English-Hindi code-mixed audio.

sample_rateintegerDefault: 16000

Input audio sample rate in Hz. Supported values: 8000 and 16000.

Additional resources

The following resources provide more information about using Gnani with LiveKit Agents.