Micro-Expert-Router-SSD-Streamed-MoE-MER: MER: The MoE Engine That Treats NVMe SSDs Like VRAM
A Rust inference engine that streams experts on demand, bypasses the OS page cache, and turns routing locality into a first-class performance strategy.
- MER’s real innovation is not Rust or MoE, but a storage hierarchy that lets SSD latency become part of the inference plan.
- Routing is the key systems signal, because the experts a token needs now determine what gets fetched, promoted, or evicted next.
- The engine replaces generic OS paging with router-aware streaming, which makes cache policy an inference problem instead of a kernel accident.
- MER is most compelling on limited-memory hardware where frontier MoE models are still worth running, but not worth fully resident weights.
The disk is not the bottleneck anymore.
MER starts with a blunt reversal: expert weights do not need to live in VRAM all the time. If routing is selective, only a small slice of the model is hot on each token, so the SSD can serve as a usable backing tier instead of a dead archive. That turns storage bandwidth into a model-serving constraint the engine can actually manage.
That is why the project feels different from a standard mmap-based loader. MER does not ask the kernel to guess what might be needed next. It treats expert residency as a first-class runtime decision, then builds the I/O path around that decision.
Why MoE makes this possible
MoE is the enabling trick. A dense model activates almost everything for every token, which makes offload a blunt instrument. In an MoE model, routing chooses a small subset of experts, so access is naturally sparse and uneven. That sparsity is what lets MER exploit locality instead of fighting it.
| System | Memory strategy | Storage path | Routing aware | Target hardware | Main trade-off |
|---|---|---|---|---|---|
| MER | SSD, RAM, and VRAM are treated as explicit tiers for experts | Direct `io_uring` reads with `O_DIRECT` into aligned buffers | Yes, routing shapes fetch and residency | Workstations and sovereign boxes with limited VRAM | More moving parts, but the I/O policy matches MoE locality |
| llama.cpp | Weights commonly live in RAM or are paged by the OS | `mmap` plus generic page cache behavior | No, it relies on the kernel’s general-purpose heuristics | Broad local CPU and GPU setups | Simple and portable, but not expert-locality aware |
| vLLM | GPU-centric serving with paging optimized for attention state | Resident GPU memory first, host memory as support | Not for expert streaming | High-throughput GPU servers | Excellent serving stack, but not built around SSD-backed experts |
| PowerInfer | Predictive low-memory inference | Selective loading based on activation patterns | Partially, through predictor logic | Hybrid CPU/GPU setups | Good at reducing memory pressure, but different bottleneck focus |
| DeepSpeed-Inference | Offload and partitioning across memory tiers | NVMe-backed offload in an enterprise stack | Indirectly, through partitioning policy | Distributed enterprise environments | Powerful, but heavier and more Python/PyTorch oriented |
Inside the streaming pipeline
The runtime rhythm is simple to describe and hard to build well. `Engine::generate` routes a token, checks the cache, and on a miss schedules an asynchronous fetch. If the expert is cold, MER reads it from SSD into aligned memory with `io_uring`, then reuses it until the heat score drops.
loop {
let expert_ids = router.select_top_k(&token);
for expert_id in expert_ids {
if let Some(expert) = cache.get(expert_id) {
execute(expert, token);
continue;
}
let expert = storage.fetch_expert_async(expert_id).await?;
cache.insert(expert_id, expert.clone());
execute(expert, token);
}
cache.update_heat(token);
}
The important detail is not just that the engine fetches from disk. It bypasses the OS page cache, which avoids double buffering and prevents the kernel from making generic assumptions about what should stay hot. MER wants expert-aware I/O, not just faster I/O.
Why Rust matters here
Micro-Expert-Router (MER) is a Rust execution engine for Mixture-of-Experts models that treats SSD as the backing store for expert weights and RAM/VRAM as cache tiers.
Rust is not the point, but it is the reason the point is survivable. MER needs direct control over buffers, alignment, concurrency, and I/O completion without losing the ability to evolve the codebase. That combination is hard to maintain in a language stack that leans on implicit memory behavior.
The repo uses low-level storage paths, fast synchronization primitives, and specialized compute kernels because the system only works if the plumbing stays honest. In that sense, Rust is a fit for the project’s real thesis: aggressive control without sloppy invariants.
What MER does better, and where it pays
The closest published prior art is Apple's LLM in a Flash paper, this is an attempt at an open source runnable implementation of that idea.
MER is not trying to be the broadest serving stack. It is narrower and more opinionated. That is a strength, because it optimizes for a very specific deployment shape: a machine with serious compute, limited resident memory, and fast NVMe storage.
Compared with llama.cpp, it is less generic and more locality-aware. Compared with vLLM, it is less cluster-oriented and more workstation-friendly. Compared with DeepSpeed-Inference, it is lighter, more storage-native, and less tied to the enterprise Python world. Compared with PowerInfer, it is more explicitly about SSD-backed expert residency than activation prediction alone.
| Project | Best at | What MER changes | Why it matters |
|---|---|---|---|
| llama.cpp | Local inference simplicity | MER adds router-aware expert streaming instead of generic paging | Better fit when experts are too large to keep resident |
| vLLM | High-throughput GPU serving | MER shifts the bottleneck from GPU memory to NVMe locality | Useful on hardware that is compute-rich but memory-constrained |
| PowerInfer | Predictive selective loading | MER ties prediction to MoE routing and expert residency | The routing signal becomes a storage policy |
| DeepSpeed-Inference | Scaled offload in enterprise stacks | MER keeps the stack small and Rust-native | Lower overhead for sovereign or workstation deployments |
The bet MER is making
The bet is that routing locality is predictable enough to exploit, and SSD latency is hideable enough to tolerate. If that is true, MoE deployment stops being a binary choice between all-in-memory and impossible. It becomes a residency problem, with the disk inside the loop instead of outside it.
That is a real systems idea, not just a clever implementation. MER argues that the next frontier for local MoE inference is not another bigger cache. It is a smarter contract between router, cache, and storage.





