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.6"

Authentication

The Gnani plugin requires a Gnani API key .

Set GNANI_API_KEY in your .env file:

GNANI_API_KEY=<your-gnani-api-key>

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.

languagestringDefault: en-IN

Language code for the input audio. You can override it per call with recognize(language=...) or stream(language=...). 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.
  • Batch (REST): All streaming languages, plus en-IN,hi-IN for English-Hindi bilingual transcription.

For the authoritative list, see Supported languages  in the Gnani docs.

sample_rateintegerDefault: 16000

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

use_streamingbooleanDefault: true

Use WebSocket streaming when true (the default), or REST recognition when false.

formatstringDefault: verbatim

Output transcript format, applied to both batch and streaming modes:

  • verbatim: the raw transcript, with spoken words written out as they're said (for example, "twenty five dollars on may third").
  • transcribe: enables inverse text normalization (ITN), which converts spoken-form numbers, dates, times, and currency into their conventional written form (for example, "$25 on May 3").

Set itn_native_numerals to render digits in the language's native script when format is transcribe.

preferred_languagestringDefault: None

Bias results toward a single language in multilingual scenarios by passing a language code (for example, hi-IN). Applies to batch recognition.

itn_native_numeralsbooleanDefault: false

Render digits in the native script of the detected language instead of Arabic numerals. Applies when format is transcribe.

Additional resources

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