aliteq.

LM Studio's 'force MoE weights onto CPU' setting: fit a 30B model on an 8GB GPU

It started as a toggle and became a layer slider in LM Studio 0.4.0. Where it lives, what it moves, the number to set on an 8, 12 or 16GB card, and why Mac MLX models don't have it.

Aliteq TeamUpdated Oct 48 min read
Dark photo of an open compact computer case on a wooden desk, two dark blank modules and two coral modules standing inside, with a loose circuit board beside it
Share

The Amiga had two kinds of memory. Chip RAM was shared with the custom graphics chips. Fast RAM was for the CPU alone. Every Amiga owner learned the same trick: keep what the graphics chips touch in chip RAM, and park the bulky rest in fast RAM. A mixture-of-experts model on a small graphics card wants exactly that treatment.

LM Studio has a setting that does it. It has had two names, and it changed shape in January 2026, which is why the advice you find about it rarely matches the app in front of you. I read LM Studio's release notes, its docs and its open-source settings code on 4 October 2026. I didn't install it or time anything, so there are no speed numbers here that aren't LM Studio's own words.

Where is the MoE offload setting in LM Studio?

It's in the model's load settings, under the advanced options. Look for "Number of layers for which to force MoE weights onto CPU". Older guides call it "Force Model Expert Weights onto CPU", which was the same setting's name until December 2025. You can set it when you load a model, or save it as that model's default.

LM Studio added it in version 0.3.23 on 12 August 2025. The release notes told low-VRAM users to "try to turn on the "Force Model Expert Weights onto CPU" option in the advanced load settings." That version was a simple on/off switch.

The name changed in LM Studio's localization file on 23 December 2025, in a commit titled "Improve title". Then version 0.4.0 shipped on 28 January 2026 with this line in its notes: "Added a slider to control n_cpu_moe". So if you're on any 0.4 release, look for a slider with a layer count, not a toggle.

Two places expose it:

  • The model loader. Open it with Cmd + L on a Mac or Ctrl + L on Windows and Linux, pick the model, and open its advanced load settings.
  • My Models. LM Studio's docs say to "click on the gear ⚙️ icon to edit the model's default parameters". Settings saved there apply "when the model is loaded anywhere in the app (including through lms load)".

What does it actually do?

It keeps the expert weights of N layers in system RAM and leaves the rest of each layer on the GPU. LM Studio's own description says it "Leaves attention layers on GPU, saving VRAM while keeping inference fairly fast." That is llama.cpp's --n-cpu-moe, wrapped in a slider.

The 0.3.23 release notes said it plainly: "This is utilizing the same underlying technology as llama.cpp's --n-cpu-moe." In llama.cpp, that flag keeps "the Mixture of Experts (MoE) weights of the first N layers in the CPU". Its sibling, --cpu-moe, keeps all of them there. The LM Studio slider covers both: a middle value is --n-cpu-moe, and the far right is all experts.

Why does this work at all? A mixture-of-experts model has many expert blocks per layer, but each token only uses a few of them. The always-used parts, attention and the router, are small. The experts are huge and mostly idle. So the experts can sit in slower system RAM while the busy parts stay on the fast card. Our explainer on what --n-cpu-moe actually does covers the mechanics and the published llama.cpp benchmarks.

LM Studio's SDK shows how it meets the GPU Offload slider. The SDK field, numCpuExpertLayersRatio, runs from 0 to 1. Its code comment says 1 puts all expert layers in CPU memory "regardless of GPU offload configuration", and 0 means "the expert offload will be determined by GPU offload".

Three LM Studio load settings that sound alike (read 4 Oct 2026)

GPU Offload

What it moves or changes
Whole layers between GPU and CPU (attention and experts together)
Use it for
Dense models that don't fit

Number of layers for which to force MoE weights onto CPU

What it moves or changes
Only the expert weights of N layers go to system RAM; attention stays on the GPU
Use it for
MoE models that don't fit

Number of Experts

