Qwen4-35B-A3B on gufo: 3x to 5x Faster Prompt Reading Than llama.cpp on Strix Halo
We had Qwen4-35B-A3B running nicely under llama.cpp. Then we tried gufo, an engine written for this one chip, and it read prompts three to five times faster. Here is the comparison, the command, and what broke on the way.
IRelated service: AI strategy and governance →We spent the first week of December getting Qwen4-35B-A3B running well on one of our test machines, an AMD Strix Halo mini PC with 128GB of memory. That setup used llama.cpp and it works: the full guide is here.
Then we tried gufo, and reading a prompt got three to five times faster on the same box with the same model file. Long prompts, the thing that actually hurts when an agent is twenty turns into a conversation, went from painful to unremarkable. This is that comparison and the setup that produced it.
This picks up where the llama.cpp guide leaves off. For the model files and the Claude Code environment variables, use that article. Everything here is from the same single machine, so expect your own numbers to differ. If you are still choosing hardware, start with the local AI hardware guide.
Contents
- What gufo is
- Head to head with llama.cpp
- Before you start
- The container command
- Host setup notes
- Five things that cost us a test run
- Why we moved the context up to 512k
- What to keep in mind
- Checklist
What gufo is
gufo is an MIT-licensed inference engine written for one chip: AMD Strix Halo, gfx1151. Not a portable engine with a Strix Halo backend, which is what llama.cpp's Vulkan build is. One chip, and that narrowness is the whole point.
We run the official release container, pinned to version 0.40.0. Support for Qwen4-35B-A3B is built in, so there is no extension to install. It takes the same GGUF files, uses the same built-in MTP head for speculative decoding, and speaks the Anthropic Messages API natively, so Claude Code connects to it with nothing in between.
Head to head with llama.cpp
Same machine, same model file, same agent test, both with MTP on and thinking off.
| llama.cpp b12973, Vulkan | gufo 0.40.0 | Change | |
|---|---|---|---|
| Agent test, 9 tasks | 9/9 | 9/9 | same |
| Time per agent task | 5 to 19 s | 4 to 20 s | about the same |
| Generation, short prompt | 63 to 65 tok/s | 94 tok/s | 1.5x |
| Prefill, about 12k tokens | 835 tok/s | 2,743 tok/s | 3.3x |
| Prefill, about 25k tokens | 717 tok/s | 2,655 tok/s | 3.7x |
| Generation at about 25k | 54 tok/s | 78 tok/s | 1.45x |
| Long prompt | 223k tokens at 466 tok/s, 478 s | 187k tokens at 2,407 tok/s, 78 s | about 5x |
| Generation after that prompt | 28 tok/s at 223k | 80 tok/s at 187k | 2.9x |
| Image description | works | works, 2.6 s | |
| Startup | about a minute | about 11 s | |
| Host memory left, model loaded at 256k | about 31GB | about 31GB | same |
The two long-prompt runs are not the same length, 223k tokens against 187k, so read that pair as rough rather than exact.
Quality did not move. Our test has Claude Code use the model for three jobs, three times each, checked by running the code it writes. Both engines went 9 for 9, and the time per task was close enough to call a draw. If you only ever send short prompts, there is not much here for you.
The flat line is the point
The shape matters more than any single row. llama.cpp gets steadily slower as the prompt grows: 835 tok/s at 12k, then 717, 672, 567, and 466 by 223k. gufo holds between about 2,400 and 2,750 tok/s the whole way from 12k to 187k.
Agents re-read a growing conversation on every turn. A flat prefill line means turn forty costs about what turn four did, and that is worth more in daily use than a fast first number.
gufo's own published benchmark, in their docs on December 4, shows the same shape against a llama.cpp ROCm build: 3,306 against 1,282 tok/s with an empty context, and 3,010 against 752 at 32k deep. Our measurements and theirs were taken on different machines and different llama.cpp builds, so the ratios travel better than the absolute numbers.
Before you start
You need three things from the llama.cpp guide, so grab them there rather than here:
- The model files. Same Unsloth UD-Q4_K_XL quant, both shards. See Get the model files. One difference: gufo needs the BF16 vision file, not the F16 one. More on that below.
- The Claude Code environment variables. See Point Claude Code at it. Change the port, keep everything else.
- A working llama.cpp setup to fall back to. We kept ours, and its service unit, which makes going back one command.
You also need Podman or Docker, and a host that gufo recognises. gufo diagnose, run inside the container, tells you.
The container command
This is what we run. Change the paths and the port to your own.
podman run --rm --name qwen4-gufo --userns=keep-id:uid=1000,gid=1000 \
--device /dev/kfd --device /dev/dri --group-add keep-groups \
-p 127.0.0.1:8098:8098 -v /opt/llm:/models:ro \
ghcr.io/gufo-org/toolboxes/gufo-runtime:0.40.0 \
gufo serve --host 0.0.0.0 --port 8098 --sessions 1 llm \
--model /models/Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf \
--mmproj /models/mmproj-Qwen4-35B-A3B-BF16.gguf \
--served-model-name local --context 262144 \
--speculative mtp --think off --cache-ram-bytes 4294967296
Worth noticing:
--served-model-name localis not optional in practice. See gotcha 1.--speculative mtpturns on the model's own multi-token prediction head, the same trick as llama.cpp's--spec-type draft-mtp.--think offmakes thinking off the default, so scripts get quick, plain answers.-p 127.0.0.1:8098keeps the port on the loopback interface, because gufo has no authentication of its own. See gotcha 3.- Point
--modelat the first shard only. It finds the second one.
Host setup notes
gufo diagnose, run inside the container, checks the host for you. On our Debian 13 machine with a 7.x kernel it came back "supported".- gufo's install guide asks you to raise the GPU's GTT limit with kernel parameters and to allow unlimited memlock. That is their recommended setup, and it is the one to follow if you hit trouble. We ran with Linux defaults, about 94GB mappable to the GPU, and it worked anyway.
- Rootless Podman needs the crun runtime for
--group-add keep-groups.
Five things that cost us a test run
- Serve the model name your client asks for. gufo answers only to the id it is serving. Claude Code, set up as in the llama.cpp guide, asks for
local, so every request came back in under a second as a 404model_not_founduntil we added--served-model-name local. - The vision file has to be BF16. gufo rejects the F16 mmproj that llama.cpp is perfectly happy with, with "invalid BF16 Qwen vision tensor". Download
mmproj-BF16.gguffrom the same Unsloth repo. - There is no authentication. gufo ignores API keys, and its docs say plainly that anyone who can reach the port can use the model. We keep it on 127.0.0.1 and run a small proxy on the public port that checks a Bearer token or an
x-api-keyheader, leaving/healthopen. - The thinking switch moved. On the Anthropic
/v1/messagesendpoint, gufo rejects llama.cpp'schat_template_kwargswith HTTP 400 and uses the Anthropicthinkingfield instead,{"type": "enabled"}or"disabled". On/v1/chat/completions,chat_template_kwargs.enable_thinkingstill works. The relay that turns thinking on for interactive sessions had to change. - You can throw away the edited chat template. The HTTP 500 problem from the llama.cpp guide does not happen here. gufo uses the stock template and maps Claude Code's effort names itself. It also exports
/metricsunder llama.cpp's names, so our dashboards carried on working.
One problem does follow the model across: Qwen4 sometimes writes a corrected second JSON object after the first. That is the model, not the engine, so keep taking the last JSON object in the reply.
Why we moved the context up to 512k
Under llama.cpp we ran 256k and said so in the other article, because reading was what limited us, not memory. A 1M prompt would have taken about an hour to read before the model wrote a word.
With prefill holding around 2,400 tok/s at length, that calculation changes, so we moved the context to 512k the same evening. A full 512k prompt now reads in a few minutes rather than the best part of an hour, which puts it inside the range of things you would actually wait for. Memory was never the obstacle: this model's hybrid attention means only 10 of its 41 layers keep a KV cache, about 10GB of it at 512k.
Set it with --context 524288. The command above still shows 262144, which is what was running when we took the measurements in the table.
What to keep in mind
One machine, one evening, single runs. Treat the numbers as a direction, not a specification.
gufo is a young project that puts out a release every few days, so pin a version rather than following latest. It is also narrow by design: it serves this chip, so there is nothing to carry over if you later move to an NVIDIA box, where llama.cpp or vLLM would travel with you. See open models by task if you are still deciding what to run.
Agent task times barely moved, because the jobs in our test are short. The gains turn up on long prompts and long sessions, which is most of what an agent does. And keep the llama.cpp setup on disk: it is a one-command rollback and it costs you nothing but drive space.
Checklist
- Release container pinned to a version (we run 0.40.0), not
latest gufo diagnosereports the host as supported- Rootless Podman running crun, so
--group-add keep-groupsworks --served-model-namematches the model id your client asks for- BF16 mmproj downloaded, not the F16 one
- Port bound to 127.0.0.1, with a key-checking proxy in front of anything public
- Thinking toggled the Anthropic way on
/v1/messages - JSON consumers take the last complete object in the reply
- Context set deliberately (we use 524288 on gufo)
- llama.cpp setup and its unit file kept for rollback
- A real agent task run end to end, checked by running the code it writes
Want a straight answer on AI for your business?
No hype and no slide deck. Tell me how the business runs today and I'll tell you where AI actually pays off, and what to fix first.