Skip to content
← Back to YouBlog

Published article

run 125b model on 8gb gpu with MoE offload

Drafted with AI from the video "Your 8GB GPU Can Run a 125B AI Model", then reviewed and published by Gustavo Miranda.

You can run 125b model on 8gb gpu by keeping only the weights every token touches in VRAM and pushing routed experts into system RAM. In llama.cpp that means setting -ngl 999 and adding --cpu-moe, then tuning one setting at a time. Users report roughly 17 to 19 tokens per second on an 8GB RTX 4060 Ti with 64GB of RAM, though those posts remain unverified.

Run a 125B MoE model on an 8GB GPU: the short answer

You can run a 125B mixture-of-experts model on an 8GB GPU by keeping only the weights every token touches in VRAM and routing the rest to system RAM. In llama.cpp, the inference engine that runs GGUF models locally, that means -ngl 999 plus --cpu-moe, a compressed 72.5GB file or larger, and at least 32GB of RAM; users report roughly 17 to 19 tokens per second on an 8GB RTX 4060 Ti with 64GB of RAM, against about 4 on default settings. Those reports come from individual machines and are not a controlled benchmark.

The core idea is simple. A 125B parameter model cannot fit in 8GB. But a mixture-of-experts model does not read all of its parameters for each token, and the GPU only needs to hold the parts that every token reads.

Why a 125B MoE model activates only part of its weights per token

A mixture-of-experts model stores many more parameters than it uses per token, and that gap is why the memory math works at all. Qwen3.8-Flash-Next, the model discussed in the source video and tracked by Unsloth's model documentation, holds 125 billion total parameters but activates roughly 6 billion for each token.

The architecture splits that work across layers and experts. The model card lists 48 layers, and each layer holds 512 experts, which are small blocks of weights. Each token routes to 10 of them plus one shared expert that runs for every token. That gives 24,576 experts across the model, and any single token touches 10 per layer.

Some components run on every pass and cannot be shuttled around cheaply: attention layers, dense feed-forward layers, and the shared expert. The attention layers also read the KV cache, which stores attention data for every earlier token in the conversation and grows as the chat grows. That fact produces one working rule. The GPU keeps what every token touches; system RAM keeps what only some tokens touch.

The exact byte size of the always-on slice is not published in the sources reviewed here, so treat any figure for it as an estimate. What the sources do support is that the slice is much smaller than 125B parameters, which is why an 8GB card can hold it with room left for the KV cache.

Expert split vs layer split: how llama.cpp offload differs

Llama.cpp's default split mode divides the model by whole layers, so the GPU receives complete layers until VRAM fills and the CPU gets the rest. That is the wrong boundary for a mixture-of-experts model, because each offloaded layer drags along 512 experts that a given token may never touch, while the always-used attention weights end up on the slow side of the bus.

An expert split cuts on a different line. The routed experts go to system RAM, and the parts every token reads stay on the card. Llama.cpp added this through two flags, and the --n-cpu-moe option keeps the expert weights of the first N layers on the CPU. A smaller N leaves more expert layers on the GPU. The relevant pull request merged in early August 2025, a few days after the original CPU-MoE flag.

SettingWhat it moves to CPU RAMBest for
Default layer splitWhole layers, experts includedDense models
--cpu-moeAll routed expert weightsMoE models, simple setup
--n-cpu-moe NExpert weights of first N layersFitting VRAM edge cases

The size of the gap between an expert split and a layer split has not been measured in the sources reviewed here. The reasoning is documented; the benchmark is missing.

The PCIe pipe: small vectors instead of multi-gigabyte copies

Offloading experts works because llama.cpp sends activation vectors across PCIe, not weight matrices. PCIe is the link between the GPU and the rest of the machine. A developer-community explainer cited in the source video states that llama.cpp does not copy a whole expert from RAM into VRAM for each call, because that transfer would be far too slow. Instead a compact vector of numbers crosses the bus, the CPU runs the selected experts, and the result comes back.

The comparison is stark. In the guide's worked example, 300GB of weights sitting on the CPU side would take at least about 10 seconds to copy to the GPU over a PCIe 4.0 16-lane link for one batch. Sending a small vector costs a fraction of that.

