DEV Community

Cover image for llama.cpp 1.0: MoE Offload Became a Cache Problem, Not a Flag
Kartalio
Kartalio

Posted on Edited on Originally published at kartalio.com

llama.cpp 1.0: MoE Offload Became a Cache Problem, Not a Flag

Originally published with an interactive architecture mind map on KartaWorld Pulse (Kartalio).

Three weeks after 1.0, llama.cpp still ships ~16 nightlies a day. The real change: host-resident MoE experts now live in an LRFU cache with a tunable CPU share, behind a stable C ABI and 19 runtime-loadable backends.

The version bump mattered less than the memory model it locked in.

Executive Takeaway: The November 13 release replaced --n-cpu-moe, a static per-layer switch, with a host-side expert cache: --moe-cache-mib, --moe-cache-cpu-share, LRFU eviction, and no CPU wait on cached experts. The question stops being "does the model fit in VRAM" and becomes "what is the expert hit rate".

Around that core, llama.cpp published a stable C ABI, promoted the NextN speculative API into llama.h, added FP8 KV caches, and now compiles 19 ggml backends into runtime-loadable libraries. Three weeks later the repo still publishes roughly 16 nightlies a day. The cadence is the product.

llama.cpp v1.0.0 banner: 'A stronger foundation for the local AI ecosystem'

ggml-org/llama.cpp - LLM inference in C/C++

1 · Inside the Expert Cache

MoE weights are a paging problem wearing a flag's clothing.

Before 1.0 the answer to "my MoE does not fit" was --n-cpu-moe N: keep the experts of the first N layers on the CPU. It works, but the split is static and per layer, so every token that touches an offloaded layer pulls expert weights across the bus, whether that expert is hot or never routed.

Why Layer Offload Hit a Wall

Static split, layer granularity, no reuse across tokens

  • Bandwidth-bound, not capacity-bound: a token routes to a few experts, so the cost is a PCIe transfer per expert per layer, not a missing FLOP.

  • Coarse knob: --n-cpu-moe moves whole layers. A model that misses VRAM by 1 GB loses a full layer's expert set.

  • No second chance: without an eviction policy there is no hot set that survives across decode steps.

LRFU Eviction and CPU-Side Misses

Expert weights become a tunable cache

  • moe_cache_size / --moe-cache-mib: GPU-side budget for host-resident experts, split across GPUs the same way as --tensor-split.

  • moe_cache_cpu_share: the fraction of misses the CPU computes straight from host memory instead of uploading to the GPU.

  • LRFU / ClassLRU: recency-plus-frequency replacement, so frequently routed experts stay resident instead of being flushed by a single cold token.

  • No CPU wait on hits: cached experts no longer stall the device queue behind the host.

Dimension Pre-1.0 1.0
MoE offload Per-layer flag Expert cache
Replacement None (static) LRFU / ClassLRU
KV cache types f16, q8_0, q4 + f8_e4m3
Multimodal code clip.h + mtmd Unified mtmd
Public C API 35 deprecated fns Pruned + NextN
Versioning Rolling build tags Semver + ABI

FP8 KV Cache With Per-Tensor Scales

-ctk f8_e4m3 -ctv f8_e4m3

FP8 E4M3 joins f32, f16, bf16, q8_0 and q4 in the accepted KV types, with optional static per-tensor scales. Halving KV bytes buys context length or concurrency; the cost is attention-side quantization error, which is exactly where long-context accuracy is most brittle.

One ABI, Nineteen Backends

Runtime-loaded ggml libraries, not compile-time forks

ggml/src now carries 19 backend directories: CPU, CUDA, HIP, MUSA, SYCL, Vulkan, Metal, OpenCL, WebGPU, Hexagon, CANN, OpenVINO, ZenDNN, VirtGPU, RPC and more. Each builds as a dynamic library that can be loaded at runtime, so one API surface can drive a Snapdragon NPU and an H100 without recompiling the caller.

llama cli running a vision-language session against a local GGUF model

2 · The Release Machine

300 releases, 19 days, one repository.

Cadence is not vanity here. Every merge is compiled, quantized and exercised on vendor hardware through self-hosted runners, so a nightly tag is the shortest path from a kernel patch to a binary a user can download.

298 Nightlies in 19 Days

Counted from the GitHub releases API

The newest 300 GitHub releases span November 17 to December 5, and 298 of them are nightly b builds. The last seven days, shown below, average about 13.4 releases a day.

Coverage at 1.0

192 model files, 19 backends, 447 contributors

The model file count is measured from src/models/*.cpp; the project's own blog claims 150+ architecture variants, a number that includes variants sharing a source file and is consistent with 192 files.

Metric Value
GitHub stars 137,619
Forks 26,674
Open issues 2,860
Named contributors 447
Model source files 192
ggml backend dirs 19
Nightlies, newest 300 298

3 · Limits and Counterarguments

What the cache does not buy you.

A Hit Still Costs a Copy

Misses cross the interconnect, not magic

The cache reduces uploads; it does not delete the bus. A 16-lane PCIe 5.0 link tops out near 64 GB/s in theory, and a missed 4-bit expert block still has to cross it. Raising --moe-cache-cpu-share trades GPU idle time for host compute, which only pays off if the CPU cores and their memory bandwidth are not already committed to another tenant.

Semver Covers the Header, Not GGUF

API stability is not format stability

1.0 promises that breaking changes to include/llama.h get a major bump. It says nothing about GGUF layouts, chat templates, or the 35 removed functions that downstream bindings still call. Projects that pinned a commit now need a policy for both.

Benchmarks Are Still Machine-Specific

No official cross-vendor table

llama.cpp ships llama-bench and leaves the numbers to whoever runs it. The Hexagon HMX kernels, Vulkan RDNA3/4 vision encoder work and ARM SVE paths in the current nightly stream are merge-level optimizations; independent, per-device numbers are the reader's job before quoting a speedup.

4 · Operator Playbook

Two populations, two policies.

Pin or Track

Pin for products, track for experiments

Pin if you embed libllama or ship a product: fix a minor version, read the semver rules, and vendor the GGUF files you validated. Track if you run a lab or a hobby box: the nightly channel is where new architectures land first, and regressions are usually reverted within days.

A 30-Minute Evaluation

Override one layer, measure hit rate, keep or revert

# v1.0: all experts host-resident, 4 GiB cached on the GPU
llama serve -m ./model-Q4_K_M.gguf \
  -ngl 99 -ctk f8_e4m3 -ctv f8_e4m3 \
  --n-cpu-moe 99 --moe-cache-mib 4096 \
  --moe-cache-cpu-share 0.25
# measure before/after on the same box
llama-bench -m ./model-Q4_K_M.gguf -p 512 -n 128 -r 3
Enter fullscreen mode Exit fullscreen mode

Security Defaults Moved

Upgrade if llama-server faces a network

1.0 closed SSRF in the CORS proxy and media fetchers, fixed DNS rebinding and child-instance access, restricted HF_TOKEN to huggingface.co, and made tools and private media URLs opt-in via --allow-unauthenticated-tools and --media-allow-private-urls. If you exposed the server, the upgrade is a patch, not a feature.

Llama Chat, the built-in web UI, against llama serve running Qwen

5 · Verified Sources

Primary documents, not press coverage.

Primary Documents

llama.cpp v1.0.0 announcement (Hugging Face)

v1.0.0 release notes and changelog

Build guide: 18 documented backend paths

llama cli flag reference

llama.app - official install path

Primary Sources & References


Explore the interactive mind map & bilingual breakdown: Read on Kartalio Pulse →

Top comments (0)