Skip to main content

Overview

GnaniHttpSTTService and GnaniSTTService transcribe speech using Gnani Vachana, a production speech AI platform for 10+ Indian languages with real-time streaming and multilingual transcription. Use GnaniHttpSTTService for REST-based file transcription of VAD-segmented utterances, or GnaniSTTService for low-latency WebSocket streaming with built-in VAD events. The WebSocket service emits TranscriptionFrame (final) and InterimTranscriptionFrame when the API sets is_final: false.

Source Repository

Source code, examples, and issues for the Gnani integration

PyPI Package

The pipecat-gnani package on PyPI

Gnani Website

Learn about Gnani’s speech AI platform

Gnani API Docs

STT REST and WebSocket API reference

Demo Video

Gnani × Pipecat integration — STT/TTS pipeline and interruption handling

gnani-vachana SDK

Core Gnani Vachana Python SDK (>= 0.7.9) installed as a dependency

Installation

Install the community package directly:
This also installs the gnani-vachana (>= 0.7.9) core SDK. The Python import package name remains gnani.

Prerequisites

Gnani Account Setup

Before using the Gnani STT services, you need:
  1. Gnani API key: Get one from Gnani APIs.
  2. Set credentials: Export GNANI_API_KEY as an environment variable.

Required Environment Variables

  • GNANI_API_KEY: Your Gnani Vachana API key for authentication

Configuration

GnaniHttpSTTService (REST)

str
required
Gnani Vachana API key for authentication.
aiohttp.ClientSession
required
Shared aiohttp session for HTTP requests.
GnaniHttpSTTService.Settings
default:"None"
Runtime-updatable STT settings. See Settings below.
GnaniHttpSTTService extends SegmentedSTTService and requires VAD in the pipeline so that speech segments are buffered and sent as whole utterances.

GnaniSTTService (WebSocket)

str
required
Gnani Vachana API key for authentication.
int
default:"None"
Audio sample rate in Hz. One of 8000, 16000, 44100, or 48000. When omitted, the rate is negotiated from StartFrame.
float
default:"None"
Seconds of silence before sending keepalive audio. None disables keepalive.
float
default:"5.0"
Seconds between keepalive checks when keepalive is enabled.
GnaniSTTService.Settings
default:"None"
Runtime-updatable STT settings. See Settings below.

Settings

Runtime-configurable settings passed via the settings constructor argument. GnaniHttpSTTService.Settings GnaniSTTService.Settings
Supported STT languages include Assamese, Bengali, English (India), Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, and Telugu. Changing language, format, itn_native_numerals, or sample_rate mid-session on the WebSocket service reconnects to re-run the init handshake. See the source repository for the authoritative, up-to-date list.

Streaming PCM specification

WebSocket STT sends raw PCM binary frames — no WAV or MP3 container mid-stream. Each frame is 1,024 bytes (512 samples × 2 bytes, 16-bit little-endian mono). Send frames at real-time cadence for best VAD accuracy. GnaniSTTService also accepts 44,100 Hz and 48,000 Hz sample rates (x-sample-rate header). The server resamples internally — still send 1,024-byte frames at the appropriate cadence. See STT Realtime — PCM Specification.

Usage

Streaming (WebSocket)

REST (file-based)

Compatibility

Tested with the latest Pipecat main branch (v1.5.0+) using pipecat-gnani. Requires gnani-vachana >= 0.7.9. Check the source repository for the latest tested version and changelog.