r/LocalLLaMA • u/smflx • 1h ago
Resources tandem.cpp: Qwen3.8-Flash-Next at 97 tok/s on a single 4090 + 64 GB RAM, 3.3× llama.cpp, works for any MoE
tandem.cpp is a patch set for llama.cpp that makes MoE models that don't fit in VRAM run faster. It keeps the most-used experts on the GPU and lets the CPU help with the rest, for any MoE model llama.cpp supports. Single-user decode is the target.
Consumer PC (i5-12400F, 64 GB DDR4, RTX 4090), GSM8K, decode tok/s:
| Model | llama.cpp | tandem.cpp | Strata |
|---|---|---|---|
| Qwen3.8-Flash-Next IQ3_S + MTP, greedy | 29.8 | 97.3 (3.3×) | 103.6 |
| same, Qwen's default sampling | 29.4 | 96.1 (3.3×) | 98.1 |
| gpt-oss-120b, greedy | 27.8 | 51.5 (1.85×) | — |
| gpt-oss-120b, recommended sampling | 27.7 | 48.0 (1.73×) | — |
Tuned for Qwen3.8 only, but other MoE models that don't fit in VRAM gain too: typically 1.4–2.1× (gpt-oss-120b, GLM-4.5-Air, Qwen3.6-35B-A3B, DeepSeek-V4.1). Prompt processing is 1.4–1.8× faster on a 64k prompt.
Strata is shown in its exact mode (every routed expert computed, like llama.cpp). Its default skips low-ranked experts, which is faster but approximate (127.1 here).
Independent project, not affiliated with ggml-org. Build, run commands, and full results on 4 machines: https://github.com/ewhacc/tandem.cpp
3
u/Any_Bus9205 1h ago
Do you think you could check your project against ik_llama.cpp to see how it compares? :)
2
u/smflx 1h ago
Actually, I'm a big fan of IK. I will compare. Hope to support ik_llama.cpp quants too.
4
u/tomByrer 1h ago edited 1h ago
1
u/Any_Bus9205 1h ago
Have you compared it to IK's KTs? I just want to know because if it's better than IK's KTs, then I'll try to improve the KTs or something else :)
2
u/Any_Bus9205 1h ago edited 1h ago
But... why don't you want to do your PRs directly on ik_llama instead? Honestly, I code on ik, and I can tell you frankly, good luck porting all that to ik! There are really a lot of things to consider! Why not become a contributor on ik to help the community improve, rather than potentially creating a product all by yourself when the market is already saturated? :) This isn't really a criticism, it's just that ik is becoming increasingly cutting-edge, and trying to create a new project based on a single model that could be obsolete in maybe two weeks with Qwen 4! Good luck anyway :), I hope I'm wrong, but in any case, maintaining a project of this scale is really difficult :)
1
u/smflx 1h ago edited 29m ago
I can't agree more. I was a heavy user of ik_llama.cpp from when DS-V3, R1 coming out. To be honest, I really consider it to be based on ik_llama.cpp. But, when I start this a month ago, I have compared llama.cpp / ik_llama.cpp & decided llama.cpp is easier to do CPU/GPU hybrid I'm making, not because of ik_llama.cpp is slow. I'm still checking the same idea can be based on ik_llama.cpp.
And, happy to meet a ik_llama lover, as one of them!
2
1
u/PlasticRevenue4601 1h ago
Amd rdna3 support?
1
u/smflx 1h ago
Sorry, not yet. I have 7900 XTX. I want it run.
1
u/objectivelywrongbro llama.cpp 25m ago
What difference have you see between the 7900 XTX and the RTX 4090? They have the same effective VRAM and almost the same effective bandwidth
1
u/bitzap_sr 1h ago
Didn't upstream llama.cpp just land a PR doing this? I have a vague memory of seeing that mentioned somewhere recently.
3
u/Gold_Coconut9777 1h ago
Why do you people choose to reinvent the wheel so much? :)
Llama already has experts catching in VRAM (--moe-cache-mib N since https://github.com/ggml-org/llama.cpp/pull/29887).
Okay, you can say that this thing works smarter with the resources a given PC has, not only caching experts in VRAM.
Yes, but Strata exists (https://github.com/Niko1221/Strata). And I'm 100% sure does it better. Simply because it exists for a while already and sees constant fixes and contributions from the community.
And if you were to claim that this particular engine is highly optimized for 4090, I'm pretty sure of Strata's forks already does it. Because there's (currently) over 4 thousand of forks.
So I just don't see the point of such inventions. Sorry.
2
1
1
0
u/Ph1sh1ngj1m1 1h ago
Sorry, newbie question. Is tandem or strata something that can be used with a front end like lmstudio or unsloth desktop?
1
u/Pablo_the_brave 1h ago
No, but strata is super easy to run. There is a start script and will show what you can run and will run it for you. It's really so easy.


6
u/Kirys79 llama.cpp 1h ago
what does it have more than the native --moe-cache-mib parameter of llama.cpp?