In partnership with

Colibri (JustVugg/colibri, Apache 2.0, 17.9k stars) proves the opposite: a 744B-parameter model activates only ~40B parameters per token, and only ~11GB of those change from token to token. The rest is cold data. Colibri turns that observation into a runtime: a single C file, zero dependencies, that streams experts from disk as they are needed, learns which ones are hot, and pins them automatically. The result is a 744B model running on a 25GB laptop at 0.05–0.1 tok/s, a 6× RTX 5090 cluster at 5.8–6.8 tok/s, and everything in between, same engine, same int4 container, same router semantics regardless of where the expert answers from.

SnackOnAI Engineering | Senior AI Systems Researcher | Technical Deep Dive | July 29, 2026

What It Actually Does

Colibri runs GLM-5.2 (744B total parameters, 19,456 routed experts) on consumer hardware by implementing a three-tier memory hierarchy: VRAM for hot experts, RAM for warm experts, NVMe for cold experts. The dense part of the model (attention, shared experts, embeddings, ~17B parameters) stays resident in RAM at int4 (~9.9 GB). The 19,456 routed experts (~19 MB each at int4, ~370 GB total) live on disk and stream on demand via a per-layer LRU cache with a learned pinned hot-store.

The research paper in the inputs (arXiv:2605.11537, Iowa State University, May 2026) is the academic complement: it proves that MoE expert selection is predictable enough to prefetch with high accuracy using an SRU predictor, and that dynamically replicating overloaded experts achieves near-100% GPU utilization with up to 3x inference speedup on Switch-base-128 while preserving 90–95% of baseline accuracy. Colibri implements the same intuitions (predictive prefetch, learned hot-store) in production C code against a real 744B model.

Scope covered: the per-token execution path, the three-tier memory hierarchy, the PILOT lookahead prefetcher and its 71.6% one-layer-ahead routing predictability, the dual-SSD streaming strategy, MTP speculative decoding mechanics and the int8 head requirement, KV cache compression (57× smaller via MLA), and the MoE-MPMC paper's SRU predictor and expert replication approach. Excluded: the Tauri desktop shell, GLM-5.2's training architecture details, and the Apple Silicon Metal backend (experimental at time of writing).

The Architecture, Unpacked

GLM-5.2's 744B parameters break into two fundamentally different residency categories:

Caption: The five-step per-token path is the key design. ROUTE runs one layer ahead so PLACE has time to fetch the next expert before it is needed. The INVARIANT at the bottom is the correctness guarantee: the engine never silently changes precision to make a placement decision work.

The Code, Annotated

Snippet One: The Flags That Shape Performance

# Colibri runtime configuration — these env vars define the full memory placement
# Source: https://github.com/JustVugg/colibri/blob/main/docs/ENVIRONMENT.md

# ─── BASELINE: 25GB laptop, everything from disk ─────────────────────────
COLI_MODEL=/nvme/glm52_i4 ./coli chat
# Dense part loads into RAM (~9.9 GB). All 19,456 experts stream from disk.
# Result: 0.05–0.1 tok/s, TTFT 30–60s. Slow but correct.
# ← THIS is what "consumer machine" actually means in practice.

# ─── STEP 1: Enable async I/O overlap (nearly always a win) ──────────────
COLI_MODEL=/nvme/glm52_i4 PIPE=1 ./coli chat
# Async I/O pool loads missing experts while resident ones compute.
# The three matrices per expert are stored adjacent → one pread() per expert.
# ← THIS is the trick: single syscall per expert, not three.

# ─── STEP 2: Enable O_DIRECT (measure before committing) ─────────────────
COLI_MODEL=/nvme/glm52_i4 PIPE=1 DIRECT=1 ./coli chat
# O_DIRECT bypasses page cache. On NVMe with DRAM cache: +34% decode measured.
# On QLC/DRAM-less drives: neutral to negative. Measure; keep what pays.
# On Blackwell/Windows test: 4.25 → 9.69 GB/s in iobench.
# ← NOT a safe default. Drive-dependent. Always benchmark.

