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.

8 to 10 min read • View on GitHub • More from randyap8-wq

A wide workstation scene shows an NVMe drive feeding a rack of expert drawers through thin inked streams. A small routing arm opens only a few drawers while the rest stay sealed, making the storage device feel like an active memory tier rather than a backup. The image explains MER’s central idea: SSD bandwidth can participate in inference when routing is selective enough.
MER’s thesis is visible in one frame: the SSD is not just storage, it is part of the execution path.
Key Takeaways

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.

A close-up of a three-tier cache stack shows a hot expert at the front, a warm RAM layer in the middle, and an SSD layer underneath. One expert is being evicted downward while another is being promoted upward, and a small predictive loader nudges the next likely expert into place. The image explains how MER turns access traces into residency decisions.
MER is not just streaming from disk. It is continuously deciding which experts deserve to stay hot.

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.

Routing decisions become cache decisions, and cache decisions become I/O decisions. That loop is MER’s core systems insight.

SystemMemory strategyStorage pathRouting awareTarget hardwareMain trade-off
MERSSD, RAM, and VRAM are treated as explicit tiers for expertsDirect `io_uring` reads with `O_DIRECT` into aligned buffersYes, routing shapes fetch and residencyWorkstations and sovereign boxes with limited VRAMMore moving parts, but the I/O policy matches MoE locality
llama.cppWeights commonly live in RAM or are paged by the OS`mmap` plus generic page cache behaviorNo, it relies on the kernel’s general-purpose heuristicsBroad local CPU and GPU setupsSimple and portable, but not expert-locality aware
vLLMGPU-centric serving with paging optimized for attention stateResident GPU memory first, host memory as supportNot for expert streamingHigh-throughput GPU serversExcellent serving stack, but not built around SSD-backed experts
PowerInferPredictive low-memory inferenceSelective loading based on activation patternsPartially, through predictor logicHybrid CPU/GPU setupsGood at reducing memory pressure, but different bottleneck focus
DeepSpeed-InferenceOffload and partitioning across memory tiersNVMe-backed offload in an enterprise stackIndirectly, through partitioning policyDistributed enterprise environmentsPowerful, 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.

randyap8-wq, Maintainer/Author · Micro-Expert-Router GitHub README

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.

randyap8-wq, Maintainer/Author · LLM Inference from SSD

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.

ProjectBest atWhat MER changesWhy it matters
llama.cppLocal inference simplicityMER adds router-aware expert streaming instead of generic pagingBetter fit when experts are too large to keep resident
vLLMHigh-throughput GPU servingMER shifts the bottleneck from GPU memory to NVMe localityUseful on hardware that is compute-rich but memory-constrained
PowerInferPredictive selective loadingMER ties prediction to MoE routing and expert residencyThe routing signal becomes a storage policy
DeepSpeed-InferenceScaled offload in enterprise stacksMER keeps the stack small and Rust-nativeLower 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.