Home / use case

Running 80 GB MoE models on two 16 GB GPUs with llama.cpp 1.0

At a glance
Hardware
2× MSI RTX 5060 Ti 16 GB, no P2P
Intel i7-14700, 64 GB DDR5-6000
Models & engines
llama.cpp v1.0.0 built from source with CUDA 13.0
Qwen3.8-Flash-Next IQ3_XXS (79.1 GiB) and DeepSeek-V4-Flash-0731 UD-IQ1_M (80.9 GiB)
Key gotcha
The MoE cache tuner sizes the cache from the first GPU's free memory only, so on two cards it recommends about half of what fits

What they built

Gancho's homelab box, formula, has two 16 GB GPUs with no peer-to-peer access, and the open MoE models he wanted are 80 GiB and more. After llama.cpp reached 1.0, he built it from source and tested five settings from a video one at a time against the default, on two models.

Each step ran from a script that checks nothing else uses the GPUs, drops the page cache, starts a fresh llama-server and sends the same 4,260-token prompt with 256 generated tokens. Every command, mistake and raw result is published in his ai-homelab repo.

The best Qwen3.8-Flash-Next setup went from 340.9/38.8 to 803.1/59.5 tokens/s (prompt/generation). DeepSeek V4 Flash, whose experts don't fit in RAM, went from 145.7/14.5 to 244.4/20.4.

Setup

  • 2× MSI RTX 5060 Ti 16 GB, no P2P
  • Intel i7-14700, 64 GB DDR5-6000
  • llama.cpp v1.0.0 built from source with CUDA 13.0
  • Qwen3.8-Flash-Next IQ3_XXS (79.1 GiB) and DeepSeek-V4-Flash-0731 UD-IQ1_M (80.9 GiB)

How it works

  1. Baseline: llama.cpp's default --fit keeps all layers on the GPUs and moves only experts to RAM
  2. -cmoe puts all experts in RAM to free VRAM for --moe-cache-mib, which keeps the most used experts on the GPUs
  3. -lm dio reads experts into pinned memory instead of mmap
  4. -b 4096 -ub 4096 cuts a 4,260-token prompt to two micro-batches

Results & numbers

  • --fit generated 2.3x faster than the classic -ngl layer offload on both models
  • Twice the tuner's cache size was 13% faster on Qwen (54.4 vs 48.1 tokens/s)
  • Bigger batches made Qwen prompts 2.5x faster
  • Qwen best config: prompts 2.4x and generation +53% over the default, with the same VRAM and load time

Gotchas

  • The MoE cache tuner sizes the cache from the first GPU's free memory only, so on two cards it recommends about half of what fits
  • DirectIO pins memory: Qwen fit with 8 GiB to spare, DeepSeek couldn't use it at all
  • DeepSeek read about 10 GiB from the NVMe per request; the limit there is 64 GB of RAM
  • A --depth 1 clone broke the build while fetching the web UI; a full-history clone fixed it
  • Quality, long contexts and parallel requests were not measured
“For DeepSeek on this machine, the limit is not a flag but 64 GB of RAM.”— Gancho Stoychev

Do it yourself

  1. Build llama.cpp 1.0 from a full-history clone
  2. Measure the default --fit first as your baseline
  3. Add -cmoe and a --moe-cache-mib about twice the tuner's recommendation if you have two GPUs
  4. Use -lm dio only if all experts fit in RAM, then try --moe-cache-cpu-share 0
  5. Add -b 4096 -ub 4096 and shrink the cache slightly if GPU0 runs out of room
-cmoe --moe-cache-mib 23552 --moe-cache-cpu-share 0 -lm dio -b 4096 -ub 4096
Source: DEV Community (Gancho Stoychev) · Published 2026-11-25 · Added 2026-11-25. This write-up summarizes the original source; see it for full details.

Similar setups

A small firm proofreads NDA-bound reports on its own 8-GPU llama.cpp rig with GLM 5.3

Jacques Mattheij's company can't send confidential due-diligence reports to a cloud AI without breaking its NDAs, so it built a ~$25K in-house GPU rig and proofreads them locally with open-weight models.

Jacques Mattheij (blog) · 2026-11-02

Four 125B-748B open models on one RTX 5090 and 128 GB of RAM, benchmarked side by side

Seppe Gadeyne runs Qwen3.8-Flash-Next, Ornith-1.5-122B, GLM-5.3-Flash and DeepSeek-V4.1-Flash on a single RTX 5090 workstation and measured all four in one night for speed, long context, memory and quality on nine tasks from his own day job.

Seppe Gadeyne (DEV Community) · 2026-10-22

A local eve agent on a 4B model that keeps its pending approval through kill -9

@VarunChopr17597 ran Vercel's open-source eve 1.1 agent framework against Qwen3.5-4B on llama.cpp on a CPU-only Linux box, with no Vercel account, and tested whether a tool waiting for human approval survives the server being killed.

X (@VarunChopr17597) · 2026-11-20

A Baroque music events calendar fed by a local Qwen agent on a home llama.cpp server

A data scientist serves small models with llama.cpp from a 16 GB RTX 4060 Ti box on his home network, and a LangChain agent on it finds upcoming concerts for his wife's Bavarian Baroque events calendar.

Andreas Kaempf (FastDataScience.eu) · 2026-11-04