Hugging Face and Cerebras make Gemma 4's voice conversations flow like talking to a real person
- Today's voice AI isn't dumb, it's slow. There's a multi-second pause after every sentence, and it doesn't feel like talking to a person.
- Hugging Face and Cerebras swapped out the slowest stage for ultra-fast inference hardware — 1,851 tokens per second, 35x a typical GPU.
- But Doubao, GPT-Live, and Gemini Live are now end-to-end, full-duplex models — they can listen and speak at once and pick up on tone. This pipeline is a four-stage relay running half-duplex, so it can't match their conversational rhythm.
- Its value lies elsewhere: every one of the four stages is open source and swappable, the whole thing can run offline on your own machine, and you get access to the text layer in between.
- To close the rhythm gap, it starts guessing your answer before you finish speaking — and throws the whole thing out and starts over if it guessed wrong. By default, the speech recognition only understands 25 European languages; Chinese needs a separate setup.
Voice AI's bottleneck today is speed
Model quality is already good enough — the answers are correct. What actually breaks the experience is latency: you finish a sentence, and it takes a few seconds of silence before anything comes back.
What makes it worse is the inconsistency. Nine times out of ten the response lands just over a second; the tenth time it drags out to three seconds. You think it didn't hear you, say it again, and now you're both talking at once. Engineers measure this with a specific metric: out of a hundred responses, how slow are the slowest few? That's called P95 latency. The average looks fine and tells you nothing — the sluggish feeling comes entirely from those outliers.
It's like a phone call with someone who's always half a beat slow to respond. They're not dumb, and their answers are fine, but those few seconds of silence between sentences make it impossible to have a normal conversation.
They swapped out the slowest stage
First, who is Cerebras — without that context, the "35x" figure doesn't mean much.
It's a chip company that took a different path from Nvidia. Instead of slicing a wafer into hundreds of chips and wiring them back together, it builds the entire wafer as one giant chip. The payoff: data doesn't have to shuttle between separate chips, since the model weights sit directly in on-chip memory, which is far faster to read from. That design isn't especially useful for training models, but it's very good at inference — running an already-trained model to generate output fast. Selling that speed has been Cerebras's core business for years.
Voice AI runs through four stages between hearing you and answering. The middle one — coming up with the answer — is by far the slowest. No matter how fast the other three run, that one drags the whole chain down.
Hugging Face and Cerebras handed that stage to Cerebras's inference hardware, running Google DeepMind's openly released Gemma 4 31B.
Each of the four stages runs on its own thread. Except for the middle stage, which by default goes over the network, the other three run entirely on-device
A 35x speedup means those particularly slow outliers disappear too. That's directly where the P95 improvement comes from: once the answer-generation stage's time gets compressed way down, the whole chain's variance naturally shrinks with it.
They also turned off the model's "thinking," passing --responses_api_reasoning_effort none at connection time. The same model is smarter with thinking on when writing code, but in conversation, thinking on means it can't keep up with speech pace.
Gemma 4 31B has appeared on this site twice before. This time it shows up in a different role: the brain that can be pulled out and swapped in this open pipeline whenever needed.
You can't take those models with you. This one, you can
To see what this pipeline is actually worth, you first need to separate it from Doubao and GPT-Live — they're not competing on the same axis. Those companies compete on who talks more like a human. This one competes on who owns what.
Start with the incumbents. Real-time full-duplex voice isn't new. Doubao's voice models have supported real-time duplex conversation since versions 2.0 and 3.0, and this April it rolled out native full-duplex Seeduplex to its full user base. OpenAI shipped GPT-Live in July, listening and responding as you speak. Gemini's Live API is more direct still — audio in, audio out, with no separate recognition, generation, or synthesis stages in between.
This class of model has conversational rhythm built in. It can listen and respond simultaneously, and tell the difference between you pausing to think and you actually being done. Gemini has a setting called Proactive Audio, where the model decides for itself whether to speak up, letting it sit as a silent listener indefinitely. When ByteDance announced Seeduplex, it claimed the false-interruption rate was cut in half and the rate of the model talking over the user dropped 40%.
What Hugging Face built here takes the old route: four stages in a relay, each handling recognition, answer generation, or synthesis on its own. It's half-duplex — it can only listen or only speak at any given moment. Interrupt it and it goes quiet, but it can't murmur an "mm-hm" while you're mid-sentence.
Your voice gets converted to plain text at stage two. Your tone, hesitation, laughter, urgency — all of it is gone by that point, so the brain downstream only ever sees a line of text (Gemma 4 31B itself doesn't take audio input either). End-to-end models listen to the raw audio directly — they know whether you're laughing or panicking.
So on "talks like a human," this pipeline loses to Doubao and GPT-Live, and that gap is architectural — it can't be closed.
But there's another side to this ledger. However well those three converse, you're only ever renting: the model lives on their servers, you're calling an API, it's gone the moment you're offline, and if they change pricing or terms or pull a feature, you have no say. This one flips that. The thing is yours.
Where it actually wins
"The thing is yours" comes down to one document: a license. Every stage in this chain, including the brain itself, Gemma 4 31B, is Apache 2.0. That license means you can use it commercially, modify it, and redistribute it, all without asking anyone's permission first.
What that buys you, concretely, comes down to four things.
The whole chain runs on your own machine
All four stages are Apache 2.0 open source, and three of them run on-device by default. Even the middle stage can be pulled local — host a smaller Gemma 4 with llama.cpp and it still holds a conversation offline. Over 9,000 Reachy Mini robots already run this exact pipeline.
Every stage is swappable
Swap in Whisper for recognition, any OpenAI-compatible service for the brain, Kokoro for synthesis — it's all a parameter change. You can also drop in your own fine-tuned model.
You get the text layer in between
End-to-end models have no text layer internally — you can't see what they understood you to say. This pipeline lands text at every step, so if you want moderation, logging for search, or a chance to edit a response before it's spoken, there's a place to hook in.
Existing clients work unmodified
It speaks OpenAI's real-time voice protocol externally. Any app already built against that protocol just needs its endpoint pointed at your own server.
| Doubao / GPT-Live / Gemini Live | This pipeline | |
|---|---|---|
| Architecture | End-to-end, audio in and out directly | Four-stage relay |
| Listen and speak at once? | Yes, full-duplex | No, half-duplex; supports interruption |
| Picks up on tone? | Yes, processes raw audio directly | No, converted to plain text at stage two |
| Runs where | Their servers | Three of four stages on-device by default, the fourth can also run local |
| Model swappable? | Locked to theirs | Every stage swappable |
| Intermediate text | No such layer exists | Transcripts, reply text, tool calls — all accessible |
| License | Per terms of service | Apache 2.0 |
It's renting versus owning. Renting gets you a finished, move-in-ready place with the smoothest experience — but you can't knock down a wall, and if the landlord raises the rent or decides not to renew, there's nothing you can do. Owning means you handle the renovation yourself, and some corners won't match that polish right away. But the keys are yours — change whatever you want, and no one can evict you.
The next few sections cover how it closes that gap.
It closes the rhythm gap by jumping the gun
Half-duplex's one-question-one-answer rhythm can't naturally match listen-while-speaking. This pipeline's answer is to start early: it begins thinking before you finish talking, betting you won't drastically change course. The next three mechanisms are all one connected system.
It doesn't wait for you to finish before it starts thinking
Once the hardware compressed the answer-generation stage, the biggest remaining chunk of latency moved somewhere unglamorous: confirming you're actually done talking takes time too.
The machine judges that you've finished by counting silence. You pause, it starts counting, and only once the count clears a threshold does it act. During that wait, nothing useful happens — it's purely confirmation. But the threshold can't be too short either, or it'll jump in the moment you pause to catch a breath.
Overlap "confirming" with "working." Just 64 milliseconds of silence is enough for it to assume you're done, and recognition and generation start immediately. But the computed answer gets held back for a full second before it's spoken. That second is your chance to change your mind: keep talking, and this version gets scrapped; stay quiet, and by the time the second is up the answer's already computed, ready to speak the instant it's needed.
Toggle the two tabs below to see where the time actually goes.
Time →
Waiting and working happen back to back — the two durations stack up.
Time →
Waiting and working overlap, which is why it can respond earlier. Illustrative diagram showing sequence, not measured timing.
It didn't cut the confirmation time — it hid the working time inside the wait.
This is also why the fast hardware matters so much: the answer has to be fully computed within that one second, or you're back to waiting anyway. Thinking mode alone would blow past that budget, hence turning it off.
It's like a waiter who heads for the kitchen the second you close the menu, but pauses one beat at the pass. Add something in that beat and he turns back to update the order; if nothing happens, the ticket goes in. Your dish arrives sooner than everyone else's — not because he moves faster, but because he'd already written the order down during those few steps.
Add one more sentence, and it redoes the whole thing
Jumping the gun is only safe if a wrong guess doesn't stick. Its fix: throw the whole segment out and restart.
If you speak up again during that one-second window, that version is scrapped. It doesn't try to tack your next words onto its guess — instead it keeps the earlier audio, stitches it together with what you just added into one complete sentence, and re-runs transcription and generation from scratch. So answer quality never suffers; the model always sees one full sentence.
The cost is a full re-run every time you change your mind. Pause and restart four separate times, and the backend redoes the work four times over. That's exactly why cheap, fast hardware matters so much here.
There's also a detail specifically built to accommodate continuations: normally, starting a brand-new utterance needs 384 milliseconds of detected speech to register, to avoid a cough triggering it — but continuing an existing sentence only needs 192 milliseconds, half the threshold. It would rather treat your pause as still-talking than cut you off.
Once it starts speaking, that turn is locked
Whether you can still change your mind comes down to one action, not a fixed duration: the moment the synthesis module starts producing sound, that turn locks immediately, and anything you say after counts as a new turn. Before that lock, it can keep reopening the window for up to 7 seconds — plenty of room to think, catch a breath, or trail off and add something.
Interrupt it mid-sentence, and it stops instantly
The previous section covered changing your mind before it starts talking. This one covers cutting it off while it's already speaking.
The hard part is that the instant you interrupt, all four threads are mid-flight: the model's still generating text, synthesis is still chunking audio, and the send loop is still streaming it to your ear. Chasing down and killing each one individually is slow and easy to miss.
Stamp every piece of output with a batch number. Cancellation doesn't hunt anything down — it just increments a counter, and every older batch becomes invalid automatically. Before generating its next token, each thread checks whether its own batch number is still current; if not, it just stops. No thread has to coordinate with any other — they only care about the number.
It's like changing the locks. You don't have to physically collect every key you've handed out — once the lock is swapped, the old keys just stop working on their own.
Interruption can also be turned off. With it off, your speech still gets transcribed, but the system won't stop — it finishes whatever it's currently saying. That's useful for a fixed phone-support announcement or a robot reciting a safety notice.
Once it's set up, here's what it can do
Streams text as you speak
Transcription streams out in chunks while you're still mid-sentence.
Interruptible anytime
Interrupt it mid-response and it stops instantly to listen to you.
Can see
Gemma 4 31B can read images. The camera is wired in as a tool — when it needs to look, the client sends back the current frame.
Calls tools
Function calling is supported. That's how the robot's dancing, head-turning, and stopping are wired up.
Switches language automatically
Language is detected per sentence and routed to the model accordingly, so switching languages mid-conversation needs no settings change.
Voice is swappable
Comes with multiple built-in voices, and with an optional backend it can clone a voice from a reference clip.
Three commands to get it running
Start the service first, then connect and talk to it from another terminal.
pip install speech-to-speech export OPENAI_API_KEY=... speech-to-speech
The OpenAI key is required here because, with no parameters set, the middle stage defaults to OpenAI's gpt-5.4-mini. To swap in this article's subject, just point the model name and endpoint at it instead.
speech-to-speech \
--mode realtime \
--stt parakeet-tdt \
--llm_backend chat-completions \
--tts qwen3 \
--model_name "google/gemma-4-31B-it:cerebras" \
--responses_api_base_url "https://router.huggingface.co/v1" \
--responses_api_api_key "$HF_TOKEN" \
--responses_api_reasoning_effort none \
--responses_api_stream
python scripts/listen_and_play_realtime.py --host 127.0.0.1 --port 8765
If you'd rather not send anything out over the network, keep the middle stage on-device too: in one terminal, host a smaller Gemma 4 with llama.cpp, and in another, point the pipeline at it.
# Terminal 1: llama.cpp hosting Gemma 4
llama-server -hf ggml-org/gemma-4-E4B-it-GGUF -np 2 -c 65536 -fa on --swa-full
# Terminal 2: point the voice pipeline at this local service
speech-to-speech \
--mode realtime \
--stt parakeet-tdt \
--llm_backend responses-api \
--tts qwen3 \
--model_name "ggml-org/gemma-4-E4B-it-GGUF" \
--responses_api_base_url "http://127.0.0.1:8080/v1" \
--responses_api_api_key "" \
--responses_api_stream \
--enable_live_transcription
A few boundaries worth knowing up front
The repo lists its own set of limitations — worth a read before installing.
The most immediate one: the default recognition setup only understands 25 European languages, and Chinese isn't among them — you'll need to swap in Whisper or Paraformer. The command below only runs on Apple Silicon Macs, and it also happens to swap the middle stage for a local, on-device model. On other systems, install speech-to-speech[faster-whisper] or [paraformer] and configure the matching parameters.
speech-to-speech \
--stt whisper-mlx \
--stt_model_name large-v3 \
--language zh \
--llm_backend mlx-lm \
--model_name mlx-community/Qwen3-4B-Instruct-2507-bf16
Serves only one person at a time by default
The pipeline pool defaults to a single instance, so a second concurrent session gets rejected outright. Serving a team means raising that number, and each pipeline instance consumes its own share of model memory.
TCP mode is bare-bones
It only transmits raw audio — no interruption, no live transcription, no tool calls. Neither of the two mechanisms described above works in this mode.
The other transport channel needs a separate install
WebRTC requires a separate add-on package, or the handshake fails outright. By default it only works on the same machine or local network; crossing the public internet needs your own relay server, and some networks still won't connect.
The two channels aren't feature-matched
Noise suppression only applies to the WebSocket channel. On WebRTC, camera snapshots get compressed down to roughly 60 KB before they can be sent, so the model sees a smaller image.
Two more things that'll trip you up during install: the optional audio-enhancement module needs numpy 1.x, while Pocket TTS needs numpy 2.x, and the two can't coexist. On Linux, the default speech-synthesis package expects CUDA 12.8 — mismatch that and it'll fail, so install the matching version first; the repo provides CUDA 13, 12.4, and CPU-only builds.
Want to try it without installing anything first? The online demo works right away, no setup needed. The free quota resets daily at UTC: 5 minutes if you're not logged in, 10 minutes for a logged-in free user, unlimited for PRO subscribers and members of a few designated organizations. Running it locally on your own machine isn't metered at all.
Voice assistant lag: from "starts thinking only after you finish" to "already has the answer while you're still talking"
Hugging Face and Cerebras teamed up to overhaul an open-source voice pipeline, swapping out the slowest of its four stages — laid out here in one page with diagrams.
↓ One page, fully covered · includes one animated diagram
This is an open-source voice assistant pipeline: talk into a mic, it talks back — doing the same job as Doubao or GPT-Live. The difference is that all four of its stages are public, and the whole thing can be moved onto your own computer.
✘ Can't tell if you're laughing or panicking, and can't listen and respond at the same time
Of the four stages, the slowest is the middle one — generating the answer. No matter how fast the other three run, that one drags everything down. This update hands that stage to Cerebras's inference hardware: instead of slicing a wafer into small chips, that company builds the whole wafer as one giant chip, with model weights sitting directly on-chip — output comes out far faster. At the same time, the model's "thinking" gets turned off: it makes the model smarter for coding, but in conversation it can't keep pace.
# Middle stage defaults to OpenAI's
# gpt-5.4-mini, with thinking on
"google/gemma-4-31B-it:cerebras"
--responses_api_reasoning_effort none
Just two parameters changed. Every stage in this chain is swappable the same way: recognition can become Whisper, synthesis can become Kokoro, and the answer-generation stage can become a local llama.cpp instance. But once the hardware sped that stage up, the biggest remaining chunk of latency moved somewhere unglamorous — confirming you've finished talking takes time too.
The machine judges that you're done by counting silence. You pause, it starts counting, and only once the count clears a threshold does it act — nothing useful happens during that wait. Count too short, and it jumps in the moment you pause for breath. This pipeline's fix is to overlap "confirming" with "working": 64 milliseconds of silence is enough for it to assume you're done, recognition and answer-generation start immediately, and the computed answer is held for a full second before it's spoken — your window to change your mind.
It didn't cut the confirmation time — it hid the working time inside the wait. Illustrative diagram showing sequence only, not measured timing
"35x faster" doesn't mean much on its own. Converted into something concrete: how long each approach takes to think up a 60-word answer.
Converted from tokens-per-second output: 53 tokens/sec takes 1.13 seconds, 1,851 tokens/sec takes just 0.03 seconds — 1.13 ÷ 0.03 ≈ 35x. The 1,851 figure was measured by benchmarking firm Artificial Analysis and cited by Cerebras on its own blog; the 53-tokens/sec figure is back-calculated from the "35x" claim and is illustrative — no third party independently reproduced it. This only covers the answer-generation stage; recognition and synthesis on either end aren't included.
Getting it running is one line, pip install speech-to-speech; the web demo works the moment you open it and grant mic access — 5 minutes free per day without logging in, 10 minutes logged in. Two boundaries worth knowing upfront: the default recognition setup only understands 25 European languages, so Chinese needs Whisper or Paraformer instead; and it only serves one person at a time by default, so serving a team means manually raising the pipeline count, with each instance consuming its own share of model memory.
freeze?
② Speech to text
③ Generate answer ← slowest
④ Text to speech
need a jacket?
redoing the whole sentence.
- × Can't tell if you're laughing or panicking
- × Can't listen and respond at the same time
- × Default recognition only understands 25 European languages, Chinese needs a separate setup
Members can copy or download the full Markdown, and let their AI subscribe and ask.
Found this useful? Leave your email — every new explainer, the moment it's out. Unsubscribe anytime.
