[tooling] · · 4 min read
ramgod runs MoE LLMs larger than RAM on Mac 3-5x faster than llama.cpp
A new tool streams Mixture-of-Experts weights from SSD to RAM on Apple Silicon, enabling 20B+ parameter models to run on 8GB Macs without quality loss from aggressive quantization.
By ByteBulletin Editor · Editor
The Problem with Large MoE Models on Macs
Running large language models locally on Apple Silicon has long been limited by RAM capacity. Mixture-of-Experts (MoE) models, which are highly efficient during inference because they only activate a subset of their parameters per token, are particularly affected. According to the GitHub repository for ramgod, standard tools like llama.cpp struggle when the model size exceeds available RAM. On an 8 GB M1 MacBook, llama.cpp cannot run gpt-oss-20b (11.6 GB) or Qwen3-30B-A3B (18.6 GB) with default settings. The usual workaround is to use aggressive quantization (2-3 bit), which fits the model in RAM but significantly degrades answer quality.
How ramgod Works
ramgod is a new tool that hooks into llama.cpp to manage how MoE expert weights are loaded from the SSD into RAM. Instead of relying on the operating system's memory-mapping, which results in small, inefficient page faults (reading at ~0.4 GB/s), ramgod intercepts the per-layer router output. It predicts which experts will be needed and performs large, parallel reads from the SSD (up to 4.3 GB/s), loading the weights into RAM just in time for computation.
The tool does not replace llama.cpp's math; it only optimizes the data movement. As stated in the project documentation, "llama.cpp still does all the math, ramgod only decides when and how the weights get from the SSD into RAM." This approach allows the full 4-bit model to run as published, preserving quality, even when the model is larger than the machine's RAM.
Performance Benchmarks
The project provides A/B testing results comparing ramgod against llama.cpp on an 8 GB M1 Mac. The benchmarks show significant speedups for models that exceed RAM capacity:
- gpt-oss-20b (11.6 GB): ramgod achieves 3.7 tokens/s, which is 5.1x faster than llama.cpp.
- Qwen3-30B-A3B (18.6 GB): ramgod achieves 3.5 tokens/s, which is 3.2x faster than llama.cpp.
These tests were conducted with the model larger than the available RAM, a scenario where llama.cpp is effectively non-functional or extremely slow due to page faults. The authors note that absolute speed can vary by ±25% depending on free RAM, but the relative speedup remains consistent across multiple runs.
Technical Implementation
ramgod works by hooking into llama.cpp's ffn_moe_topk tensor, which indicates which experts are selected for each token. Before each layer's experts run, ramgod prefetches the required weights from the SSD. This eliminates the latency associated with random page faults. The project documentation details several failed attempts, including LFU steering and mlock pinning, which did not improve performance. The successful approach relies on large, sequential reads that leverage the SSD's higher throughput for bulk data transfer.
The tool requires an Apple Silicon Mac, Homebrew, and a MoE model in GGUF format. It is compatible with most llama.cpp MoE architectures that expose the necessary graph tensors. If a model is not supported, ramgod prints a warning. The project is licensed under PolyForm Noncommercial 1.0.0, meaning it is free for personal, hobby, research, and educational use, but commercial use requires a separate license.
Context and Alternatives
This approach is similar in spirit to Apple's "LLM in a Flash" and other research projects like PowerInfer and MoE-Infinity, which also focus on efficient MoE inference by managing weight loading. However, ramgod is specifically optimized for the Apple Silicon ecosystem and integrates directly with llama.cpp, making it accessible to developers already using that stack. For models that fit entirely in RAM or GPU memory, llama.cpp remains the faster option, as reading from SSD is inherently slower than accessing memory. ramgod is specifically designed for the edge case where the model is too large for RAM but the user refuses to sacrifice quality for a smaller quantization.
What It Means for Developers
For developers running local LLMs on Macs with limited RAM (8 GB or 16 GB), ramgod offers a new option. Instead of choosing between a model that fits but is low-precision, or a high-precision model that doesn't run, you can now run the high-precision model at a usable speed. This is particularly relevant for privacy-focused applications where data cannot be sent to the cloud.
To get the best performance, users should close memory-hungry applications like browsers or Docker to maximize free RAM for the expert cache. Keeping the Mac plugged in is also recommended, as Low Power Mode can halve the speed. The tool provides real-time stats on token speed and wait times, allowing users to monitor performance.
What to Watch
- Commercial Licensing: The PolyForm Noncommercial license restricts commercial use. Companies looking to integrate this into products will need to negotiate a commercial license with the author.
- Model Compatibility: Not all MoE models are supported. If a model's architecture does not expose the required tensors, ramgod will not work. Users should check the supported models list or test with their specific model.
- Performance Variability: Speeds can vary based on system load and free RAM. The benchmarks provided are medians from specific conditions, and real-world performance may differ.
- Future Updates: The project is actively developed, with a detailed engineering log in
docs/HANDOFF.md. Updates to llama.cpp may break compatibility if graph tensor names change, so users should pin their llama.cpp version if they encounter issues.
Get the signal, not the noise.
One short email when it matters. No recaps of recaps.
SHARE
RELATED

[models] ·
Baidu releases ERNIE-5.5-Flash-Base weights

[tooling] ·
LM Warden publishes leanprompt audit findings for 20+ open-source repos

[tooling] ·
Fleetlayer launches as control plane for multi-machine AI agents

[tooling] ·
Verfy launches security layer for AI coding agents

[tooling] ·
This week in AI dev tools: Anthropic IPOs amid safety and supply chain crises (Nov 16–22, 2026)

[tooling] ·