What it moves or changes
How many experts the model uses per token. Nothing moves
Use it for
Leave it at the model's default
Comparison of LM Studio load settings. GPU Offload moves whole layers, attention and experts together, and suits dense models. The MoE weights onto CPU slider moves only expert weights of N layers to system RAM and keeps attention on the GPU, matching llama.cpp's --n-cpu-moe. Number of Experts changes how many experts each token uses and moves nothing.
From LM Studio's settings text, SDK source and release notes, read 4 Oct 2026. · aliteq research

When should you turn it on?

Only when the MoE model doesn't fit in your graphics card's memory. LM Studio's 0.3.23 notes say that if the entire model fits, "you're better off sticking with placing expert weights onto the GPU as well". On a dense model the setting has nothing to move.

The current settings text agrees, in fewer words. It says the slider "can be faster than partial GPU offload" and is "Not recommended if the model fits entirely in VRAM." Both halves matter. When something has to leave the card, moving experts can beat moving whole layers. When nothing has to leave, leave it all on the card.

So the order of moves is:

  1. If the model fits, leave the slider at zero.
  2. If it doesn't fit and it's an MoE model, use the expert slider before you lower GPU Offload.
  3. If it still doesn't fit with every expert in RAM, shrink the context or pick a smaller file.

What number should you set, and how much RAM do you need?

Start with the slider value from the table below for your card. It's the number of layers whose experts go to system RAM at LM Studio's default 8K context. The RAM column matters more: if the experts don't fit in system RAM, no setting saves you.

LM Studio's default context is 8K tokens, per its 0.4.16 changelog ("Updated default context length to 8k tokens"). I worked these values out with the same method and GGUF files as our table of the best MoE models for 12GB and 16GB cards, which uses 32K context. The 8GB column is new.

Starting slider value at 8K context (layers with experts in RAM), and RAM to have

gpt-oss 20B (MXFP4)

File
11.3 GB
8GB card
14 of 24
12GB card
5 of 24
16GB card
0 (fits)
RAM to have (8 / 12 / 16GB card)
16 / 16 / 16 GB

Qwen3 30B-A3B 2507 (Q4_K_M)

File
17.3 GB
8GB card
35 of 48
12GB card
24 of 48
16GB card
13 of 48
RAM to have (8 / 12 / 16GB card)
32 / 32 / 16 GB

Qwen3.6 35B-A3B (UD-Q4_K_M)

File
20.6 GB
8GB card
32 of 40
12GB card
24 of 40
16GB card
16 of 40
RAM to have (8 / 12 / 16GB card)
32 / 32 / 16 GB

Qwen3-Next 80B-A3B (Q4_K_M)

File
45.2 GB
8GB card
43 of 48
12GB card
39 of 48
16GB card
35 of 48
RAM to have (8 / 12 / 16GB card)
48 / 48 / 48 GB

gpt-oss 120B (MXFP4)

File
59.0 GB
8GB card
34 of 36
12GB card
32 of 36
16GB card
30 of 36
RAM to have (8 / 12 / 16GB card)
64 / 64 / 64 GB

"RAM to have" is the expert weight in RAM plus 8 GB for your operating system and apps, rounded up to a common kit size. The 8 GB is my allowance, not an LM Studio number. Here's one row worked through, so you can redo it for your own card:

