Overview
pipecat-gnani is a Pipecat service integration that wraps the Gnani STT and TTS APIs into Pipecat’s standard SegmentedSTTService, STTService, TTSService, and InterruptibleTTSService base classes. Drop the services into any Pipecat pipeline and get high-accuracy Indian-language transcription and low-latency synthesis without managing WebSocket connections yourself.
pipecat-ai>=1.5.0,<2.0); tested on 1.5.0 and 1.15.0.
Installation
gnani-vachana (>= 0.9.0) as a dependency. The Python import package name remains gnani.
Requirements: Python 3.11+ and Pipecat 1.5 or newer (1.x)
Prerequisites
You need a Gnani API key. Gnani APIsServices
This plugin provides five service classes. Choose based on your use case:Quick Start
Pipeline snippet
The snippet below shows the corePipeline([...]) wiring used in the foundational example. See examples/foundational/agent.py for the full runnable version.
agent.py for REST or SSE variants — WebSocket STT + TTS is the default for lowest latency and interruption support.
Speech-to-Text (REST)
Speech-to-Text (Streaming WebSocket)
Text-to-Speech (REST)
Text-to-Speech (SSE Streaming)
Text-to-Speech (WebSocket Streaming)
Models
timbre-v2.0 is retired and is rejected. Invalid settings raise ValueError when the service is created or updated, before any request is sent.STT — GnaniHttpSTTService (REST)
File-based transcription via REST. Extends Pipecat’s SegmentedSTTService.
- Calls
POST /stt/v3 - Requires VAD in the pipeline to segment audio
- Audio is limited to 30 s per request
- Requires an active
aiohttp.ClientSessionpassed at construction time
Settings
Each
TranscriptionFrame.language carries the language the API detected, falling back to the configured language.
STT — GnaniSTTService (WebSocket)
Real-time streaming speech-to-text via WebSocket with VAD events. Extends Pipecat’s STTService.
- Connects to
wss://api.vachana.ai/stt/v3/stream - Sends raw PCM audio in 1,024-byte frames
- Emits
TranscriptionFrame(final) andInterimTranscriptionFramewhen the API setsis_final: false(today Gnani sends final transcripts only) - Supports 8 kHz, 16 kHz, 44.1 kHz and 48 kHz sample rates
Streaming PCM Specification
All streaming audio must be sent as raw PCM binary frames — no container format (WAV, MP3) mid-stream.
Frames must be sent at real-time cadence. See STT Realtime — PCM Specification for full details.
Settings
Automatic language detection
TTS — GnaniHttpTTSService (REST)
REST-based text-to-speech for non-streaming use cases. Returns the complete audio in a single response.
- Calls
POST /api/v1/tts/inference - Requires an active
aiohttp.ClientSessionpassed at construction time - Suitable for batch synthesis or pipelines where streaming is not needed
Settings
TTS — GnaniSSETTSService (SSE)
Streaming text-to-speech via Server-Sent Events. Lower latency than REST.
- Calls
POST /api/v1/tts/sse - Requires an active
aiohttp.ClientSessionpassed at construction time - Streams audio chunks as synthesis progresses
Settings
TTS — GnaniTTSService (WebSocket, recommended)
Streaming text-to-speech via WebSocket. Extends Pipecat’s InterruptibleTTSService, giving your agent built-in interruption (barge-in) support — when the user speaks over the agent, synthesis stops cleanly.
- Connects to
wss://api.vachana.ai/api/v1/tts - Streams audio chunks in real-time as synthesis progresses
- Ideal for live conversational agents where latency and barge-in handling matter
TTSTextFrames are emitted by the Pipecat base class after each synthesis request
Settings
Available Voices
The full catalog is in the voice list. Every voice belongs to one model:timbre-v2.5: 42 voices, for examplePranav(default),Kaveri,Nalini,Asmita,Deepak.timbre-v3.0: 13 voices:Avinash,Chetana,Devansh,Harshad,Kalpana,Lakshmi,Prakash,Riyaa,Shivani,Shubham,Tarika,Vasudha,Yashraj.
pipecat_gnani.TIMBRE_V25_VOICES and pipecat_gnani.TIMBRE_V30_VOICES.
Audio format
TTS output is always 16-bit PCM, which is what Pipecat plays. Onlylinear_pcm with a wav or raw container is accepted; mp3, ogg, mulaw and alaw raise ValueError. Telephony transports convert to mulaw or alaw themselves.
The
sample_width and bitrate TTS settings are deprecated and ignored, and will be removed in a future release.Supported Languages
STT Languages (Speech-to-Text)
STT uses BCP-47 locale codes with the-IN suffix: bn-IN, en-IN, gu-IN, hi-IN, kn-IN, ml-IN, mr-IN, pa-IN, ta-IN, te-IN. "indic-auto" (prisma-v3.0) detects the language automatically. For the full list, see STT — Supported Languages.
TTS Languages (Text-to-Speech)
TTS uses the same BCP-47-IN codes as STT, plus auto. Pipecat Language values are converted for you; a language Gnani TTS does not support (for example or-IN) raises ValueError. See TTS REST — Request Parameters and the Voice Catalog.
Use the
Language enum from pipecat.transcriptions.language for language settings on both STT and TTS services. For TTS, the voice and the optional language setting together decide how text is spoken.Further Reading
- STT REST API — file-based transcription reference
- STT Realtime API — WebSocket protocol reference
- TTS REST API — synchronous synthesis reference
- TTS Streaming (SSE) — SSE synthesis reference
- TTS Realtime API — WebSocket TTS reference
gnani-vachanaon PyPI — core SDKpipecat-gnanion PyPI — this plugin- Pipecat Docs — Pipecat framework reference