Status: work-in-progress research. Numbers here are PRELIMINARY and several parts are unvalidated. This repository is a research artifact, not a product. Read the caveats section before quoting any figure.
REAP-LOOP is a reversible gate-bias that live-calibrates the expert working-set of a Mixture-of-Experts (MoE) model during the session itself.
Instead of pruning a MoE offline for a fixed domain, REAP-LOOP:
K0 — no experts masked), so the very first tokens run at full quality.Because the working-set is learned from the live session, REAP-LOOP adapts to any task. It is not domain-pretrained and it does not require a fine-tune. A catalogue of pre-learned working-sets (per output-type) is an optional pre-warm — a way to skip the warm-up cost on a familiar workload — never a prerequisite.
The direction this points at is PACE — a Perceptive Adaptive Control Engine: a self-calibrating controller inside the inference engine:
keep-level = f(routing-drift). Drift low → tighten; drift rising → widen proportionally. Dynamic MoE
sparsification framed as a control problem, with the router itself as the drift sensor.
REAP-LOOP is built on top of ds4 / DwarfStar by Salvatore Sanfilippo (antirez) — the MoE-streaming inference engine is the foundation this work stands on. ds4/DwarfStar is MIT-licensed; all credit for the underlying engine, the SSD/host-side expert streaming, and the CUDA/Metal MoE paths belongs to it.
Everything in patches/ is a set of diffs against ds4 — this project does not reimplement the engine,
it extends it. A verbatim copy of the upstream README and the relevant paper are kept under
docs/references/ for attribution and context.
docs/SPEX_spec.md,
docs/SPEX_LOOP.md, and src/msc/spex/.| Path | What |
|---|---|
patches/ds4/ | Diffs against ds4/DwarfStar: SPEX prefetch stages, routing/hidden trace capture, MTP streaming, the bulk page-in path, plus a small C predictor (ds4_spex_predict.{c,h}). |
src/msc/ | Research code: spex/ (predictor + speed sims), dspark/ (scheduler/STS sim), the working-set estimator, residency manager, policies, router instrumentation, validators, and the metrics/report pipeline. |
tools/cockpit/ | A small self-contained HTML cockpit UI for the ds4 backend. |
scripts/ | Research scripts: warm-up tracing, working-set estimation, coverage/saturation curves, REAP saliency/bias-mask builders, benchmarks, and report generation. |
configs/ | Model specs (OLMoE, Granite-MoE) and policy/grid configs for the accuracy-vs-VRAM sweep. |
tests/ | Unit tests for the code above. |
docs/ | Design notes, novelty/prior-art analysis, an experiments ledger, and the SPEX/REAP specs. docs/paper/ is intentionally empty here — the paper is added by a separate process. |
docs/CLAIMS_CURRENT.md (single source of truth), plus
docs/REAP_LOOP_NOVELTY.md and docs/PRIOR_ART.md.MIT — see LICENSE. Copyright 2026 REAP-LOOP contributors.
The upstream ds4/DwarfStar engine that this work extends is MIT-licensed by its author; see
docs/references/ for the upstream material.
Python
58.6%
HTML
34.4%
Shell
6.7%
Status: work-in-progress research. Numbers here are PRELIMINARY and several parts are unvalidated. This repository is a research artifact, not a product. Read the caveats section before quoting any figure.
REAP-LOOP is a reversible gate-bias that live-calibrates the expert working-set of a Mixture-of-Experts (MoE) model during the session itself.
Instead of pruning a MoE offline for a fixed domain, REAP-LOOP:
K0 — no experts masked), so the very first tokens run at full quality.Because the working-set is learned from the live session, REAP-LOOP adapts to any task. It is not domain-pretrained and it does not require a fine-tune. A catalogue of pre-learned working-sets (per output-type) is an optional pre-warm — a way to skip the warm-up cost on a familiar workload — never a prerequisite.
The direction this points at is PACE — a Perceptive Adaptive Control Engine: a self-calibrating controller inside the inference engine:
keep-level = f(routing-drift). Drift low → tighten; drift rising → widen proportionally. Dynamic MoE
sparsification framed as a control problem, with the router itself as the drift sensor.
REAP-LOOP is built on top of ds4 / DwarfStar by Salvatore Sanfilippo (antirez) — the MoE-streaming inference engine is the foundation this work stands on. ds4/DwarfStar is MIT-licensed; all credit for the underlying engine, the SSD/host-side expert streaming, and the CUDA/Metal MoE paths belongs to it.
Everything in patches/ is a set of diffs against ds4 — this project does not reimplement the engine,
it extends it. A verbatim copy of the upstream README and the relevant paper are kept under
docs/references/ for attribution and context.
docs/SPEX_spec.md,
docs/SPEX_LOOP.md, and src/msc/spex/.| Path | What |
|---|---|
patches/ds4/ | Diffs against ds4/DwarfStar: SPEX prefetch stages, routing/hidden trace capture, MTP streaming, the bulk page-in path, plus a small C predictor (ds4_spex_predict.{c,h}). |
src/msc/ | Research code: spex/ (predictor + speed sims), dspark/ (scheduler/STS sim), the working-set estimator, residency manager, policies, router instrumentation, validators, and the metrics/report pipeline. |
tools/cockpit/ | A small self-contained HTML cockpit UI for the ds4 backend. |
scripts/ | Research scripts: warm-up tracing, working-set estimation, coverage/saturation curves, REAP saliency/bias-mask builders, benchmarks, and report generation. |
configs/ | Model specs (OLMoE, Granite-MoE) and policy/grid configs for the accuracy-vs-VRAM sweep. |
tests/ | Unit tests for the code above. |
docs/ | Design notes, novelty/prior-art analysis, an experiments ledger, and the SPEX/REAP specs. docs/paper/ is intentionally empty here — the paper is added by a separate process. |
docs/CLAIMS_CURRENT.md (single source of truth), plus
docs/REAP_LOOP_NOVELTY.md and docs/PRIOR_ART.md.MIT — see LICENSE. Copyright 2026 REAP-LOOP contributors.
The upstream ds4/DwarfStar engine that this work extends is MIT-licensed by its author; see
docs/references/ for the upstream material.
Python
58.6%
HTML
34.4%
Shell
6.7%