Qwen3.6 35B-A3B on an 8GB card, 8K context (GB = 1024^3 bytes)
GPU floor  = non-expert weights 2.38 + cache 0.16 + overhead 0.78 = 3.32
budget     = 0.9 x 8 = 7.2   (our engine's "comfortable" line)
per layer  = 18.22 GB of experts / 40 layers = 0.455
layers kept on GPU = floor((7.2 - 3.32) / 0.455) = 8
slider     = 40 - 8 = 32
RAM        = 32 x 0.455 = 14.6 GB of experts, + 8 GB allowance -> 32 GB kit

At 32K context the numbers climb a little: Qwen3 30B-A3B needs 41 of 48 layers' experts in RAM on an 8GB card, 31 on 12GB and 20 on 16GB. The full 32K table, with GLM-4.5-Air and Qwen3 235B, is in the 12GB and 16GB MoE guide.

Scorecard of LM Studio expert slider values at the default 8K context. gpt-oss 20B: 14 of 24 layers on an 8GB card, 5 on 12GB, none on 16GB, 16GB of RAM. Qwen3 30B-A3B: 35 of 48, 24, 13, with 32GB of RAM on 8 and 12GB cards and 16GB on a 16GB card. Qwen3.6 35B-A3B: 32 of 40, 24, 16, same RAM. Qwen3-Next 80B-A3B: 43 of 48, 39, 35, 48GB of RAM.
Derived from the GGUF tensor tables and the aliteq VRAM engine at 8K context. Not measured. · aliteq research

These are starting points, not promises. Different GGUF builds of the same model split a few percent differently. Vision models also carry an extra projector file. If the load fails, raise the slider by two. If it loads, try lowering it a step at a time, because every expert layer back on the GPU is one less layer read from slower RAM.

How to set it, step by step

Set it once per model in My Models, so every load path picks it up. Then check that the model loads, and walk the number down while it still does. This is the whole routine:

**Confirm the RAM first.** Find your model in the table above. If your system RAM is under the "RAM to have" figure, pick a smaller model before touching any setting.

**Open the model's defaults.** My Models, then the gear icon next to the model. Defaults saved here also apply to loads through lms load and the API.

**Set GPU Offload to its maximum, then set the expert slider.** That pairing mirrors llama.cpp's usual recipe: every layer on the GPU, with only the experts of N layers in RAM. Use the table's value for your card.

**If loading fails, raise the slider by two or cut the context.** Lower context frees VRAM for more expert layers.

**If it loads, lower the slider one step at a time.** The smallest value that still loads keeps the most experts on the fast card.

The GPU Offload pairing in step three is my reading of the settings, not an LM Studio instruction. The SDK comment says that with the expert setting at zero, expert placement follows GPU Offload. The common llama.cpp pattern, including a command posted on the pull request that added the flag, is --n-gpu-layers 99 plus --n-cpu-moe N. Our step-by-step MoE offload guide walks through that setup.

Don't confuse it with Number of Experts

Number of Experts is a different setting with a confusingly close name. It changes how many experts the model uses for each token. It moves no memory at all. Changing it alters the model's behavior, and LM Studio's SDK says it affects "both performance and quality of outputs".

LM Studio's REST API describes num_experts as the "Number of expert to use during inference for MoE (Mixture of Experts) models." That's a model-behavior knob, not a memory one. If you're trying to fit a model, leave Number of Experts at the model's default and use the slider. A model trained to route through eight experts per token was not trained to run on four.

Why MLX models on a Mac don't have it

The expert slider is a llama.cpp setting, so it only appears for GGUF models. LM Studio's SDK attaches it, together with Number of Experts, only to the llama.cpp engine's settings. The MLX engine's settings list has no expert-offload field. On Apple Silicon it would buy you little anyway.

The reason is in Apple's MLX documentation: "Arrays in MLX live in shared memory." On an Apple Silicon Mac, the CPU and GPU draw from one pool. Moving experts "to the CPU" frees no separate graphics memory, because there isn't any. The limit on a Mac is the total memory in the machine.

GGUF files on a Mac run in LM Studio's llama.cpp engine, but the same rule holds: there is no separate pool of VRAM for the slider to save. Our MoE vs dense explainer covers why MoE models are still a good fit for big unified-memory Macs.

The 0.4.0 complaint, and what LM Studio says

One user filed a bug on launch day of 0.4.0, saying the new slider "forces entire layers (including non-expert parts) onto the CPU". LM Studio's own setting text says the opposite: it moves experts and leaves attention on the GPU. The report, issue #1419, is still open with no reply.

I can't settle that without running the app, and I didn't run it. What I can tell you is what LM Studio publishes: the 0.4.0 notes call it "a slider to control n_cpu_moe", and llama.cpp's n_cpu_moe moves expert weights only. The same 0.4.0 release also fixed "a bug where the model loading will get stuck if the cpu moe slider is maxed out". If you're on 0.4.0 itself, update.

Timeline of LM Studio's MoE expert setting. 4 Aug 2025: llama.cpp merges --n-cpu-moe. 12 Aug 2025: LM Studio 0.3.23 adds the Force Model Expert Weights onto CPU toggle. 28 Aug 2025: 0.3.24 fixes setting it through the SDK. 23 Dec 2025: the label becomes Number of layers for which to force MoE weights onto CPU.
Dates from LM Studio's release notes, changelog and GitHub, read 4 Oct 2026. · aliteq research

Can you set it from lms, the API or code?

Not with a flag. The lms load command takes context length, GPU offload, TTL and an identifier, and the REST load endpoint has no expert-offload field either. The route that works is the model's saved default, which LM Studio applies to every load, including lms load.

The SDKs do expose it. In LM Studio's JavaScript SDK the field is numCpuExpertLayersRatio inside the gpu settings, a fraction from 0 to 1, or "off" and "max". A slider value of 24 on a 48-layer model is 0.5. Version 0.3.24 fixed "setting numCpuExpertLayersRatio via the SDK", so use a current build. The SDK marks the gpu group deprecated while LM Studio works on "an improved way to control split", so expect the name to move.

Since 0.4.24 (9 September 2026), LM Studio also has "advanced llama.cpp argument overrides for GGUF model loading". The SDK marks that experimental and says custom parameters are appended "without validation". If you need llama.cpp's -ot patterns, our llama.cpp MoE offloading guide explains them. If you'd rather drive the flag directly, llama.cpp itself is the cleaner tool, and our Ollama vs LM Studio comparison covers when each app makes sense.

Quick answers

Where is "Force Model Expert Weights onto CPU" in LM Studio?
In the advanced load settings, now under the name "Number of layers for which to force MoE weights onto CPU". The label changed in December 2025, and LM Studio 0.4.0 (28 Jan 2026) turned the toggle into a slider. You can also set it as a model default from the gear icon in My Models.
Is LM Studio's setting the same as llama.cpp's --n-cpu-moe?
LM Studio says so. Its 0.3.23 notes say it uses "the same underlying technology as llama.cpp's --n-cpu-moe", and the 0.4.0 notes call the slider "a slider to control n_cpu_moe". The far-right position matches --cpu-moe, all experts in RAM.
Can a 30B MoE model run on an 8GB GPU in LM Studio?
On paper, yes, if you have the system RAM. Our arithmetic for Qwen3 30B-A3B at 8K context puts the experts of about 35 of its 48 layers in RAM, roughly 12 GB, so a 32GB RAM kit. We didn't measure speed.
Should I change Number of Experts to save VRAM?
No. Number of Experts changes how many experts the model uses per token, which changes its output. It moves no memory. Use the MoE weights onto CPU slider to save VRAM.
Why can't I find the setting for my MLX model?
It belongs to LM Studio's llama.cpp engine, so it only applies to GGUF files. MLX models run in unified memory on Apple Silicon, where the CPU and GPU share one pool, so there's no separate VRAM to save.
Can I set it with lms load?
Not with a flag. Save it as the model's default in My Models, and LM Studio's docs say the default applies to loads through lms load too. The JavaScript SDK exposes it as numCpuExpertLayersRatio.

Found this useful? Share it

Share

Aliteq

Aliteq Team

Aliteq started in 2019 as a PC hardware shop and is now a US-based publication. We build the VRAM and cost calculators on this site, track live cloud-GPU prices, and write guides with AI-assisted drafting that we check against primary sources before publishing.

Work out the hardware

The Aliteq brief

The tech worth knowing — hardware, AI, gaming, deals. No spam, unsubscribe anytime.

Keep reading