The trade-off moves to latency. One token can cross PCIe once per layer, which is up to 48 round trips in a 48-layer model. The community author names PCIe latency as the likely bottleneck, but the article provides no benchmark, so treat it as a hypothesis rather than a measured limit.

Memory math: does a 72.5GB quantized file fit in 72GB?

The smallest quantized file for Qwen3.8-Flash-Next.js 72.5GB in IQ1S format, and the other variants Unsloth lists run at 78.9GB, 82GB, 111GB and up, with the original BF16 at 354GB. Adding 8GB of VRAM to 64GB of RAM gives 72GB, which is less than even the smallest file. Something has to hold the remainder, and in this setup it is the SSD.

The model adds a 51 billion parameter n-gram lookup table on top of the 125 billion. That table is read by random lookups rather than dense matrix work. Unsloth's documentation says the table can sit on the SSD and be memory-mapped, so the system reads it from disk on demand, and it is kept at 4-bit or higher. At 4 bits the table's estimated size is about 25GB. Moving it to disk leaves roughly 47GB for the other weights inside the 72GB budget.

That budget is tight. The operating system and the growing KV cache both consume memory, and the sources give no target disk speed. An NVMe SSD is recommended rather than required by measurement, so plan for it and measure your own setup.

What the tuning knobs actually change on an 8GB card

Users credit three settings for the jump from about 4 tokens per second to 17 or 19, but no source decomposes how much each one contributes. Each gain below is a user claim, and each deserves its own test on your machine.

Move the display to integrated graphics

If your CPU has built-in graphics, plug the monitor into the motherboard output instead of the graphics card. The 8GB user claims a 20 to 30 percent gain. On an RTX 4070 Super running a smaller 35B model, one user-reported case went from 50 to 55 tokens per second, a 10 percent gain, while commenters reported about 20 percent. The smaller model gained less than the claim for the 8GB card, so test before expecting the higher number.

Prefer native Linux over WSL2

Windows Subsystem for Linux is Microsoft's compatibility layer for running Linux binaries on Windows. The user claims a 33 to 38 percent gain from native Linux. NVIDIA's WSL2 documentation explains why the gap is plausible: GPU calls pass one after another through a virtual link, and pinned memory, which is RAM the GPU can copy from quickly, is limited under WSL. NVIDIA also reports near-native speed for large workloads, with the shortfall concentrated in small sequential launches. Expert offload is exactly that pattern. No source explains the specific 33 to 38 percent figure, which comes from one user's test.

Match the llama.cpp build to the model

The user says the fastest build differs between the 35B and 125B models but does not say which build wins. Llama.cpp changes quickly, so record the exact build number for each run and keep it in your notes. Every performance figure in this article is as of early October 2026.

RAM speed matters less than expected. One user overclocked DDR5 for 36 percent more bandwidth and saw a 5 to 14 percent speed gain, which suggests RAM bandwidth is one limit among several. PCIe latency is an untested candidate for another.

Strata, AMD cards, and the claims the readme does not make

Strata is a separate inference application built around Qwen3.8-Flash-Next, and it splits work differently from llama.cpp. According to its readme, the GPU keeps the few thousand most-used experts, RAM holds all of them, and the CPU handles the cache misses where a chosen expert is not resident. Startup loads 35 to 55GB into RAM, and the SSD holds the lookup table.

One user reports a budget AMD RX 7600 with 8GB running the 125B model at 24 tokens per second through Strata. That claim carries the largest caveat in the whole setup. Strata's readme states it needs 12GB of VRAM or more, and the RX 7600 is not on its supported card list. The user's result also depends on a fix that is not merged into the project, and no public pull request or issue for it existed in the Strata repositories as of 6 October 2026, so the claim cannot be dated or checked.

Strata's own benchmarks show a 12GB card reaching 94 tokens per second on the Q2 file and 53 on the IQ3 file, and a 16GB AMD card reaching 60 on Q2. Those are vendor-reported figures with no independent verification, and the readme includes no 8GB result. It also warns that its smaller file sizes trade quality for speed.

