The options and defaults below come from the official llama.cpp server documentation (the llama-server README on GitHub), read on 23 November 2026. llama.cpp changes quickly, so run llama-server --help to check the options in your build.
Mixture of Experts (MoE) models are often far bigger on disk than they are in use, because only a few "experts" are active for each token. As we explain in MoE vs dense AI models, that makes them better than dense models at coping when they don't fit entirely in VRAM. llama.cpp has dedicated options to take advantage of this. They keep the bulky expert weights in system RAM and leave the rest of the model on the graphics card. If you haven't set llama.cpp up yet, start with how to run llama.cpp on Windows.
The options that matter
These are the relevant llama-server options and how the documentation describes them:
Option | What it does (per llama.cpp docs) |
|---|
-cmoe, --cpu-moe
| Keeps all MoE weights on the CPU (in system RAM) |
-ncmoe N, --n-cpu-moe N
| Keeps the MoE weights of the first N layers on the CPU |
-ngl N, --n-gpu-layers N
| Maximum number of layers to store in VRAM: a number, auto or all (default: auto) |
-fit, --fit on/off
| Adjusts unset arguments to fit in device memory (default: on) |
-fitt, --fit-target MiB
| Memory margin to leave free on each device for --fit (default: 1024) |
-fitc, --fit-ctx N
| Smallest context size --fit may choose (default: 4096) |
--moe-cache-mib N
| GPU cache size in MiB for MoE experts kept on the CPU (default: 0, disabled) |
-ncffn N, --n-cpu-ffn N
| Keeps dense FFN weights of the first N layers on the CPU, for dense models |
Each of these options also has an environment variable, such as LLAMA_ARG_N_CPU_MOE, which is handy if you launch llama.cpp from a script.
Step 1: Let --fit try first
The --fit option is on by default, so recent builds already try to adjust any settings you haven't specified to fit in your device memory. The simplest starting point is to load the model with nothing extra:
llama-server -m C:\models\your-moe-model.gguf
By default, --fit leaves a 1,024MiB margin on each device. If you also game, stream or run other GPU apps at the same time, raise the margin, for example --fit-target 2048. If you need a longer context, --fit-ctx sets the minimum context size it may choose.
Step 2: Put all the experts in system RAM
If loading fails or the GPU runs out of memory, tell llama.cpp to keep every expert weight on the CPU:
llama-server -m C:\models\your-moe-model.gguf --cpu-moe
The model's remaining weights can then go on the graphics card as usual. This setting is the most cautious: it uses the least VRAM, but the most system RAM.
Step 3: Fine-tune with --n-cpu-moe
--cpu-moe can leave VRAM unused on a larger card. --n-cpu-moe N lets you keep only the experts from the first N layers on the CPU:
llama-server -m C:\models\your-moe-model.gguf --n-cpu-moe 20
Start with a high number and lower it step by step. Each step puts more experts on the GPU, until you approach your VRAM limit. Watch dedicated GPU memory in Task Manager's Performance tab while the model loads. If a setting fails to load or leaves no headroom, go back up a step. The right number depends on the model, the quantisation, your context length and your card, so there isn't one figure that suits everyone.
Step 4: Try the MoE expert cache
Newer builds have --moe-cache-mib, which sets aside a GPU cache, in MiB, for the experts kept on the CPU. It's disabled by default (0). If you have some VRAM left over after Step 3, you can try a modest value, such as --moe-cache-mib 1024, and compare. On a multi-GPU system, the documentation says the cache is split between the cards in the same way as the layers.
Make sure you have the system RAM
Moving experts to the CPU only works if they fit in system RAM. As a rough guide, the model's GGUF file size has to fit across your VRAM and free RAM combined, with room left for Windows and your other apps. Our guide on how much RAM you need for local AI covers this in more detail. Speed also depends heavily on memory bandwidth, because experts kept in system RAM are processed from there; see memory bandwidth and local LLM speed explained.
Our verdict
With llama.cpp, a graphics card that's too small for a big MoE model can still run it. Start with the default --fit and nothing else, then add --cpu-moe if the model won't load. Once it works, lower --n-cpu-moe step by step to move experts back onto the GPU until VRAM is nearly full. Raise --fit-target if you need headroom for other apps, and make sure you have enough system RAM to hold the experts you move off the card. Expect your RAM's speed to matter more than usual. Options and defaults change between builds, so check llama-server --help before you start.