I asked my voice assistant how warm it is in the living room. The answer came 0.69 seconds after the transcript: “21.3 degrees.” Fast, short, exactly what you want from a voice assistant. It was also made up. The model hadn't called a single tool; the real value was 24.4.

A few minutes earlier, the same assistant on the same machine needed 63 seconds before it said anything at all.

Both numbers come from the same setup: a 15-watt mini PC running a 30B mixture-of-experts model in llama.cpp, a 20,000-token prompt with 74 tools, and Home Assistant on the other end. This article is about what lies between those two numbers: where the time in a local voice pipeline actually goes, what it takes to get a cold minute down to well under a second, and why, after all that, the model on this box still isn't the one I let answer my house.

I'm assuming you know Home Assistant's Assist pipeline, have run a model in llama.cpp and know what tool calling is. All numbers are from my logs or from measurements I ran for this article; where I didn't measure something, I say so.

The setup

The assistant is Mira, an open-source conversation agent for Home Assistant that I've been building this year. The relevant parts:

  • Satellites: Amazon Echo devices running TECHO5 instead of Alexa, talking to Home Assistant's Assist pipeline.
  • Home Assistant on a separate, frugal NUC. The lights must keep working when I break the AI box.
  • The AI box: Minisforum AI X1 Pro, Ryzen AI 9 HX 370, Radeon 890M iGPU, 64 GB of shared memory. 14–16 W at idle.
  • Speech to text: Whisper large-v3-turbo over Wyoming, behind a small proxy that also computes a voice embedding to tell who is speaking.
  • The model: Qwen3-30B-A3B-Instruct-2507, Q4_K_M, llama.cpp server with the Vulkan backend, --parallel 2, 30,208 tokens per slot, flash attention on.
  • Text to speech: Phonon, a 40M-parameter TTS model, on the CPU with q8 weights, over Wyoming.
  • The agent: Mira talks to Home Assistant through its MCP server and adds its own tools (memory, calendar, reminders, skills). On my house that is 74 tools and a prompt of about 20,000 tokens before the user has said anything.

The budget

Here is one voice turn, stage by stage, with the prompt cache warm:

StageTimeSource
Speech to text (Whisper), end of audio → textmedian 875 ms, p90 1.5 s197 real requests, utterances median 3 s
Voice embedding (who is speaking), in parallelmedian 70 mssame
Model reads the new part of the prompt~0.3 sllama.cpp log, 12–18 new tokens
Model writes18.4 tokens/s → 0.4–2 sllama.cpp log, 20k context
Tool call into Home Assistant (MCP)75–370 msMira's log
Each further model roundanother 0.6–4 sMira's log
Text to speech, first audio15–55 ms16 typical answers
Text to speech, whole answer0.12 × audio lengthsame

Not in the table: how long the Echo waits for silence before it decides you're done, and the audio round trip to the satellite. I haven't measured those separately; they're the same for every model and every setup in this article.

Two things stand out. Speech recognition and speech output are solved problems on this hardware: Whisper costs under a second, Phonon starts speaking after a few dozen milliseconds and computes a seven-second answer in 0.85 s. Everything interesting happens in the model, in two places: reading the prompt and writing the answer.

Prefill is the wall

The Radeon 890M has no memory of its own; it shares the system's DDR5. That's the reason a 30B model fits on a mini PC at all: the model file is 18.5 GB, the GPU may use up to about 48 GB. It's also the reason prefill hurts.

A mixture-of-experts model like Qwen3-30B-A3B only uses about 3 billion of its 30 billion parameters per token. That makes decoding cheap: generating one token touches a fraction of the weights, and memory bandwidth is enough for 25–30 tokens per second on a short context. Prefill is a different job. Reading a prompt is compute-bound, and attention cost grows with the depth of the context. Cold reads of Mira's prompt on this machine, from the llama.cpp log:

Cold promptTimeThroughput
9,309 tokens18.6 s~500 tokens/s
14,816 tokens41 s~360 tokens/s
19,844 tokens62 s~320 tokens/s