# ─── STEP 3: Enable router lookahead prefetch ─────────────────────────────
COLI_MODEL=/nvme/glm52_i4 PIPE=1 PILOT=1 ./coli chat
# Runs routing one layer ahead. Expert routing is 71.6% predictable
# one layer in advance — a measured number, not a claim.
# Mispredictions fall back to demand-load; correctness is never affected.
# ← THIS is the predictive prefetch from MoE-MPMC (arXiv:2605.11537) made real.

# ─── STEP 4: Dual-SSD streaming (if two NVMe drives available) ───────────
COLI_MODEL=/fast/glm52_i4 COLI_MODEL_MIRROR=/second/glm52_i4 PIPE=1 PILOT=1 ./coli chat
# Each expert routed to one drive by deterministic hash weighted by bandwidth.
# 9 GB/s primary + 3 GB/s mirror = 12 GB/s aggregate reads (~33% faster).
# Mirror validated at startup (size + safetensors header); partial mirror fine.
# ← The mirror is NEVER written to. .coli_usage stays on primary.

# ─── STEP 5: GPU expert tier (if RTX GPU available) ─────────────────────
COLI_MODEL=/nvme/glm52_i4 CUDA_EXPERT_GB=24 PIPE=1 PILOT=1 COLI_CUDA_PIPE=2 ./coli chat
# 24 GB VRAM fills with hottest experts. Residual stream stays on-device
# across layers (COLI_CUDA_PIPE=2). CPU expert loop runs uninterrupted.
# 6× RTX 5090 with full residency (CUDA_EXPERT_GB=auto PIN_GB=all):
# 5.8–6.8 tok/s, TTFT ~13s.
# ← Full GPU residency removes disk from the decode path entirely.

Caption: Each flag is a measurable speedup, not a configuration preference. The +34% from DIRECT=1 is measured on Blackwell hardware. The 71.6% PILOT predictability is measured on routing traces. The 5.8–6.8 tok/s on 6× RTX 5090 is from the experiment log.

Snippet Two: The MTP Speculative Head Trap

# The int8 MTP head requirement: the most important hardware detail in the docs
# Source: https://github.com/JustVugg/colibri/issues/8
#
# MTP (Multi-Token Prediction): GLM-5.2's native speculative decoding head
# drafts tokens that the main model verifies in one batched forward pass.
# When it pays: 2.2–2.8 tokens per forward pass.
# When it doesn't: use DRAFT=0.
#
# THE TRAP: the original Hugging Face mirror ships int4 MTP heads.
# int4 heads → 0–4% draft acceptance rate (functionally useless).
# int8 heads → normal acceptance rate.
#
# How to check your model:
import os, glob

model_path = "/nvme/glm52_i4"
mtp_files = glob.glob(os.path.join(model_path, "out-mtp-*"))

for f in mtp_files:
    size_bytes = os.path.getsize(f)
    size_gb = size_bytes / (1024**3)
    print(f"{os.path.basename(f)}: {size_bytes:,} bytes ({size_gb:.2f} GB)")

# int8 MTP (CORRECT) file sizes:
#   out-mtp-0: 3,527,131,672 bytes (3.28 GB)
#   out-mtp-1: 5,366,238,584 bytes (4.99 GB)
#   out-mtp-2: 1,065,950,496 bytes (0.99 GB)
#
# int4 MTP (WRONG, from original mirror):
#   Sizes will be roughly half the above values.
#
# Use the correct mirror:
# https://huggingface.co/mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp
#
# ← THIS is the trick: the entire speculative decoding path (2.2–2.8 tok/fwd)
# disappears if you use the wrong quantization for the MTP head.
# There is no runtime warning. Acceptance just silently stays at 0–4%.

# Two additional hard-won rules for MTP correctness (from issue #163):
# 1. SPEC_PIN=1: pins draft and verify to the same kernel family.
#    Without this, draft and verify compute different functions → spurious
#    acceptance rejections that look like low accuracy.
# 2. GRAMMAR=file.gbnf: grammar-forced drafts add ~free acceptance on
#    constrained JSON output. If you are generating structured output,
#    this is the highest-ROI speculative decoding optimization available.

spec_config = {
    "SPEC_PIN": "1",          # same kernel family for draft + verify
    "DRAFT": "1",             # enable speculation (set to 0 to disable)
    # "GRAMMAR": "schema.gbnf"  # enable for structured JSON output
}

