Skip to main content

Setup, Offline and Sizing

Turn on Voice Agents, connect a voice server, choose the Whisper model, run fully offline, and size the service.

1. Turn It On​

In Admin › Settings › Voice Agents, turn on Voice Agents. Then:

  • set the groups for designers, publishers and conversation viewers;
  • check the default limits;
  • add approval policies if the defaults (business and compliance review for external agents, business review for internal ones) don't fit.

The same page shows whether a voice server is connected, the speech recognition model, and how many conversations are live.

You can also set ENABLE_VOICE_AGENTS=true. Users also need the Voice Agents feature permission, which is on by default (USER_PERMISSIONS_FEATURES_VOICE_AGENTS).

2. Add a Voice Server​

Voice agents speak through an OpenAI-compatible speech server that can return raw audio. Kokoro-FastAPI is a good choice: it runs the open Kokoro voices, in English and Hindi among other languages, on CPU or GPU. Run it next to Studio:

yaml
services:
  kokoro:
    image: ghcr.io/remsky/kokoro-fastapi-cpu:latest   # or kokoro-fastapi-gpu
    restart: unless-stopped

Then point Studio at it:

bash
VOICE_TTS_BASE_URL=http://kokoro:8880/v1

The speech server runs as a separate container. Kokoro's pronunciation library (espeak-ng) is GPL-licensed, and this way it never runs inside Studio.

Without VOICE_TTS_BASE_URL, Studio uses its own OpenAI-compatible text-to-speech connection (Admin › Settings › Audio) if there is one. Otherwise conversations show text only.

3. Choose the Speech Recognition Model​

Voice agents use Studio's local Whisper model. The default base is fine for English. For Hindi or mixed Hindi and English, use small or larger:

bash
VOICE_WHISPER_MODEL=small

4. Pick a Fast Model​

A caller is waiting, so the model's speed sets the pace. Aim for under 2 seconds from the end of the caller's speech to the agent's first audio. The Test call tab shows this for every reply.

On an 8-core machine with Whisper base and Kokoro on CPU, Studio's own part takes about 1.1 seconds: recognising the speech and speaking the first words. The model's time to its first sentence comes on top. Studio speaks the first short phrase of each answer at once and makes the rest while it plays.

  • Cloud models: the fast tiers of the major providers work well.
  • Local models: these need a GPU, or a small model (1 to 3 billion parameters). A 7B model on CPU is far too slow for live conversations.

Running Fully Offline​

Every part of a conversation can stay on your network:

PartOffline with
Speech recognitionStudio's local Whisper. Put the model in WHISPER_MODEL_DIR first. With OFFLINE_MODE=true Studio never tries to download it.
VoiceKokoro-FastAPI on your network; its image includes the voices.
Turn detectionBuilt in (the Silero model ships with Studio).
The modelA local model through Ollama or another OpenAI-compatible server.
The call page and widgetServed by Studio; nothing is loaded from the internet.

Sizing​

Speech sets how many conversations you can run at once, and above all the agent's voice. Studio's own work per conversation is small.

What one machine does​

These figures come from one 8-core machine running everything on CPU: Studio, Whisper base, Kokoro-FastAPI and a stand-in model that starts answering in 0.25 seconds. Every answer was worded differently, so nothing could be reused from the speech cache. Each caller listened to the whole answer, paused, and spoke again.

Conversations at onceReply time, median / p95Silence mid-answer, median
12.4 s / 2.6 snone
33.3 s / 5.1 s2.6 s
106.0 s / 12.6 s14 s

The reply time runs from the end of the caller's speech to the agent's first audio, including the 0.6 seconds of silence that end a turn.

What the figures mean:

  • The voice server is the limit.
    • On CPU, Kokoro makes speech about 2.4 times faster than it is spoken.
    • An agent talks for about half of a conversation.
    • So one CPU voice server keeps up with about 2 conversations without gaps.
  • Speech recognition is not the limit. Whisper base on CPU takes about 0.6 seconds per turn.
  • For more conversations, give the voice its own hardware. A GPU voice server (kokoro-fastapi-gpu) is many times faster than CPU. So are several voice servers on separate machines, listed in VOICE_TTS_BASE_URL.
  • On a single machine, splitting the voice server helps only a little. Two instances with 4 threads each (OMP_NUM_THREADS=4) make about 20% more speech than one using all 8 cores.

On CPU, about 1.2 seconds of a single conversation's reply time goes to making the first sentence. Short phrases that recur, like "Sure." or "One moment.", are cached. An answer that opens with one starts in about 1.3 to 1.9 seconds, so a real agent usually does better than the table.

How a replica protects its calls​

  • The live-call cap. Set VOICE_MAX_LIVE_CALLS to what your hardware handles. Measure it with a load test before going live. This cap is what protects a replica from a burst of callers: the checks below only react once slowness shows.

  • Polite refusals. New callers hear "all our lines are busy" in any of these cases:

    • the replica is at its cap;
    • speech recognition is backed up (VOICE_STT_QUEUE_LIMIT);
    • the voice servers are backed up (VOICE_TTS_QUEUE_LIMIT);
    • replies over the last minute have started late (VOICE_ADMIT_MAX_FIRST_AUDIO_MS).
  • The health check. GET /api/v1/voice/health answers 503 while a replica is full, so a load balancer can send calls elsewhere. It returns only numbers: live calls, what is waiting, and reply times.

  • The order of speech work. Each voice server gets one sentence at a time by default (VOICE_TTS_CONCURRENCY): on CPU, parallel requests only finish later. The first sentence of every answer goes first. Later sentences go in order of when the caller will need them. When the caller talks over the agent, the rest of the answer is not made.

  • Studio's assistants share the voice server, after callers. Voice mode and Listen in the Admin Assistant and the API Builder assistant, spoken artifact questions and calls in the chat use the same voice servers, but every caller's sentence goes first:

    • their waiting sentences don't count toward the limits that turn new calls away;
    • their text is made in short parts (about 120 characters), so a caller waits behind at most one;
    • while any call is live, on any Studio server, they don't use the voice server at all: the browser speaks for them. Set ASSISTANT_VOICE_PAUSE_FOR_CALLS=false to let them share it during calls too;
    • their transcriptions use the same Whisper model in a queue of their own;
    • when the voice server is busy, the browser speaks for them (ASSISTANT_VOICE_TTS_QUEUE_LIMIT, default 4).

    The health panel shows the assistants' load on its own card: what they have waiting, their time per sentence, and how often they kept off the voice server for calls.

  • What admins see. Admin › Settings › Voice Agents shows live calls, what is waiting and the last minute's reply time. Each answer in Conversations shows its own reply time.

Deployment​

  • Keep speech work off the chat replicas. Run extra Studio replicas for voice only, and send /api/v1/voice/ to them at your proxy or ingress. Their /v/ pages and websockets can then scale with conversations.
  • Allow long-lived connections. Conversations use websockets, so raise your proxy's timeout (for example HAProxy timeout tunnel 1h).
  • Dropped connections resume. The conversation is kept in the database, so a dropped connection can resume on any replica within VOICE_RESUME_WINDOW_SECONDS (default 60). A conversation whose replica died is ended by the maintenance job, and its after-call work still runs, exactly once.

All settings are listed in Audio environment variables › Voice Agents.

Hrida.ai is proprietary software of Zlabs Innovation. See the license for terms. © 2026 Zlabs Innovation.