Hugging Face and Cerebras make Gemma 4's voice conversations flow like talking to a real person

It's not on the same track as Doubao or GPT-Live — those models you can only rent, while every stage of this pipeline is Apache 2.0, commercial-use-ready, modifiable, and self-hostable. The tradeoff: it can't match their conversational rhythm.
By Hugging Face Blog07-21 · 12 min read⚑ Company PR · read with that in mind
Deep Dive · XiaoHu Explains
60-second summary
  • 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.
⚑Jointly published content; the speed figures are from third-party benchmarks it cites. Mechanism details are drawn from the public repository's source code.
The problem

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.

Think of it this way

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.

The fix

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.

① Detect you speaking Silero VAD v5 On-device ② Speech to text Parakeet TDT On-device, 6 options ③ Generate answer Slowest, where the lag hits Gemma 4 31B Runs on Cerebras Swappable for any compatible service ④ Text to speech Qwen3-TTS On-device, 5 options You speak It responds

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

Cerebras
1,851
Typical GPU endpoint
≈ 53

Tokens per second output. 1,851 was measured by Artificial Analysis; the typical-GPU-endpoint figure is back-calculated from the "35x" claim and is illustrative only

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.

Official live demo — worth a listen for the response rhythm. Source: Hugging Face blog companion material

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.

Related on this site
Gemma 4 tech report: how an open model takes on the giants with "fewer parameters + reasoning + lower memory"
How this brain was actually built. Start here to see how a 31B model earns its keep in this pipeline.
Related on this site
LiveKit tuned Gemma 4 31B for real-time voice — 5x faster than GPT-4.1 at one-sixth the cost
Same model, same real-time voice goal, but LiveKit took its own inference-optimization path — worth reading alongside this four-stage relay pipeline.
Context

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.

The core distinction

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.

Switching a real-time voice client's endpoint from the official one to a self-hosted server
Same client code — just repoint the endpoint to your own server and the conversation carries on as normal. Source: huggingface/speech-to-speech repo documentation
Doubao / GPT-Live / Gemini LiveThis pipeline
ArchitectureEnd-to-end, audio in and out directlyFour-stage relay
Listen and speak at once?Yes, full-duplexNo, half-duplex; supports interruption
Picks up on tone?Yes, processes raw audio directlyNo, converted to plain text at stage two
Runs whereTheir serversThree of four stages on-device by default, the fourth can also run local
Model swappable?Locked to theirsEvery stage swappable
Intermediate textNo such layer existsTranscripts, reply text, tool calls — all accessible
LicensePer terms of serviceApache 2.0
Think of it this way

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.

Closing the rhythm 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.

Its solution

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.

You're talking
Counting silence to confirm you're done
Only now does recognition start
Only now does it start thinking
It speaks

Time →

Waiting and working happen back to back — the two durations stack up.

You're talking
64ms of silence and it's already moving
Holds for 1 second, your chance to change your mind
Recognition and generation finish inside that 1 second
It speaks

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.

Think of it this way

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.

Its solution

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.

Think of it this way

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.

①
Batch 7
It's mid-sentence, and the synthesis module is streaming batch 7's audio out chunk by chunk.
②
Batch 7
You interrupt, and the detection module reports someone is speaking.
③
Batch 8
Counter increments. From this point, everything from batch 7 is stale.
④
Batch 8
The queue is cleared, but your own input is kept: the transcript of what you just said and the end-of-speech marker are preserved — that's your input, and it can't be discarded along with the rest.
⑤
Batch 7
The model and synthesis modules each check their batch number, find they're still on batch 7, and stop right there.
⑥
Batch 8
Batch 8 proceeds unimpeded, answering whatever you just said.

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.

What it can do

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.

Run it yourself

Three commands to get it running

Start the service first, then connect and talk to it from another terminal.

Install and start a real-time voice service
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.

Switch to Gemma 4 31B on Cerebras, and turn off thinking to keep latency down
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
Connect and talk from another terminal (requires checking out the repo from source)
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.

Fully local: llama.cpp hosting Gemma 4, with the voice pipeline connected to 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
Before you dive in

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.

Get it understanding Chinese (Apple Silicon Macs only — this also swaps out the middle stage)
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.

🧰 Try it · HF Realtime Voice (speech-to-speech)
PriceFree online, quota resets daily at UTC: 5 minutes not logged in, 10 minutes for a logged-in free user, unlimited for PRO subscribers and designated organization members; running it locally is unmetered
Barrier to entryOpen the web demo, grant mic access, and start talking; local deployment is one pip install away, though connecting to a hosted model needs your own API key
Four commands taken straight from the repo — from a one-line install, to hooking up Cerebras, to running fully local, to switching it over to Chinese. Copy and run.
Source
Hugging Face and Cerebras bring Gemma 4 to real-time voice AIAmir Mahla, Andres Marafioti, Leandro von Werra, Saurabh Vyas·Hugging Face Blog·July 1, 2026
Editorial note
The jump-the-gun and discard mechanism, batch-number interruption, the various millisecond thresholds, the swap-list for all four stages, the tiered free quota, and every boundary item listed here are all drawn from the source code and documentation of the huggingface/speech-to-speech repo — none of this appears in the announcement blog post. Gemma 4 31B specs come from its model card. The 1,851 tokens/second and 35x figures come from Cerebras's official blog. The two timing-comparison diagrams are illustrative, showing sequence only, not measured timing; the "typical GPU endpoint ≈ 53" figure in the comparison bar is a back-calculated illustrative value from the 35x claim. "The answer has to be fully computed within that one second" is an inference drawn from the code's behavior of requiring a grace period to elapse before a result can be submitted.