Sarvam
Sarvam AI provides a modular speech and language platform with deep support for Indian languages and code-mixed speech. Unlike bundled voice-agent APIs, the Teler bridge orchestrates three independent Sarvam services: speech-to-text (STT), a conversational LLM, and text-to-speech (TTS), giving you full control over each stage.
Reference repos
Section titled “Reference repos” Node teler-sarvam-node-bridge
Prerequisites
Section titled “Prerequisites”- A Sarvam account with an API key
- A Teler account with an active API key
- One Teler phone number on your account
- An ngrok auth token (for local development)
- Docker and Docker Compose
Configuration
Section titled “Configuration”| Variable | Required | Default | Description |
|---|---|---|---|
SARVAM_API_KEY | yes | must be provided | Your Sarvam API key. |
TELER_API_KEY | yes | must be provided | Your Teler API key. |
NGROK_AUTHTOKEN | yes (local) | none | ngrok auth token. |
SERVER_DOMAIN | auto | none | Public URL exposed to Teler. Detected from ngrok. |
SARVAM_STT_MODEL | no | saaras:v3-realtime | Speech-to-text model identifier. |
SARVAM_LLM_MODEL | no | sarvam-105b-conversations | Primary conversational LLM. |
SARVAM_LLM_MODEL_FALLBACK | no | sarvam-105b | Secondary LLM if primary is unavailable. |
SARVAM_TTS_MODEL | no | bulbul:v3 | Text-to-speech engine. |
SARVAM_LANGUAGE_CODE | no | en-IN | Language code (e.g. en-IN for English-India, hi-IN for Hindi). |
SARVAM_SPEAKER | no | shubh | TTS voice identity. |
STATIC_RESPONSE_TEXT | no | Default greeting | Greeting played when the call connects. |
5-minute setup
Section titled “5-minute setup”git clone https://github.com/frejun-tech/teler-sarvam-node-bridgecd teler-sarvam-node-bridgecp .env.example .envdocker compose up -d --buildInitiate a call
Section titled “Initiate a call”curl -X POST https://your-domain/api/v1/calls/initiate-call \ -H "Content-Type: application/json" \ -d '{ "fromNumber": "+91XXXXXXXXXX", "toNumber": "+91XXXXXXXXXX" }'Architecture
Section titled “Architecture”The bridge opens independent WebSocket connections to each Sarvam service and orchestrates the pipeline:
- Caller audio in: raw audio frames from the Teler call are forwarded to
Sarvam’s realtime STT endpoint, transcribed according to
SARVAM_STT_MODEL. - Transcription → LLM: the transcribed text is sent to Sarvam’s chat-completions
API, which generates a response using the primary LLM (
SARVAM_LLM_MODEL). If that model is unavailable, the bridge falls back toSARVAM_LLM_MODEL_FALLBACK. - LLM response → TTS: the generated text is streamed to Sarvam’s realtime TTS
endpoint, synthesized to speech using the configured
SARVAM_TTS_MODELandSARVAM_SPEAKER. - Agent audio out: synthesized audio is forwarded back to the Teler call as binary frames.
- Barge-in: when the caller speaks over the agent, the bridge clears buffered audio to allow interruption.
- Greeting: a
STATIC_RESPONSE_TEXTgreeting is played when the call first connects.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Fix |
|---|---|---|
| 401 from Sarvam | Invalid SARVAM_API_KEY | Rotate the key; check casing in .env |
| Agent misunderstands caller | Wrong language code | Set SARVAM_LANGUAGE_CODE to match the caller’s language (e.g. hi-IN for Hindi, en-IN for English-India) |
| No greeting on call connect | Missing or empty STATIC_RESPONSE_TEXT | Set a non-empty greeting in .env |
| Responses slow after first message | Primary LLM overloaded | The bridge retries the fallback LLM automatically; check Sarvam status |
Next steps
Section titled “Next steps” Other recipes OpenAI Realtime, Gemini, ElevenLabs, Vapi, and more.
Bridge architecture The conceptual model behind every recipe.
Sarvam docs Detailed guides for STT, TTS, and LLM models.