Local Deployment of Ultra-Large MoE Models: Calculate Memory First, Then Talk Quantization
As Mixture-of-Experts (MoE) architectures become the mainstream way to scale LLM capability, total parameter counts keep growing while only a small fraction is activated per inference pass. This sparse activation makes it feasible to run very large models locally, but multi-terabyte weight files remain out of reach for most developers. Using an open-source MoE model with roughly 744B total parameters and about 40B active parameters as an example, this article explains what dynamic quantization can and cannot do, and how to estimate memory, choose hardware, and tune inference settings before deploying locally.
As Mixture-of-Experts (MoE) architectures become the mainstream approach to scaling large language models, total parameter counts keep growing while each inference pass activates only a small subset. This sparse activation is what makes running ultra-large models on local hardware conceivable at all. Still, model weight files often exceed a terabyte, putting them out of reach for most developers. This article uses an open-source MoE model with roughly 744B total parameters and about 40B active parameters as an example to explain what dynamic quantization can and cannot do, and how to budget memory, choose hardware, and adjust inference settings before deploying locally.
1. Dynamic Quantization Is Not Simply “Fewer Bits”
Quantization stores weights with fewer bits to shrink file size. Dynamic quantization goes further: different layers or tensors use different bit-widths, and more important layers may retain higher precision. As a result, a “1-bit” or “2-bit” label on a release page usually reflects the dominant bit-width or the version naming, not the exact number of bits occupied by every single weight.
The figures from the source material are: the original file is about 1.51TB, the 1-bit version about 217GB, and the 2-bit version about 239GB. The two quantized versions differ by only about 10%, far less than the 2x gap that a pure bit-width conversion would imply. This shows that version names do not map one-to-one to the actual average bits per weight. Rely on the file sizes and average bits-per-weight figures published in the model card, and do not estimate memory requirements from the version name alone.
2. Calculate Your Memory Budget First
Running a model locally requires more memory than the weight file itself. Total demand roughly consists of four parts: the weight file, the KV cache, compute buffers, and the overhead of the inference framework and operating system. The KV cache grows with context length—the longer the context, the more memory it consumes.
Reserve at least 10% to 20% of headroom. Without enough margin, the system may page constantly, generation speed can collapse, and in severe cases the process will be killed.
Higher-precision versions scale roughly in proportion to bit-width. For example, an 8-bit version is about twice the file size of a 4-bit version, and memory requirements rise accordingly.
3. Three Hardware Approaches
1. Unified-Memory Workstation
CPU and GPU share the same memory pool, eliminating the cost of copying data between them. The ceiling of this approach is determined by both total memory capacity and memory bandwidth. A machine with 256GB of unified memory may fit the 2-bit version, but with limited room to spare. Long contexts or other programs running concurrently can easily exhaust it—whether it runs stably has to be verified through actual testing.
2. Discrete GPU Plus Large System Memory
When VRAM is small (e.g., 24GB), MoE offloading can be used. It keeps infrequently used expert weights in system memory and loads only the currently routed experts onto the GPU for computation—trading time for space. Both system memory bandwidth and PCIe bus bandwidth are far below VRAM bandwidth, so when experts are frequently swapped in and out, generation speed drops noticeably. The real-world effect depends on expert hit rate, model architecture, and memory bandwidth; trust actual benchmark results.
3. Cloud Deployment
When local memory is insufficient, you can use large-memory instances or multi-GPU instances on public clouds. Model weights can be stored in object storage and pulled on demand at deployment time, which simplifies version management and distribution. Cloud solutions are billed by usage duration and suit scenarios with unstable workloads or a need for rapid scaling.
4. Deployment Workflow
The following workflow uses the open-source inference engine llama.cpp as an example. For specific commands and parameters, refer to the official documentation of the version you are using.
