Running 100B-Parameter Models on a Single 24GB GPU: Three Approaches Compared
This article explores how to run hundred-billion-parameter LLMs on consumer hardware with only 24GB of VRAM. It breaks down the VRAM math behind local deployment, then compares three practical routes: multi-GPU model parallelism, unified memory architectures, and software-based layered loading that exploits MoE sparse activation. Readers will learn how expert offloading, prefetching, and tiered quantization work, along with concrete hardware recommendations and selection guidance for different scenarios.
1. Where the Problem Starts: The VRAM Math
The first barrier to running LLMs locally is never compute—it’s VRAM.
A dense model with over 100B parameters, even quantized to 4-bit, typically weighs 50–60GB or more. For large MoE models in the hundreds of GB, 70–80GB after quantization is common. Meanwhile, flagship consumer GPUs offer only 24GB to 32GB of VRAM. A single card simply can’t hold the model—that’s the first arithmetic problem every local AI enthusiast faces.
Breaking it down, VRAM consumption has three main components:
- Model weights: the dominant share, determining whether the model fits at all;
- KV Cache: scales with context length and concurrency, and can balloon to tens of GB in long-context scenarios;
- Runtime overhead: activations, CUDA context, and framework overhead—typically a few GB of headroom.
In practice, the dense-model ceiling for a 24GB card is roughly 12B–14B parameters (4-bit quantized). To run hundred-billion-parameter models, you must choose between adding hardware and changing the software.
2. Path One: Stack More GPUs—Simple but Expensive
The most direct solution is model parallelism: shard the weights across multiple GPUs and keep everything in VRAM.
This is the fastest approach because VRAM bandwidth far exceeds system memory and SSDs. With weights resident in VRAM, token generation never waits on data transfers. To this day, throughput-focused deployments are essentially extensions of this path.
But the costs are obvious:
- Hardware costs climb steeply. Running a model quantized to 70–80GB requires at least three high-end GPUs, pushing total system cost well into five figures;
- Hidden supporting costs. Multi-GPU setups demand motherboards with PCIe lane bifurcation, kilowatt-class power supplies, and thermal/noise management—expenses often underestimated;
- Scaling limited by interconnect bandwidth. When GPUs communicate over PCIe, tensor parallelism introduces heavy cross-card traffic, and real-world speedups often fall far short of linear expectations.
This path always works—few can simply afford it. For enterprises, a more sensible alternative is using cloud-hosted model services or on-demand GPU compute, paying per use instead of making a heavy upfront investment. For individual users, lower-barrier options are worth seeking.
3. Path Two: Unified Memory—Trading Speed for Capacity
If VRAM is expensive, let system memory act as VRAM. This has been the hottest direction in local AI over the past year: CPU and GPU share a large memory pool of 128GB or more, and a palm-sized device can hold an entire large model.
This solves the “does it fit” problem, but two issues are unavoidable:
First, it’s slow. Fitting and running fast are different things. Unified memory bandwidth, while higher than traditional system memory, is still significantly lower than dedicated GDDR VRAM. LLM inference is a classic bandwidth-bound workload—every generated token requires reading all activated parameters. An order-of-magnitude bandwidth gap means an order-of-magnitude speed gap. The bigger the model, the longer each token takes.
Second, it’s no longer cheap either. High-capacity unified memory devices carry premium pricing, and with the current memory price cycle, costs have risen over the past year. What was positioned as an “affordable GPU alternative” has itself become a significant investment.
4. Path Three: Keep the Hardware, Let Software Solve It
Beyond the two routes promoted by hardware vendors, the engineering community has long explored a third path: exploit the statistical properties of the model architecture itself, spending scarce expensive resources only where they matter.
4.1 The Core Insight: Sparse Activation in MoE
Large models can be “compressed” into small VRAM because of a key property of MoE (Mixture of Experts) architectures: the total parameter count is huge, but each token activates only a small fraction of them.
A MoE model with over 100B total parameters often activates only a dozen or so billion per token—sometimes less. At any moment, the weights actually involved in computation may be under a tenth of the total. A natural idea follows:
- Keep frequently used “hot parameters” resident in VRAM—typically shared experts, attention layer weights, and frequently routed experts;
- Place infrequently used “cold parameters” in much cheaper system memory;
- Whatever memory can’t hold sinks further down to SSDs.
With this, a 24GB GPU plus a conventional amount of RAM can host models far larger than VRAM capacity. Most inference requests hit parameters already in VRAM at near-native speed; the minority hitting RAM or disk are slower, but the overall experience remains acceptable.
4.2 Key Design of the Layered Cache
These solutions essentially implement a multi-level cache inside the inference engine, with design principles closely resembling an OS page cache:
┌──────────────────────────────────────────────┐│ L1: VRAM (24GB) ← hot experts + attention │ nanosecond latency├──────────────────────────────────────────────┤│ L2: System RAM ← warm experts │ microsecond latency├──────────────────────────────────────────────┤│ L3: NVMe SSD ← cold experts │ ~100μs latency└──────────────────────────────────────────────┘
Core mechanisms include:
- Expert hit-rate statistics: track how often each expert is activated by the router, and assign weight residency tiers by hotness;
- Prefetching and async transfers: routing decisions are known while the current layer is still computing, so the experts needed by the next layer can be moved to VRAM asynchronously via DMA, hiding transfer latency;
- Tiered quantization: hot parameters in VRAM keep higher precision, while cold parameters offloaded to RAM/SSD use lower precision, further reducing transfer volume;
- KV Cache management: in long-context scenarios, use paged management or compression for KV Cache so it doesn’t crowd out weight space.
A simplified pseudocode illustration:
# Core logic of layered MoE loading (illustrative)class LayeredMoE:def __init__(self, experts, vram_budget):self.hot = load_top_experts(experts, by="hit_rate",budget=vram_budget) # resident in VRAMself.warm = pin_in_ram(experts - self.hot) # resident in RAMself.cold = mmap_from_ssd(experts - self.hot - self.warm)def forward(self, x, router):picked = router(x) # each token activates only a few expertsfor e in picked:if e in self.hot:yield self.hot[e](x) # served directly from VRAM, fastestelse:yield prefetch_and_run(e, x) # compute after async prefetch
4.3 The Costs of This Path
Layered loading is no free lunch. Three limitations deserve honest acknowledgment:
- Unpredictable tail latency: when routing hits cold parameters, that token generates noticeably slower, producing uneven speeds;
- Architecture dependence: the approach relies heavily on MoE sparse activation and is largely ineffective for dense models—dense models read all weights per token, so layering only adds constant transfer overhead;
- High engineering complexity: it requires deep framework support for weight paging, async prefetching, and VRAM pool management, making DIY implementation difficult. Fortunately, mainstream open-source inference ecosystems already offer reusable layered loading and CPU offload capabilities. Alternatively, you can call cloud-based inference services and delegate resource scheduling to the platform.
5. Selection Advice for Readers
Combining all three routes, here’s a simple decision framework by budget and need:
| Scenario | Recommended Route | Key Considerations |
|---|---|---|
| High-concurrency, low-latency production | Cloud GPU resources / multi-GPU servers | Throughput, stability, cost accounting |
| Running MoE models locally as an individual | 24GB GPU + layered loading | 64GB+ RAM recommended; choose a high-performance SSD |
| Long context, multi-turn dialogue | Watch KV Cache overhead | Longer context means more VRAM pressure |
| Local deployment of dense large models | Essentially infeasible; use cloud APIs | Layered loading yields minimal benefit for dense models |
Practical tips for actual deployment:
- Check the activated parameter count first, not the total. Activation count determines the floor of VRAM pressure;
- Set quantization precision in tiers: attention layers are more precision-sensitive and should retain higher precision; expert FFN layers tolerate aggressive quantization;
- Reserve KV Cache space: don’t fill VRAM entirely with weights—leave at least 20%–30% for context cache;
- Watch memory price cycles: if your setup depends on large system RAM, timing your hardware purchase matters as much as the selection itself;
- Prepare fallbacks for latency-sensitive workloads: local layered setups suit personal experimentation and low-frequency use; production environments should rely on managed cloud inference services for elasticity and stability.
6. Final Thoughts
Looking back, the cost dilemma of running hundred-billion-parameter models locally is essentially a mismatch between “the price gradient of storage media” and “the actual usage frequency of model parameters.” Stacking GPUs pays to erase the mismatch; unified memory trades bandwidth for space; and layered loading uses software intelligence—hit-rate statistics, async prefetching, sparse activation—to approach the ideal of “paying only for the small fraction of parameters you actually use.”
We can’t change hardware prices in the short term, but software-level optimization is far from exhausted. As MoE architectures become mainstream and inference frameworks mature in heterogeneous layered support, “running a 100B model on a single 24GB GPU” is evolving from a geek toy into an engineering practice anyone can reproduce. And where local compute genuinely falls short, handing inference to elastic cloud resources remains the safest fallback answer.
