tandem.cpp

by ewhacc · Runtime · Text & code

A set of patches for llama.cpp that runs mixture-of-experts models bigger than your graphics memory or RAM by streaming experts from SSD.

unproven

Developer reports large speedups over llama.cpp; independent tests have found none so far

Latest · Nov 23MIT-licensed llama.cpp patch set (v0.5.0) running any llama.cpp-supported MoE model larger than VRAM or RAM, single user, Linux only

AccessOpen codePricefreeRuns onLinuxLicenseMIT

Who says what

Early days

ewhacc, its developer

Reports 14.2 vs 7.4 tok/s on DeepSeek Flash 4.1 with an RTX 5070 Ti and 33.1 vs 11.5 on an RTX 5090. By Nov 23 his claim narrowed to up to 15% faster when the model exceeds RAM and about 2x when it just misses, and his own runs show Strata faster once the model fits in RAM.

IT Lab, who tested it, and Агенты Романа (Roman's Agents), who reviewed the claims

IT Lab found no advantage from the AMD build on a Qwen model, and an earlier build reportedly ran 6 tok/s vs 6.86 for stock llama.cpp on an i5-12400. Агенты Романа (Roman's Agents) notes the published comparison never says llama.cpp's own expert cache was enabled.

What would settle it. An outside test against current llama.cpp with its expert cache tuned, on the same NVIDIA system.

Seen running on

MachineSpeedHowSeen by
5 runs on 16 GB
RTX 5070 Ti74.3 tok/sIQ3_Sr/LocalLLaMA · Nov 23
RTX 5070 Ti52.4 tok/sIQ3_Sr/LocalLLaMA · Nov 23
RTX 5070 Ti9.4 tok/sr/LocalLLaMA · Nov 23
RTX 5070 Tino speed givenАгенты Романа (Roman's Agents)Russian · Nov 18
RTX 5070 Ti14.2 tok/sАгенты Романа (Roman's Agents)Russian · Nov 18
3 runs on 32 GB
RTX 5090190.5 tok/sIQ3_Sr/LocalLLaMA · Nov 23
RTX 509060.7 tok/sr/LocalLLaMA · Nov 23
RTX 509033.1 tok/sАгенты Романа (Roman's Agents)Russian · Nov 18

Evidence

  1. Nov 23
    Repo had 125 stars and 21 forks; tested on RTX 5090, 5070 Ti, 4090, 6000 Ada and PRO 6000 Blackwell; AMD HIP build tested on one RX 7900 XTX
    Maker's claimewhaccviar/LocalLLaMA
  2. Nov 23
    Claims up to 15% faster decoding when the model is bigger than RAM, and about 2x faster when it just misses fitting in RAM
    Maker's claimewhaccviar/LocalLLaMA
  3. Nov 23
    Qwen3.8 IQ3_S + MTP with 32 GB RAM on RTX 5070 Ti: 52.4 tok/s decode versus Strata's 30.2–35.4
    Hands-on testewhaccviar/LocalLLaMA
  4. Nov 23
    Qwen3.8 IQ3_S + MTP with 128 GB RAM on RTX 5090: 190.5 tok/s versus Strata's 201.1; Strata faster when model fits in RAM
    Hands-on testewhaccviar/LocalLLaMA
  5. Nov 23
    Qwen3.8 IQ3_S + MTP with 64 GB RAM on RTX 5070 Ti: 74.3 tok/s versus Strata's 87.5
    Hands-on testewhaccviar/LocalLLaMA
Show all 18
  1. Nov 23
    DeepSeek-V4.1 Maya-XS on RTX 5090 with 128 GB RAM: 60.7 tok/s versus Maya's 39.6 (56.4 with DSpark)
    Hands-on testewhaccviar/LocalLLaMA
  2. Nov 23
    DeepSeek-V4.1 Maya-S on RTX 5070 Ti with 64 GB RAM: 9.4 tok/s versus Maya's 6.0 (6.1 with DSpark)
    Hands-on testewhaccviar/LocalLLaMA
  3. Nov 23
    Quality measured by KL divergence: same Qwen3.8 IQ3_S file gives 0.0259 on tandem.cpp versus 0.0260 on Strata, so output quality is unchanged
    Maker's claimewhaccviar/LocalLLaMA
  4. Nov 18
    Developer reports 14.2 tok/s on DeepSeek Flash 4.1 on an RTX 5070 Ti with 64 GB RAM and fast SSD, versus 7.4 for stock llama.cpp (Oct 28 build)
  5. Nov 18
    First token arrived after about 6 seconds with tandem.cpp versus about 14 seconds with stock llama.cpp; a repeat tandem.cpp run gave 13.3 tok/s
  6. Nov 18
    On an RTX 5090 with 128 GB RAM tandem.cpp reached 33.1 tok/s versus 11.5 for stock llama.cpp, nearly three times faster
  7. Nov 18
    On a 40-problem math sample all configurations solved 39 or 40 problems; too small to prove quality is preserved, but no obvious breakage
  8. Nov 18
    An earlier Nov 1 build on an Intel Core i5-12400 with a model about 3x RAM size ran at 6 tok/s versus 6.86 for stock llama.cpp
  9. Nov 18
    IT Lab's independent test of the AMD adaptation on a Qwen-family model found no advantage over their previous setup
  10. Nov 18
    A newer version adds a Store mode that combines VRAM and pinned RAM as cache and reads missing experts straight from SSD in parallel with compute; it postdates the 14.2 tok/s tests
  11. Nov 18
    Described version runs only on Linux, is aimed mainly at NVIDIA and assumes a single user; with expert cache on, greedy decoding can differ between runs
  12. Nov 18
    Splits cache misses between CPU and GPU based on measured system performance, an idea partly borrowed from Strata; the exact formula is not published
  13. Nov 18
    Video notes the published tandem.cpp comparison does not say llama.cpp's expert cache was enabled, and no test pits tandem.cpp against current llama.cpp with both mechanisms tuned on the same system

Everything said about tandem.cpp, on the wire

Cost to run

Alternatives

Works with