Skip to content
Doezly AI
Go back

Janas: Stream MoE Experts From SSD to Run LLMs Bigger Than Your RAM

Edit page

Janas enables inference on Mixture-of-Experts (MoE) language models that are larger than available system RAM by streaming only the experts needed for each token from SSD, rather than requiring the entire model to be memory-resident.

The Core Problem It Solves

Modern MoE models (Mixtral, DeepSeek-MoE, Qwen-MoE, etc.) activate only a small subset of their total experts per forward pass — often 2 out of 8, or 8 out of 128. Despite this sparse activation, traditional inference stacks (llama.cpp, vLLM, Transformers) still load every expert into RAM or VRAM because they can’t predict which experts will be needed until runtime. This means a 140B-parameter MoE model with only ~20B active parameters per token still demands RAM sized for the full 140B.

Janas breaks this assumption: it keeps a routing/gating layer resident in memory, and lazily fetches only the selected experts from SSD for each layer, discarding or caching them based on an LRU-style policy.

How It Works

  1. Router stays hot. The gating network (tiny relative to total params) is always loaded in RAM.
  2. Experts stay cold. Expert weights live on SSD in a memory-mappable format.
  3. On-demand streaming. For each token/layer, Janas resolves the router’s top-k expert indices and pages in just those expert weights.
  4. Caching layer. Frequently-activated experts are cached in RAM/VRAM to avoid repeated disk reads, improving throughput on repetitive prompts.
# Example: running a 100B+ MoE model with 32GB RAM via Janas
janas serve \
  --model deepseek-moe-100b-ssd \
  --ram-budget 28GB \
  --expert-cache lru \
  --ssd-path /mnt/nvme/models/deepseek-moe

# Output
[janas] router loaded (1.2GB, resident)
[janas] 128 experts detected, streaming from SSD
[janas] cache hit rate after 500 tokens: 74%
[janas] avg tokens/sec: 8.3 (NVMe Gen4, cache warm)

Performance Trade-offs

SetupRAM RequiredTokens/secNotes
Full in-RAM (traditional)~280GB35–50Needs server-grade hardware
Janas, cold cache32GB2–4First-token latency penalty per new expert
Janas, warm cache (repetitive prompts)32GB8–12Benefits from expert locality
Janas, NVMe Gen4 + GPU offload hybrid32GB + 12GB VRAM12–18Best observed configuration

The core trade-off: SSD streaming introduces I/O latency that CPU/GPU-bound inference doesn’t have, so throughput depends heavily on NVMe read speed, expert cache hit rate, and prompt locality (how often the same experts get reused across tokens).

Why This Matters

Practical Considerations

Bottom Line

Janas trades inference speed for the ability to run MoE LLMs that physically don’t fit in RAM, using SSD as a slow-but-functional extension of memory — a meaningful unlock for local, budget-constrained experimentation with frontier-scale sparse models.


Edit page
Share this post:

Previous Post
AI Models Can Provably Hide Arbitrary Capabilities From Evaluators
Next Post
Character.ai Files for Chapter 11 Bankruptcy; Disney Emerges as Lead Bidder