Caption: The int4 MTP head failure is silent. There is no error. Acceptance rate just stays near zero. The file size check is the only way to verify before running. This is documented in issue #8 with the full forensic history — one of the most valuable issues in the repo.

It In Action: End-to-End From Cold Start to First Token

Input: Single user query on a 128 GB CPU-only desktop (no GPU). GLM-5.2 int4 with int8 MTP heads, PIPE=1, PILOT=1, model on fast NVMe.

Step 1: Engine startup

$ COLI_MODEL=/nvme/glm52_i4 PIPE=1 PILOT=1 ./coli plan
Planning VRAM/RAM/disk placement...
  Dense part:     9.9 GB → RAM (resident)
  Expert cache:   128 GB RAM available
    Pinned hot:   ~45 GB (from .coli_usage, previous runs)
    LRU buffer:   ~60 GB (dynamic per-layer)
    Disk cold:    remaining ~265 GB streamed on demand
  MTP head:       int8 ✓ (3.28 GB + 4.99 GB + 0.99 GB)
  PILOT:          enabled (one-layer lookahead, 71.6% predictability)
  PIPE:           enabled (async I/O pool, experts read in parallel)

Step 2: First query (cold start, no .coli_usage history)

$ COLI_MODEL=/nvme/glm52_i4 PIPE=1 PILOT=1 ./coli chat
Enter your question: Explain mixture-of-experts routing in two sentences.

[TTFT: ~90s — cold start, no pinned experts, all 75 MoE layers stream from disk]
[Each of 75 MoE layers activates top-8 of 256 experts = ~600 unique experts/token]
[First run writes expert heat to .coli_usage]

Step 3: Same query, warm (after one run)

