You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MoE expert paging: load only the needed expert on demand, page rest from HF cache #433
MoE models have N experts but only 1-2 activate per token. On memory-constrained devices (MacBook Air 8-16GB), we don't need ALL experts resident. Load only the expert needed for the current task, page others from HuggingFace cache or disk.
Architecture
Resident (always loaded):
- Router/gate network (~100MB) — decides which expert to activate
- Shared attention layers (~2GB) — used by all experts
- Active expert FFN (~1-2GB) — the one currently needed
Paged (on disk/HF cache, loaded on demand):
- Other N-1 expert FFNs (~1-2GB each)
- Loaded when task domain changes (code → reasoning → creative)
- LRU eviction when memory full
Three-tier storage model — HF as the storage medium:
VRAM (L1): Active expert + shared attention + LoRA ~4-6GB, microsecond access
Disk (L2): Recently used experts + adapters ~20-50GB budget, millisecond access
HF (L3): All published experts + adapters Infinite, seconds on broadband
Local disk gets a configurable cache budget (default 50GB). LRU eviction keeps it within budget. Haven't used an expert in a week? Evict to L3 (still on HF). Need it? Fetch in ~30s on broadband.
This means:
500GB MacBook doesn't fill up with models
Each install only stores what it actually uses
New experts are a continuum pull away, not a manual download
The -cont suffix models on HF ARE the storage medium
LoRA adapters, experts, base models — all the same cache hierarchy
HF does the heavy lifting on storage and bandwidth. We do the smart caching and paging.
Key insight from compaction analysis: Qwen3.5-35B-A3B has 256 experts, only 8 active per token (3.1% utilization). If we upload each expert as a separate safetensor to HuggingFace, we can page individual experts on demand.
The architecture:
Keep top ~48 experts locally (covers 95%+ of domain tasks) = ~8GB
Upload all 256 experts to HuggingFace as individual files
When a token routes to a non-resident expert, page it from HF
Cache recently-paged experts on local disk (L2)
LRU eviction from VRAM when memory pressure hits
This means: The compacted model runs at full speed for common tasks. Rare domain requests trigger a cold expert load (~seconds first time, ~100ms from disk cache after). The user gets a 8GB local model that can grow to 67GB on demand by pulling from HF.
Combined with Grid: Node A has coding experts resident, Node B has science experts. Cross-node routing means the mesh collectively has ALL experts hot without any single node needing all of them.
This is virtual memory for AI models. HuggingFace is the swap partition.
Activity
joelteply commentedon Mar 25, 2026
Three-tier storage model — HF as the storage medium:
Local disk gets a configurable cache budget (default 50GB). LRU eviction keeps it within budget. Haven't used an expert in a week? Evict to L3 (still on HF). Need it? Fetch in ~30s on broadband.
This means:
continuum pullaway, not a manual download-contsuffix models on HF ARE the storage mediumHF does the heavy lifting on storage and bandwidth. We do the smart caching and paging.
joelteply commentedon Mar 25, 2026
Publishing strategy for external users (OpenCode, VSCode, generic):
Continuum trains full MoE models with all experts. Then publishes trimmed variants:
The system builds these automatically using our naming convention:
-contsuffix = trained for Continuum's tool system-cont= generic, works in any IDE/toolThe pipeline:
adapter/publishpushes to HF withcontinuum:*tags-contvariant with tool-system training baked inOur nomenclature becomes the standard for MoE expert-trimmed models. Nobody else is doing this.
README: hyperlink key terms to architecture docs
README: hyperlink key terms to architecture docs (#475)
joelteply commentedon Mar 26, 2026
Key insight from compaction analysis: Qwen3.5-35B-A3B has 256 experts, only 8 active per token (3.1% utilization). If we upload each expert as a separate safetensor to HuggingFace, we can page individual experts on demand.
The architecture:
This means: The compacted model runs at full speed for common tasks. Rare domain requests trigger a cold expert load (~seconds first time, ~100ms from disk cache after). The user gets a 8GB local model that can grow to 67GB on demand by pulling from HF.
Combined with Grid: Node A has coding experts resident, Node B has science experts. Cross-node routing means the mesh collectively has ALL experts hot without any single node needing all of them.
This is virtual memory for AI models. HuggingFace is the swap partition.
joelteply commentedon Mar 30, 2026
MoE expert paging concept proven with 35B-A3B compacted model (16 of 128 experts). Dynamic paging is a grid feature, tracked in grid roadmap.
docs(planning): ACTIVITIES-CATALOG — parameterized recipes design + f…
feat(experience): parameterized recipes — typed param decls with easy…
feat(benchmark): shipped recipe declares its targeting params + dispa…
docs(architecture): context is a capability axis — the governor learn…
fix(benchmark+cognition): the run pulses, empty completions fault, be…
merge: canary into fix/room-purpose-reads-the-recipe-binding
docs(architecture): how an activity declares its judge — three tiers,…
KV cache as a shared base layer — stop paying for repetition between …
fix(activity): activity/spawn's params help shows a value example, an…
fix(activity): a spawn param given as a schema is named as one; type …