# Daniel Han explains how to set llama.cpp’s MoE cache size

> Original title: To enable MoE offloading with a LRU cache in llama.cpp:

- Source: Daniel Han
- Published: 2026-11-14T02:25:52.000Z
- Bad Influence: https://badinfluence.news/items/clvukf5t42uvr01ax1uyjpuou
- Original: https://x.com/danielhanchen/status/2121429376869007854

## Summary

Daniel Han explains how to enable MoE caching in llama.cpp with `--moe-cache-mib N`. He says to set the value to an amount of GPU VRAM in MiB; Unsloth’s llama.cpp prebuilt also offers an `auto` option to size it automatically.

## Post

To enable MoE offloading with a LRU cache in llama.cpp:

--moe-cache-mib N

Set --moe-cache-mib to some amount of your GPU VRAM  in MiB. In Unsloth's llama.cpp prebuilt we have an "auto" option which will auto size it.

See https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md

## Quoted post @danielhanchen

> Local AI wouldn't be here without llama.cpp. Congrats to v1!
> 
> Llama.cpp also now also has MoE offloading and MoE smart LRU caching, so large MoEs which can't fit in VRAM can still be fast!

https://x.com/danielhanchen/status/2121262960291307669