[TTFT: ~18s — ~45 GB of hot experts now pinned in RAM from .coli_usage]
[Decode: ~1.8 tok/s — community benchmark on 128 GB desktop (#200)]
[MTP speculation: 2.1 tokens/forward when draft accepted (~35% on prose)]

Step 4: Output (abbreviated)

Agent: Mixture-of-Experts routing selects a small subset of specialized
       subnetworks (experts) for each token using a learned gating function,
       so the model's total parameters vastly exceed what is computed per token.
       In GLM-5.2, each of 75 MoE layers activates 8 of 256 experts, meaning
       only ~40B of 744B parameters participate in any single forward pass.

[decode time: 8.2s for 47 tokens | 5.7 tok/s on warm 128 GB desktop]
[.coli_usage updated: routing heat from this query merged into pin set]

The numbers across hardware classes:

Hardware

Configuration

Decode

TTFT

25 GB laptop

CPU-only, disk streaming

0.05–0.1 tok/s

30–60s

128 GB CPU desktop

PIPE=1, PILOT=1, warm

~1.8 tok/s

~18s

Single RTX 5070 Ti

CUDA_EXPERT_GB=16, PIPE=1

1.07 tok/s

~20s

6× RTX 5090

Full VRAM residency, COLI_CUDA_PIPE=2

5.8–6.8 tok/s

~13s

Why This Design Works (and What It Trades Away)

The invariant is the design. Colibri's README states it explicitly and the codebase enforces it: "Insufficient fast memory may reduce speed, but the default policy never silently changes model precision or router semantics." This means the model answer from a 25 GB laptop running experts from disk is identical to the model answer from a 6× RTX 5090 with full VRAM residency. Only latency changes. Not quality. Not routing.

This is a hard constraint to maintain. It requires that every tier in the memory hierarchy serves the same weight format (int4), that the router never sees different inputs based on placement decisions, and that KV cache semantics are preserved across restarts. The KV cache compression (MLA attention, 576 floats per token instead of 32,768, a 57× reduction) and its persistence across restarts (.coli_kv) mean a conversation can resume exactly where it left off, byte-identical to an uninterrupted session.

What Colibri trades away is throughput predictability. The engine is disk-bound on most consumer machines. NVMe read bandwidth, not compute, determines decode speed when experts are cold. A system that hits a 9 GB/s NVMe drive decodes faster than one hitting a 2 GB/s DRAM-less QLC drive, on identical hardware. Teams building latency-sensitive applications on Colibri need to measure their specific storage hardware, not just their GPU.

The learning cache (.coli_usage, updated every turn) is the mechanism that converts a slow first run into a fast steady state. But it also means that workload diversity hurts performance. A chatbot serving 100 different topic domains will have a more diffuse routing heat distribution than a coding assistant that routes heavily to the same subset of experts. The same model on the same hardware can decode at 1.8 tok/s for one workload and 0.6 tok/s for another, depending entirely on expert cache temperature.

Technical Moats

The expert atlas (19,456 experts characterized by topic affinity) is the moat nobody is discussing. The Brain and Atlas visualizations in Colibri's dashboard are not cosmetic. They represent a completed measurement campaign across all 19,456 experts in GLM-5.2, identifying which experts specialize in poetry, law, Chinese, SQL, mathematics, and other domains. This measurement (issue #175 in the repo, "measured expert atlas") is the foundation for the intelligent hot-store: rather than pinning randomly hot experts, a topic-aware workload can pin the expert cluster aligned to its domain. Reproducing this for a different MoE model requires running the entire measurement campaign, which requires the model weights, compute time, and the measurement infrastructure.

The MoE-MPMC paper's insight validates Colibri's approach from a different direction. The paper demonstrates that switch-base-128 with 1.3% GPU utilization (baseline) jumps to 82% with dynamic expert replication. Colibri does not run on the same hardware class as the paper's experiments (A100 80 GB HPC cluster), but the underlying premise is identical: routing has measurable structure, structure enables prediction, and prediction enables pre-placement. The 71.6% one-layer-ahead routing predictability in Colibri is the same finding quantified differently.

The single-file C engine (c/glm.c) is a deliberate moat against complexity. The README states the project vision explicitly: "the engine is deliberately small enough that the next optimization can come from you." Every optimization in Colibri (PIPE, PILOT, DIRECT, dual-SSD, CUDA tier) came from community members measuring on their own hardware and contributing back. A 40,000-line Python codebase with external framework dependencies does not have this property. The C single-file design is what makes the contribution loop tight enough to actually function.

Contrarian Insights

Insight One: Colibri's 0.05–0.1 tok/s baseline is the honest number the community keeps hiding. Every MoE offloading project reports numbers from the best hardware configuration. Colibri's README leads with the 25 GB laptop baseline: 0.05–0.1 tok/s cold, the "proven floor where this project started." At that speed, a 200-token response takes 30–60 minutes. That is not a usable inference server. It is a research tool and a proof of concept. The useful deployment range starts at a 128 GB CPU desktop (~1.8 tok/s) and becomes genuinely practical at a single consumer GPU. Teams reading the headline "runs 744B on 25 GB" and expecting interactive latency are going to be disappointed. The hardware requirement for practical use is closer to 128 GB RAM or one RTX 5090, neither of which is a consumer machine in any meaningful sense.

Insight Two: The MoE-MPMC paper's 3x speedup headline conflates GPU-bound and disk-bound inference. The paper demonstrates 3x speedup on a single A100 80 GB GPU where all experts fit in VRAM. In that setting, the bottleneck is GPU utilization (1.3% baseline for switch-base-128 because most experts sit idle), and replication addresses it directly. Colibri's bottleneck on a 25 GB machine is NVMe bandwidth, not GPU utilization. Expert replication does not help when the constraint is I/O throughput, not compute parallelism. The paper and the runtime solve different problems in the MoE inference space, which makes them complementary rather than competitive, but the 3x speedup number does not translate to the disk-bound regime.

Surprising Takeaway

Colibri literally gets faster the more you use it, and that improvement persists across restarts. The .coli_usage file records routing heat from every conversation turn. On next startup, the engine reads this file and pins the hottest experts into RAM before any request arrives. A coding assistant that runs 50 sessions accumulates 50 sessions of routing evidence. Its warm startup is faster than its first run by an amount that depends on how consistent the workload has been. This is not a cache in the conventional sense. It is a learned placement policy that improves monotonically with usage. The analogy in the README is correct: it is a JIT compiler that compiles the hot paths, except the "hot paths" are expert weight locations, and the "compilation" is placement in the memory hierarchy. Workload-specific deployment (coding assistant, legal assistant, medical Q&A) gets measurably better inference performance over time than generic deployment, on identical hardware.

TL;DR For Engineers

  • Colibri (JustVugg/colibri, Apache 2.0, 17.9k stars, v1.1.0) runs GLM-5.2 (744B MoE) on any hardware with 25 GB RAM by streaming 19,456 routed experts (~19 MB each at int4) from a three-tier memory hierarchy: VRAM (hot) → RAM (warm, LRU + learned pin-store) → NVMe (cold). Dense part (~9.9 GB at int4) stays resident. The routing invariant: placement never changes model precision or router semantics.

  • Performance range: 0.05–0.1 tok/s on a 25 GB laptop (disk-bound, impractical for interactive use), ~1.8 tok/s on a 128 GB CPU desktop (warm), 5.8–6.8 tok/s on 6× RTX 5090 (full VRAM residency). Practical interactive use starts at ~128 GB RAM or a single GPU tier.

  • Critical: use mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp from Hugging Face. int4 MTP heads (original mirror) → 0–4% speculative draft acceptance. int8 MTP heads (correct) → 2.2–2.8 tokens/forward.

  • PILOT=1 (71.6% routing predictability one layer ahead), PIPE=1 (async I/O overlap), DIRECT=1 (+34% on NVMe with DRAM cache, drive-dependent), dual-SSD (additive bandwidth via deterministic expert hash). .coli_usage improves placement automatically with use.

  • The companion paper (arXiv:2605.11537) proves that SRU-based expert prediction achieves near-100% GPU utilization via dynamic replication on Switch-base-128, with 3x throughput improvement. Same principle, different regime: GPU-bound on A100 vs. disk-bound on NVMe. Both validate that routing structure is measurable and exploitable.

Explain It Like I'm New

Modern AI models have become so large that they no longer fit in the memory of any single machine. A 744-billion-parameter model, if you tried to load it all at once, would require roughly 370 gigabytes of fast GPU memory, which does not exist in any affordable hardware today.

But here is the thing: these large models are not actually using all 744 billion parameters on every word they generate. They use a technique called Mixture of Experts, where the model is divided into thousands of small specialist subnetworks. For each word, only a tiny fraction of those specialists (about 40 billion parameters) actually do any work. The rest sit idle.

Colibri exploits this fact. Instead of trying to hold the entire model in memory, it keeps only the always-active parts in RAM (about 10 gigabytes) and stores the specialist subnetworks on disk. When the model needs a specialist to process a word, Colibri reads it from disk, uses it, and then moves on. To make this fast, it learns from experience which specialists get used most often and keeps those in faster memory automatically.

The analogy is a librarian who, instead of memorizing an entire library, learns which books get checked out most often and keeps those on a small desk for quick access. The rest stay on shelves, but the librarian is fast enough that it rarely matters.

This matters because it moves the constraint from "how much memory you have" to "how fast your storage is." That is a much cheaper problem to solve, and it means genuinely frontier-scale models can run on hardware people actually own.

See It In Action

  • Colibri GitHub Repository and README Source: JustVugg | https://github.com/JustVugg/colibri The README contains the benchmark ladder diagram (hardware class vs. decode speed), the dual-SSD streaming setup, the learning cache explanation, and the repo layout. The most technically dense single-page reference for the engine.

  • Colibri Expert Atlas (Issue #175) Source: JustVugg/colibri GitHub | https://github.com/JustVugg/colibri/issues/175 The measurement campaign that characterizes all 19,456 experts by topic affinity. The Atlas page in the dashboard visualizes this as a 3D galaxy of 13,260 characterized experts clustering by domain. This is the empirical validation that routing structure exists and is exploitable.

  • Colibri Web Dashboard Demo Source: JustVugg/colibri GitHub | https://github.com/JustVugg/colibri/raw/main/docs/media/colibri-dashboard.png Screenshot of the live dashboard showing a 744B model at 4 tok/s, TTFT 1.6s on 6× RTX 5090. The VRAM/RAM/disk tier bar and live mini-brain visualization make the three-tier memory hierarchy directly observable.

  • Fast MoE Inference via Predictive Prefetching and Expert Replication (arXiv:2605.11537) Source: Iowa State University | https://arxiv.org/abs/2605.11537 The companion paper. Switch-base-8 GPU utilization: 7.5% (baseline) → 96% (MoE-MPMC). Switch-base-128: 1.3% → 82%. 3x throughput improvement on A100 80 GB. Proves that expert prediction enables replication that nearly eliminates GPU idle time.

  • MTP Int4 Head Issue (#8) Source: JustVugg/colibri GitHub | https://github.com/JustVugg/colibri/issues/8 Full forensic documentation of the int4 vs int8 MTP head issue. The most important issue in the repo for anyone downloading the model: explains why draft acceptance collapses to 0–4% and how to verify the correct model before running.

Community Conversation

  • JustVugg (Project Author) https://github.com/JustVugg/colibri The README's framing is the clearest statement of the project's intent: "frontier models should not be sealed inside datacenters." The project started on a 12-core laptop with 25 GB RAM. Community datapoints from real hardware drive every optimization. The engine is deliberately small enough that the next contribution can come from anyone.

  • Colibri Benchmark Experiments (6× RTX 5090 experiment log) https://github.com/JustVugg/colibri/blob/main/docs/experiments/glm52-6x5090-2026-07-12.md The July 12, 2026 experiment log documenting 5.8–6.8 tok/s and TTFT ~13s on 6× RTX 5090 with full expert residency. The full methodology, CUDA pipeline configuration, and per-layer timing breakdown are included.

  • Community Hardware Benchmarks (Issue #200, #273) https://github.com/JustVugg/colibri/issues/200 Issue #200 documents ~1.8 tok/s warm on a 128 GB CPU-only desktop. Issue #273 documents 1.07 tok/s via the GPU-resident pipeline on a single RTX 5070 Ti laptop-class box. These are the most practically relevant community datapoints for teams evaluating hardware requirements.

  • Z.ai GLM-5.2 Open Weights https://huggingface.co/THUDM/GLM-4 The model weights that make Colibri possible. Z.ai's decision to release GLM-5.2 under MIT is the enabling condition for the entire project. The Colibri README credits the open-weights ecosystem (Z.ai, Moonshot AI, Alibaba Qwen, MiniMax, Allen AI) directly.

The Engine Stays Small So the Next Optimization Can Come From You

Colibri is not a distributed inference server. It is not a production serving stack. It is a proof that a 744B-parameter model is a data staging problem, not a memory problem, and that staging can be learned, automated, and improved continuously through use.

The MoE-MPMC paper (arXiv:2605.11537) provides the theoretical foundation: routing is 71.6% predictable one layer ahead, expert activation is structurally biased toward a small fraction of the expert pool, and dynamic replication can push GPU utilization from 1.3% to 82%. Colibri implements those insights in a single C file with no external dependencies, on real hardware, against a real 744B model.

The community benchmark loop, where someone measures something on their hardware and opens an issue with numbers, then someone optimizes and measures again, is how this engine actually works. At 17.9k stars and 1.7k forks in a field where most inference projects require multi-GPU datacenter hardware to matter, that loop is working.

References

Colibri (Apache 2.0, 17.9k stars, v1.1.0) runs GLM-5.2 (744B MoE) on consumer hardware by staging 19,456 routed experts (~370 GB) across a three-tier VRAM/RAM/NVMe hierarchy, using a learned hot-store that improves automatically with use, a 71.6%-accurate one-layer-ahead router prefetch, and a correctness invariant that never changes model precision or router semantics regardless of placement tier. The companion paper (arXiv:2605.11537) proves the theoretical foundation: SRU-based expert prediction achieves near-100% GPU utilization via dynamic replication (3x throughput, 90–95% accuracy retention on Switch-base-128), validating that MoE routing structure is measurable and exploitable at scale.

Sponsored Ad

If you enjoy practical AI insights, check out SnackOnAI and support the newsletter by subscribing, sharing, and exploring our sponsored ad — it helps us keep building and delivering value 🚀

Cut Lead Review From Hours To Minutes

Sign up for a free trial of Attio, the agentic CRM.

Ask Attio to build a daily workflow that surfaces the deals that need your attention today, like anything with a stage change, a recent reply, or a new signal in the last 24 hours.

Review your pipeline in Claude, synced live from Attio via MCP.

That's it.

Recommended for you