Skip to content

Google Gemini Live

Google’s Gemini Live API runs a low-latency, native-audio dialog agent. The bridge proxies Teler call audio into Gemini and relays the model’s spoken response back.

  • A Google Cloud project with Gemini API access and a GOOGLE_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
VariableRequiredDefaultDescription
GOOGLE_API_KEYyesnoneYour Google API key with Gemini access.
GEMINI_MODELnogemini-2.5-flash-preview-native-audio-dialogModel identifier.
GEMINI_SYSTEM_MESSAGEnononeSystem prompt that defines the agent’s persona and behavior.
GEMINI_AUDIO_CHUNK_COUNTno5How many chunks to buffer before forwarding to Gemini.
TELER_API_KEYyesnoneYour Teler API key.
NGROK_AUTHTOKENyes (local)nonengrok auth token.
SERVER_DOMAINautononePublic URL exposed to Teler. Detected from ngrok.
Terminal window
git clone https://github.com/frejun-tech/teler-gemini-bridge
cd teler-gemini-bridge
cp .env.example .env
docker compose up -d --build
Terminal window
curl -X POST http://localhost:8000/api/v1/calls/initiate-call \
-H "Content-Type: application/json" \
-d '{
"from_number": "+91XXXXXXXXXX",
"to_number": "+91XXXXXXXXXX"
}'

Gemini Live emits 24 kHz PCM. The bridge resamples to 8 kHz for Teler using scipy. If you need higher fidelity, configure your Stream flow with sample_rate: "16k" and adjust the bridge’s downsampling code.

GEMINI_AUDIO_CHUNK_COUNT controls input buffering. Lower = lower latency but more network overhead and higher token consumption. Higher = smoother turns but laggier feel. The default of 5 is a reasonable starting point.

SymptomLikely causeFix
Agent silentModel name typo or unreleasedCheck GEMINI_MODEL against current Google docs
API quota errorsFree-tier limits hitCheck usage in Google Cloud Console
Long latency to first tokenCold startSend a warm-up message before connecting calls
Wrong language / personaEmpty GEMINI_SYSTEM_MESSAGESet the system prompt explicitly