Decoding slows with depth too, just less dramatically: median 25 tokens/s in October (same model, served by LM Studio) with prompts around 8,000 tokens, 18.4 tokens/s now at 20,000.

A voice assistant can't wait a minute. So the only question that matters is how often the model has to read the prompt at all.

Building the prompt around the cache

llama.cpp keeps a slot's KV cache between requests and reuses the longest common prefix. If the beginning of the next request is byte-identical to what the slot already holds, only the rest is computed. Everything in Mira's prompt is ordered for that:

  • 1. System message: role, rules, the house structure (Home Assistant's Assist prompt: entities with name, area and type) and a condensed house profile.
  • 2. Tools , in the request's own field.
  • 3. A short example conversation showing tone and tool use.
  • 4. Channel style (voice: short, no Markdown).
  • 5. History of the session, append-only.
  • 6. The current turn: time, room, who is speaking and their personal profile, matching memories, the text.

The rules that keep this stable are boring and strict:

  • No states in the prefix. The structure says that sensor.living_room_temperature exists, never what it reads. A state in the prefix would break the cache on every change. States come from tools, at the moment they're needed.
  • Byte-identical for identical inputs: no timestamps, no IDs, no unsorted lists. The time goes into the turn, at the very end.
  • The same prefix for every channel and every person. The personal profile of whoever is speaking goes into the turn, not the system message; otherwise each person would get their own cache. What differs per satellite (its room, its timers) is cut out of Home Assistant's prompt and moved into the turn as well.
  • Skills load lazily. Mira has around thirty skills; their instructions together are about 24,000 tokens. The prompt holds one line per skill (under 2,000 tokens) and a tool to open one. Reading all of them cold would cost over a minute on this box.
  • A fingerprint of the prefix in every log line. Each turn logs a prefix_hash. If it changes when nothing in the house changed, something broke the cache by accident, and you see it the same day instead of wondering why things got slow.

What that buys, from 690 model calls in October:

Value
Context per callmedian 8,300 tokens
New tokens per callmedian 24, p90 1,200
Share served from cachemedian 99.5 %

And in this week's measurement with the full 20,000-token prompt: 12 to 18 new tokens per round, read in about 290 ms. That number doesn't go to zero: even a dozen tokens at a depth of 20,000 cost roughly 0.3 s, because each of them still attends to everything before it.

When the prefix has to change: two slots

The prefix does change: Home Assistant restarts and its tool list is rebuilt, a device is added, the nightly job rewrites the house profile. Then someone has to read 20,000 tokens again, and if that someone is a voice turn, it waits a minute.

That's not hypothetical. After a Home Assistant restart, a “Stop!” queued behind the re-read of a new prompt and ran into the integration's 30-second timeout.

The fix uses llama.cpp's id_slot: Mira chooses the slot instead of letting the server pick by longest common prefix. Two slots take turns. The warm slot serves every conversation turn. When the prefix changes, the new one is read into the spare slot in the background (a request with max_tokens: 1); once it's done, the slots swap. Until then, turns keep running on the previous prompt.

Three details made this harder than it sounds:

  • A background read stalls the answer next to it. llama.cpp processes a big prompt in batches of 2,048 tokens and interleaves one token of the other slot's answer between batches. A story that was streaming at 34.9 tokens/s dropped to 0.3 tokens/s while a 9,000-token prompt was read beside it, with silences of up to five seconds. So the background read only runs while the model is otherwise idle, and any incoming turn cancels it; it restarts when the model is free.
  • `--kv-unified` evicts the warm slot. With a unified KV cache, reading a prompt into slot 1 made slot 0 cold, although both should have fit. A turn on slot 0 went from 0.2 s to 38 s. Without --kv-unified, each slot gets its own memory (--ctx-size 60000 --parallel 2 → 30,208 tokens each), and the warm one stays warm. At roughly 96 KiB per token in f16, that's about 5.5 GiB of KV cache for both slots, which shared memory can afford.
  • The price is staleness, and it's a real one. For up to about 40 seconds after a change, Mira works with the old prompt: a device that was just added isn't known yet, a tool that was just removed returns an error. I decided that a slightly outdated tool list is better than a voice assistant that goes silent for a minute. That decision is written down in the spec and in the user guide, because it will surprise someone eventually.

LM Studio ignores id_slot, by the way. This only works against llama.cpp's server directly.

Every tool call is another round

With the cache warm, prefill is down to a third of a second. What's left is writing, and that's where agents get expensive.

A tool call isn't free text. It's a JSON object with a function name and arguments, and the model has to write every token of it. At 18.4 tokens/s, a 30-token call costs 1.6 s before Home Assistant has even received it. Then the result goes back, the model reads it (cheap, it's appended) and writes either the answer or the next call.

The same ten questions on the same prompt, sequentially, cache warm (asked in German, as I do at home):

QuestionTools calledQwen3-30B local
What time is it?–1.4 s
Tell me a short joke–2.3 s
Is the front door closed?13.3 s
How much power is the house using?13.7 s
Which bin is collected next?28.7 s
What's the weather tomorrow?1 (web search)10.1 s

The round itself costs little; the tokens do. Which is why tool results are condensed before they enter the history, and why the voice channel's style says “short” – an answer of 76 tokens alone took four seconds.

The part that isn't solved

So far this is a story about a local setup getting fast. Here's the same benchmark with two cloud models added, using exactly the same prompt and tools:

Qwen3-30B (local)Gemini FlashGemini Flash-Lite
Whole turn, median3.2 s4.1 s2.4 s
Per model round0.7–5.3 s (scales with output)1.5–3 s0.7–1.1 s
Called the tool when it needed oneno, not reliablyyesyes

Local wins against Gemini Flash on simple turns. It loses to Flash-Lite everywhere. But speed isn't the column that decided it.

In the ten questions, Qwen answered three of them without calling the tool it needed. The living-room temperature (“21.3 degrees”, actually 24.4) and the outside temperature (“8.2 degrees”, actually 11.6) were invented: by design there are no states anywhere in the prompt, so there was nothing to remember them from. One answer switched into Chinese mid-sentence. Earlier, in a test on the radio, “Play SWR3” got the reply “SWR3 is playing.” Nothing played; no tool had been called.

Mira has an eval suite for this: scripted scenarios against a test Home Assistant, three runs each, judged on what actually happened in Home Assistant and on what Mira said. The results:

ModelScenarios passed
Qwen3-30B-A3B (local)3 of 12
Gemini Flash12 of 12
Gemini Flash-Lite34 of 40 (a later, larger suite)

A model that says it turned off the stove when it didn't is worse than a slow one. So at my place, Mira currently talks to Gemini Flash-Lite. What stays in the house: the audio, the transcription, the voice prints, Home Assistant itself and Mira's memory. What leaves it: the prompt – house structure, the relevant memories, the text of the request – and the tool results the model needs to answer it. That's a trade-off, not a solution, and switching back is one line of config the day a local model passes the evals.

The interesting part is that everything in this article besides the model is already ready for that day. The cache layout, the warm slots, lazy skills and a fast TTS turn a cold minute into a turn of one to three seconds on 15 watts. The pipeline isn't the bottleneck any more. A small model's discipline with tools is.

If you're building something similar

  • Log the prefix hash. Most cache problems are accidental: a timestamp, a reordered list, a personal detail in the system message. You'll only find them if you can see when the prefix changes.
  • Keep states out of the prefix. It's tempting to give the model the whole house in the prompt. It breaks the cache on every sensor update.
  • Measure prefill at your real context depth. Benchmarks at 512 tokens tell you nothing about a 20,000-token agent prompt.
  • Budget output tokens, not just prompt tokens. With a warm cache, every token the model writes – including every token of a tool call – is where the time goes.
  • Run evals before you look at speed. A fast model that skips tools feels great in a demo and fails quietly at home.

Mira is open source: github.com/miraassist/mira. The less technical version of the hardware story – what the box costs in electricity, and why there's no graphics card in it – is on the project's blog.