# Can gpt-oss-20b run on an 8GB or 12GB GPU? Yes, with --n-cpu-moe

Everyone says 16GB minimum. That's only true if the whole model has to live on the GPU. llama.cpp's own guide runs it on an 8GB RTX 2060. Here are the commands, and the starting values for your card.

Updated Nov 17, 2026 · By Ari Vale

This page has referral links: we earn a commission if you buy, at no cost to you.

Our Vast referral code: 623346 (link: https://cloud.vast.ai/?ref_id=623346). New users get no bonus from it; we earn 3% of what referred users spend (Vast's referral program docs: https://docs.vast.ai/guides/reference/referral-program?ref_id=623346).

## The short answer

Yes, with one llama.cpp flag. gpt-oss-20b doesn't fit fully in 8GB or 12GB. llama.cpp's own guide puts the full model at about 14.9GB at 8K context, and our VRAM engine puts it at about 13 GiB. But it's a Mixture-of-Experts model, and about 19 of its 21 billion parameters are experts that llama.cpp can keep in system RAM with `--n-cpu-moe`. llama.cpp's official guide runs it on an RTX 2060 8GB with `--n-cpu-moe 16` at 32K context. Our engine lands on the same number for 8GB, and suggests about `--n-cpu-moe 6` on a 12GB card like the RTX 3060 at 16K. Budget roughly 6–7 GiB of system RAM for the offloaded experts. (llama.cpp v0.5.0 docs, accessed Sep 25, 2026.)

- **Fits fully?** No: ~13 GiB (our engine, Q4_K_M, 8K) / 14.9GB (llama.cpp's table, 8K)
- **Always on the GPU:** ~1.8B non-expert params ≈ 1.0 GiB, plus KV cache and buffers
- **8GB (e.g. RTX 2060):** `--n-cpu-moe 16` at 32K, llama.cpp's own example
- **12GB (e.g. RTX 3060):** start around `--n-cpu-moe 6` at 16K, then tune

Yes, gpt-oss-20b runs on an 8GB or 12GB card if llama.cpp keeps most of its expert weights in system RAM with `--n-cpu-moe`; start around 16 on 8GB at 32K context and 6 on 12GB at 16K. Most gpt-oss-20b guides, including our own [can you run gpt-oss-20b](https://aliteq.com/can-you-run-gpt-oss-20b-locally), say 16GB is the minimum. That's true if you want the whole model on the GPU. It isn't true if you're willing to put part of it in system RAM, and for this particular model that's a much better deal than it sounds. Here's why, the exact commands from llama.cpp's own guide, and the numbers to start from on an 8GB or 12GB card.

> **Pinned to**
>
> llama.cpp v0.5.0 (GitHub release, Sep 23, 2026): llama-server README and the official "running gpt-oss with llama.cpp" guide (Discussion #15396), accessed Sep 25, 2026. VRAM figures are from our engine unless marked as llama.cpp's. I haven't benchmarked these setups myself.

![Flat illustration of a person splitting an AI brain puzzle piece between a small graphics card and a row of memory sticks](https://media.aliteq.com/media/ai/gpt-oss-20b-8gb-12gb-gpu-moe-offload-2026.jpg)
The trick: keep the small, always-used part on the GPU and park the big, rarely-used experts in system RAM. · Illustration generated with Higgsfield

## Why gpt-oss-20b splits so well

gpt-oss-20b is a [Mixture-of-Experts](https://aliteq.com/moe-vs-dense-ai-models-explained) model: 24 layers, each with 32 expert networks, of which 4 run for any given token. From the model's own configuration, the experts are about **19.1 billion** of its 20.9 billion parameters. The part every token touches (attention, embeddings, routing) is only about **1.8 billion**. That's an unusually lopsided split, and it's exactly what llama.cpp's `--n-cpu-moe` flag exploits. The small always-used part stays on the fast GPU, and the big rarely-used part goes to system RAM.

- **19.1B params** Expert weights (≈10.8 GiB at Q4_K_M (our engine))
- **1.8B params** Always-on weights (≈1.0 GiB at Q4_K_M)
- **≈0.45 GiB** Experts per layer (what each --n-cpu-moe step frees)
- **11.27 GiB** Official file (gpt-oss-20b-mxfp4.gguf (llama.cpp guide))

One note on the numbers: our engine models a Q4_K_M quantisation, while the official GGUF ships in OpenAI's MXFP4 format at 11.27 GiB (per llama.cpp's guide). Our estimate runs slightly high, which errs toward "won't fit", the safe direction.

## Does it fit without offloading?

### gpt-oss-20b, full model on the GPU

|   | 8K context | 32K context | Source |
| --- | --- | --- | --- |
| Our engine (Q4_K_M, 0.8 GiB overhead) | ≈13.0 GiB | ≈14.1 GiB | src/lib/vram.ts |
| llama.cpp's table (MXFP4, incl. 2.7GB compute buffers) | 14.9GB | 15.5GB | Discussion #15396 |

Either way, the answer is no for 8GB and 12GB cards, and tight on 16GB. llama.cpp's guide says 16GB is "just at the edge" and caps context at 32K there. (llama.cpp's figure includes 2.7GB of compute buffers at the large batch size its example commands use, which is why it's higher than ours.) That's where offloading comes in.

## The commands (from llama.cpp's own guide)

llama.cpp's [official gpt-oss guide](https://github.com/ggml-org/llama.cpp/discussions/15396) has a section for devices with less than 16GB of [VRAM](https://aliteq.com/tools/vram-calculator). Its example machine is an RTX 2060 8GB:

```shell
# llama.cpp official gpt-oss guide (Discussion #15396), accessed Sep 25, 2026
# RTX 2060 8GB — full context:
llama-server -hf ggml-org/gpt-oss-20b-GGUF --ctx-size 0 --jinja -ub 2048 -b 2048 --n-cpu-moe 22

# RTX 2060 8GB — 32K context:
llama-server -hf ggml-org/gpt-oss-20b-GGUF --ctx-size 32768 --jinja -ub 2048 -b 2048 --n-cpu-moe 16
```

- **`-hf ggml-org/gpt-oss-20b-GGUF`** downloads the [official GGUF](https://huggingface.co/ggml-org/gpt-oss-20b-GGUF) from Hugging Face.
- **`--n-cpu-moe N`**: the [llama-server README](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md) describes it as "keep the Mixture of Experts (MoE) weights of the first N layers in the CPU". The guide: "finding the optimal value requires some experimentation."
- **`--cpu-moe`** keeps *all* expert weights on the CPU. It's the lowest-VRAM option, useful as a first test.
- **`--jinja`** uses the chat template embedded in the GGUF. The guide includes it on every gpt-oss command.
- **`--ctx-size 0`** means "the model's default", 128K for gpt-oss. Lower it to save VRAM.

## Starting values for your card

Here's our engine's version of the same calculation: the always-on weights plus KV cache and overhead, then as many layers of experts as fit in 90% of your VRAM. The rest go to system RAM. At 32K on 8GB it lands on `--n-cpu-moe 16`, the same number llama.cpp's guide uses for its RTX 2060, which is a good sign the maths is sound.

### Suggested --n-cpu-moe starting points (our engine, Q4_K_M, 90% of VRAM)

|   | 16K context | 32K context | System RAM for offloaded experts |
| --- | --- | --- | --- |
| 8GB card (RTX 2060 / 3060 Ti / 4060) | --n-cpu-moe 14 | --n-cpu-moe 16 | ≈6.3–7.2 GiB |
| 12GB card (RTX 3060 12GB / 4070) | --n-cpu-moe 6 | --n-cpu-moe 8 | ≈2.7–3.6 GiB |
| 16GB card | 0 (fits fully) | 0 (fits fully) | — |

On a 12GB card such as the [RTX 3060 12GB](https://aliteq.com/gpus/rtx-3060-12gb), this is the command to start from:

```shell
# A 12GB starting point based on the numbers above (flags per the llama.cpp README)
llama-server -hf ggml-org/gpt-oss-20b-GGUF --ctx-size 16384 --jinja --n-cpu-moe 6

# Won't start / runs out of memory?  Lower --ctx-size first, then raise --n-cpu-moe by 1–2.
# Plenty of VRAM left?  Lower --n-cpu-moe to keep more experts on the GPU (faster).
```

> **Windows: "it loaded" doesn't mean "it fits"**
>
> llama.cpp's guide warns that on Windows "it is possible to allocate more VRAM than available, and the result will be slow swapping to RAM and very bad performance." If generation is unexpectedly slow, watch GPU memory in Task Manager. If it's spilling into shared memory, raise --n-cpu-moe until it doesn't.

On system RAM: the offloaded experts need somewhere to live, on top of your OS and apps. On an 8GB card that's roughly 6–7 GiB of experts, so 16GB of system RAM is the practical floor and 32GB is comfortable. That's my inference from the sizes above, not a figure from the guide. How fast it runs depends on your RAM and PCIe speed. llama.cpp's guide doesn't publish a tokens-per-second figure for its 8GB example, and I'm not going to invent one. Expect it to be slower than the 16GB results, but, as the guide puts it, offloading can still "provide decent performance."

If offloaded speed isn't enough for your work, a 24GB card holds the whole model with room for long context. On Vast.ai on Nov 17, 2026, a 24GB [RTX 3090](https://aliteq.com/gpus/rtx-3090) started at $0.12 an hour; our [live cloud GPU prices](https://aliteq.com/cloud-gpu) show today's rate.

**Offloading too slow for you?** When offloading is too slow, run the whole model on a rented 24GB card. This link opens Vast.ai with Ollama and Open WebUI ready to use, so you pull gpt-oss:20b and start chatting. [Rent a 24GB RTX 3090 with Ollama ready](https://cloud.vast.ai/?template_id=26e7446a7d6906ee366b620c84e1e422&ref_id=623346) (Referral link: we earn a commission if you buy.) Live RTX 3090 prices on Vast.ai, from and typical: https://aliteq.com/vast-ai-pricing

## Going deeper

- **Tuning `--n-cpu-moe` in general:** our run a big MoE model on a small GPU guide covers the tuning order and multi-GPU tensor placement.
- **Why offloading experts can be faster than it sounds:** see [what --n-cpu-moe actually does](https://aliteq.com/n-cpu-moe-llama-cpp-what-it-actually-does).
- **Running cost:** [cost to run gpt-oss-20b](https://aliteq.com/cost-to-run/gpt-oss-20b) prices it on your own card vs renting.
- **If you're buying a card for it:** 16GB fits it fully. See [the best GPU for gpt-oss-20b](https://aliteq.com/can-you-run-gpt-oss-20b-locally).
- **On a 16GB card already?** Our guide to [what the RTX 5060 Ti 16GB runs](https://aliteq.com/what-llms-can-the-rtx-5060-ti-16gb-run) covers the models that fit next to gpt-oss-20b.
- **Using LM Studio instead of llama.cpp:** LM Studio has its own setting for expert offload, explained in [LM Studio MoE offload](https://aliteq.com/lm-studio-moe-offload-expert-weights-cpu).
- **Using Ollama:** see [MoE offload in Ollama](https://aliteq.com/ollama-moe-offload-cpu) for what it can and can't do.
- **Other models for 8GB cards:** [the best local LLMs for 8GB](https://aliteq.com/best-local-llm-8gb-vram).
- **Other models for 12GB cards:** [the best local LLMs for 12GB](https://aliteq.com/best-local-llm-12gb-vram).

**Serving it to an app instead of chatting?** If you want gpt-oss-20b behind an API for an app, a full 24GB card avoids offload entirely. Runpod starts one from a one-click template in its Secure Cloud datacenters, and its serverless option bills only while requests run. [Run gpt-oss-20b on a Runpod RTX 4090](https://console.runpod.io/signup?ref=nuninlts) (Referral link: we earn a commission if you buy.) Live RTX 4090 prices on Runpod, from and typical: https://aliteq.com/runpod-pricing

This guide is part of our [How much VRAM do you need to run an AI model](https://aliteq.com/how-much-vram-do-you-need-to-run-ai-models) guide. Related guides: [Which MoE model runs best on a 12GB or 16GB GPU, and how much RAM do you need?](https://aliteq.com/best-moe-models-for-12gb-16gb-gpu), [What is MXFP4? The 4-bit format gpt-oss ships in, explained](https://aliteq.com/what-is-mxfp4), [Out of memory at long context](https://aliteq.com/kv-cache-quantization-explained).

## Quick answers

**Q: Can gpt-oss-20b run on 8GB of VRAM?**

A: Yes, with llama.cpp's --n-cpu-moe flag keeping most expert weights in system RAM. llama.cpp's official guide runs it on an RTX 2060 8GB with `--n-cpu-moe 16` at 32K context, or `--n-cpu-moe 22` at full context (v0.5.0 docs, accessed Sep 25, 2026).

**Q: Can gpt-oss-20b run on an RTX 3060 12GB?**

A: Yes. The full model doesn't fit (about 13 GiB on our engine at 8K), but with experts partly offloaded our engine suggests starting around `--n-cpu-moe 6` at 16K context (8 at 32K), keeping roughly 3 GiB of experts in system RAM. Tune from there.

**Q: How much system RAM do I need to offload gpt-oss-20b?**

A: On an 8GB card roughly 6–7 GiB of expert weights sit in system RAM, so 16GB of RAM is a practical floor and 32GB is comfortable. On a 12GB card it's about 3–4 GiB. These are our estimates from the model's size, not official figures.

**Q: What does --n-cpu-moe do?**

A: Per the llama-server README, it keeps "the Mixture of Experts (MoE) weights of the first N layers in the CPU". The always-used parts of the model stay on the GPU, and the large, rarely-used expert weights go to system RAM. --cpu-moe moves all of them.

**Q: How fast is gpt-oss-20b on an 8GB GPU?**

A: llama.cpp's guide doesn't publish a tokens-per-second figure for its 8GB example, and we don't have one we can source. It will be slower than on a 16GB card that holds the whole model, and your RAM and PCIe speed matter more once experts are offloaded.

## Sources

- [llama.cpp — guide: running gpt-oss with llama.cpp (Discussion #15396, accessed Sep 25, 2026)](https://github.com/ggml-org/llama.cpp/discussions/15396)
- [llama.cpp — llama-server README (v0.5.0)](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md)
- [ggml-org — gpt-oss-20b GGUF (Hugging Face)](https://huggingface.co/ggml-org/gpt-oss-20b-GGUF)
- [Higgsfield plans and pricing (official page, checked Dec 2, 2026)](https://higgsfield.ai/pricing?fpr=lax-8e2251&fp_sid=gpt-oss-20b-8gb-12gb-gpu-moe-offload--md)
- [Illustration generated with Higgsfield](https://higgsfield.ai?fpr=lax-8e2251&fp_sid=gpt-oss-20b-8gb-12gb-gpu-moe-offload--md)

---

Canonical: https://aliteq.com/gpt-oss-20b-8gb-12gb-gpu-moe-offload

This page has referral links: we earn a commission if you buy, at no cost to you.