Compare user reports before you trust one number

The 8GB results are individual reports from machines with different RAM, storage and software builds, and none have been independently verified. Comparing them side by side shows how much the surrounding hardware matters.

HardwareMemoryReported speedNotes
RTX 4060 Ti8GB VRAM, 64GB RAM17-19 tok/sUser report, unverified
RTX 309024GB VRAM, 128GB DDR419 tok/sUnsloth thread, no 8GB entry
RTX 508016GB VRAM, 64GB DDR527.5-29 tok/sUses n-gram speculation
RX 76008GB VRAM24 tok/sStrata, unsupported card

The 8GB user placed 35 to 55GB of RAM in use at startup, so a 64GB machine is the practical floor rather than 32GB. Every figure above is a user or vendor report, not a benchmark run under controlled conditions.

The compression caveat cuts across all of them. These results use low-bit quantized files, not the 354GB BF16 original, and no source measures the answer-quality loss at those bit widths. A fast answer only helps if it is good enough for your task, and that is the open question the sources leave unanswered.

Frequently asked questions

  • What llama.cpp flags enable expert offload? Set -ngl 999 to place all layers on the GPU, then add --cpu-moe to keep routed experts in RAM. --n-cpu-moe N keeps the experts of the first N layers on the CPU, which lets you trade VRAM for speed layer by layer.
  • How much RAM do I need for a 125B model on an 8GB GPU? Plan for 64GB. The smallest quantized file is 72.5GB, and 8GB of VRAM plus 64GB of RAM leaves only 72GB, so the n-gram table is memory-mapped from the SSD. One user hit 35 to 55GB of RAM use at startup.
  • Why is WSL2 slower than native Linux for expert offload? NVIDIA documents that GPU calls pass sequentially through a virtual link under WSL2 and that pinned memory is limited. Expert offload makes many small calls per token, which amplifies that overhead. NVIDIA also reports near-native speed for large workloads.
  • Is Strata a drop-in replacement for llama.cpp? No. Strata is a separate application with its own model support, its own 12GB VRAM requirement and its own benchmark numbers. Its readme does not claim compatibility with llama.cpp settings or files.
  • Can an 8GB GPU really run a 125B model at 17 tokens per second? One user reports it on an RTX 4060 Ti with 64GB of RAM, but the post is unverified and the sources do not isolate which setting produced the gain. Treat 17 to 19 tokens per second as a target to test, not a guarantee.

Turning a benchmark video into a written guide

The useful lesson in this material is that a number without its configuration is not evidence. Four tokens per second and 19 tokens per second can describe the same card, the same model and different split settings, RAM, driver layer and build. Anyone who publishes the second number without the first is handing readers a target they cannot reproduce. That is the same discipline a written article needs: the flags, the file size, the RAM ceiling, the date, and the caveat should travel together.

If you record that kind of material on video, the explanation is often buried in a screen capture and a spoken aside. YouBlog turns a YouTube video into a structured draft: paste the link, transcribe it, and edit the result. Dev doido and Crazystack typescript are examples of the kind of technical channel and stack-specific content that benefits from being written down, and you can read more about tooling at Crazystack.

When the video is the source and the topic is performance, the written version is where the configuration table, the caveats and the date survive long enough to be checked.

Publish the settings, not just the speed

If you have a local-inference setup, a benchmark, or a hard-won configuration recorded on YouTube, a viewer cannot copy it from speech alone. The flags, the RAM ceiling and the date are the parts that make it reproducible. Turn that recording into a written reference at YouBlog so the next person can test it instead of guessing.

Source video

YouTube thumbnail: Your 8GB GPU Can Run a 125B AI Model

Source video

Your 8GB GPU Can Run a 125B AI Model

Create from this video

This article was created automatically from a new video.

Automate my channel

Turn your YouTube videos into articles

Built for creators with a backlog and no editor on staff. This page started as a video. YouBlog drafts from the transcript, you review every word, then publish on a first-party /p/{slug} page. Nothing goes live until you publish it.

Turn your videos into articles

Published with YouBlog