Inkling-2-Mini-REAP-E112

Inkling 2 Mini with 16 of 128 routed experts removed from every MoE layer (112 kept, still 8 active per token), chosen by REAP saliency (Lasby et al. 2025). No retraining, no re-quantization: every kept expert's NVFP4 / MXFP8 codes and scales are bit-exact copies of the original; only the router rows and biases are sliced to match. Vision tower, DSpark MTP draft head, tokenizer and chat template are unchanged.

This is the official checkpoint format (transformers, vLLM, SGLang). For Apple Silicon, use the ready-made pack Inkling-2-Mini-REAP-E112-MTPLX. The long-context sibling is Inkling-2-Mini-REAP-E96.

Why: the full model barely fits a 24 GB Mac, leaving room for only ~25-30k tokens of context. With 12.5% of the experts removed, the same Mac plans 94k tokens of context and runs 50k-token prompts, with top-1 agreement of 92-95% with the unpruned model.

TL;DR numbers (MacBook Air M4, 24 GB)

Unpruned (MTPLX Bare Speed) E112 (this) E96
Checkpoint size (this format) 19.5 GB 17.6 GB 15.6 GB
MTPLX pack weights 16.0 GB 14.27 GB 12.55 GB
Context that actually runs on 24 GB ~25-30k 50k+ (94k planned) 50k+ (135k planned)
KL vs unpruned (code / prose) 0 0.032 / 0.022 0.092 / 0.058
Top-1 agreement (code / prose) 100% 91.8% / 95.2% 86.9% / 92.3%

How to load (read this first)

Mac with Apple Silicon: MTPLX (recommended, what all the speed numbers use)

Use the pre-built pack joseveda/Inkling-2-Mini-REAP-E112-MTPLX, not this repo. Install MTPLX (2.13.2 tested) by following its README, then:

# 1. Let the GPU use 20 GB of the 24 GB. This resets on reboot. It is the step people miss most often.
sudo sysctl iogpu.wired_limit_mb=20480

# 2. Download the pack
hf download joseveda/Inkling-2-Mini-REAP-E112-MTPLX --local-dir ~/models/Inkling-2-Mini-REAP-E112-MTPLX

# 3. Serve an OpenAI-compatible API on http://127.0.0.1:8000/v1
MTPLX_SYSTEM_MEMORY_ABORT_FLOOR_BYTES=402653184 \
mtplx serve --model ~/models/Inkling-2-Mini-REAP-E112-MTPLX --model-id inkling-2-mini \
  --port 8000 --memory-limit 19.5G --depth 1 --yes

Gotchas:

  • Quit other model servers first (e.g. ollama stop <model>). Two models do not fit in 24 GB.
  • Without --memory-limit 19.5G, MTPLX picks a conservative budget and you get far less context.
  • The abort-floor variable lowers MTPLX's "keep 1 GiB free for macOS" guard to 384 MiB. Without it, long prompts get refused when a browser is open. Leave it out if you'd rather have the safety margin.
  • --depth 1 (one DSpark draft token per step) was the fastest setting on the M4. Deeper drafts were slower.
  • Thinking is on by default. For quick calls, pass "chat_template_kwargs": {"enable_thinking": false} in the request.
  • Set your client's context window (pi, Cline, etc.) at or below the planned context (94,208 tokens), or the server will refuse long prompts.
  • 16 GB Macs: will not fit. 32 GB+ Macs: the unpruned model fits; use this only if you want more context.

oMLX 0.8.4 (alternative, faster prefill)

Prune the oMLX quant yourself with the expert order from this repo:

hf download mlx-community/Inkling-2-Mini-oQ4e-mtp --local-dir ~/models/omlx/Inkling-2-Mini-oQ4e-mtp
python -I prune_omlx.py ~/models/omlx/Inkling-2-Mini-oQ4e-mtp ~/models/omlx/Inkling-2-Mini-REAP-E112-oQ4e-mtp --n 112 --order expert_order.json
# enable MTP for it in ~/.omlx/model_settings.json:  {"version": 3, "models": {"Inkling-2-Mini-REAP-E112-oQ4e-mtp": {"mtp_enabled": true}}}
omlx serve --model-dir ~/models/omlx --port 8000 --memory-guard-gb 18.5
  • prune_omlx.py needs MLX (run it with the Python that oMLX is installed in). It writes a full copy of the model, so you need about 15 GB of free disk.
  • --memory-guard-gb 18.5 is required. The default "balanced" and "aggressive" guard tiers count only free and inactive memory (10 GB on a 24 GB Mac) and refuse to load the model. The setting is saved to `/.omlx/settings.json`.
  • The oMLX server process renames itself omlx-server, so pkill -f "omlx serve" won't stop it. Kill the process listening on port 8000 instead (lsof -ti :8000 | xargs kill).

transformers / vLLM / SGLang (GPU)

  • The checkpoint uses the original architecture and file layout. Only text_config.n_routed_experts changes, from 128 to 112. Load it with the same code as the original model card and point it at this repo.
  • transformers 5.24 ran the official weights on an A100 80GB: NVFP4 is dequantized to BF16, about 49 GB. The pruned checkpoint should need about 90% of that.
  • vLLM and SGLang were not tested with the pruned expert count. If their fused-MoE kernels assume 128 experts, please open a discussion.

Building your own size

Any number of experts N between 1 and 128 can be cut from the official checkpoint using expert_order.json. On a Mac, MTPLX's forge refuses modified weights because it checks the publisher's SHA-256 hashes. forge_pack.py runs the same builder with only that hash check removed, and keeps all the structural checks.

python -I truncate_official.py ~/models/Inkling-2-Mini ~/models/Inkling-2-Mini-REAP-E104 --n 104 --order expert_order.json
~/.mtplx-venv/bin/python -I forge_pack.py ~/models/Inkling-2-Mini-REAP-E104 ~/models/Inkling-2-Mini-REAP-E104-MTPLX --recipe bare-speed

At 104 experts we measured KL 0.058 / top-1 89.0% and 115k planned context. The forge takes about 5.5 minutes on an M4.

Test machine and software

  • MacBook Air M4, 10-core GPU, 24 GB unified memory, fanless (it throttles on long runs, so expect ±10% between runs).
  • macOS 27.2.1, GPU wired-memory cap raised with sudo sysctl iogpu.wired_limit_mb=20480.
  • MTPLX 2.13.2 (MLX 0.32.2), mtplx serve --memory-limit 19.5G --depth 1, with MTPLX_SYSTEM_MEMORY_ABORT_FLOOR_BYTES=402653184 (keeps the safety guard but lets long prompts run with a browser open).
  • oMLX 0.8.4 for the comparison below.
  • Ollama and other model servers unloaded. Both can't fit in 24 GB at once.

Speed on the M4 Air (MTPLX 2.13.2, E112 MTPLX pack, DSpark MTP draft depth 1)

Prompt Prefill tok/s Decode tok/s Time to first token
1k — 17.7 —
2k 122-147 18.6-22.9 17 s
8k — 16.9 —
32k 99 13.1-14.2 324 s
50k — 15.0 —
  • Draft depth (2k prompt): plain autoregressive 20.0, depth 1 22.9, depth 2 22.7, depth 3 22.1 tok/s. Depth 1 is best on this chip.
  • Prefill chunk 512 / 1024 / 2048: 147 / 142 / 135 tok/s, so the default 512 is best.
  • Unpruned pack on the same machine: 18.5 tok/s at 1k by default. With --memory-limit 19.5G it is refused around 33k tokens, because system RAM runs out.

Same pruning on oMLX 0.8.4 (faster prefill)

Applying the same expert order to mlx-community/Inkling-2-Mini-oQ4e-mtp with the included prune_omlx.py (15.4 GB loaded; run with omlx serve --memory-guard-gb 18.5, Lightning MTP on):

Prompt Prefill tok/s Decode tok/s TTFT
2k 118 23.7 17.6 s
8k 203 23.7 40 s
32k 140 17.5 228 s

The stock unpruned oQ4e (17.2 GB loaded) does not run on 24 GB: the memory guard aborts even a 2k prompt. With 25% of the experts kept in memory and the rest offloaded, it runs at 9 tok/s. The pruned oQ4e has not been scored for KL. Only a sanity check was run on it.

python prune_omlx.py ~/models/Inkling-2-Mini-oQ4e-mtp ~/models/Inkling-2-Mini-REAP-E112-oQ4e-mtp --n 112 --order expert_order.json

Quantization (unchanged from the official release)

Inkling 2 Mini is a 24-layer MoE: hidden size 2304, 128 routed experts with top-8 routing and no shared expert, 201k vocabulary. It uses 20 sliding-window layers plus 4 global-attention layers, and its middle 12 layers (6-17) loop 3 times per token.

  • Routed experts, layers 0-19: NVFP4 (bit-exact, sliced).
  • Routed experts, layers 20-23: MXFP8 (bit-exact, sliced).
  • Attention, embeddings, vocabulary head: as published (see hf_quant_config.json).
  • Router, loop controllers, norms: as published, sliced where they index experts.

The MTPLX pack additionally stores attention projections, the vocabulary head and the input embedding as 4-bit (group size 64), and re-codes the layer 20-23 experts from MXFP8 to NVFP4. The 4-bit pack on its own differs from the official weights by KL 0.030 / top-1 93.4% / +0.011 nats, which is about the same size as the E112 pruning loss.

Quality vs. the unpruned model

Teacher-forced on held-out text, comparing against the unpruned MTPLX Bare Speed pack on the Mac. Metrics: top-20 partition KL, top-1 next-token agreement, and NLL change in nats/token.

  • Set 1: pi coding-agent docs and Python source.
  • Set 2: an independent set of model-card prose and the CPython stdlib.
Eval set KL Top-1 agreement NLL delta
Set 1 (pi docs + Python) 0.0317 91.8% +0.0183
Set 2 (prose + CPython) 0.0216 95.2% +0.0057

Not measured: the vision tower is unchanged but image understanding after pruning was not evaluated, and no downstream benchmarks (HumanEval, SWE-bench, etc.) were run. Treat these numbers as "how close to the original", not "how good at tasks".

How the experts were chosen

Criterion. REAP saliency is router gate weight × ‖expert output‖, averaged over the tokens routed to that expert. It was compared against other criteria at 96 kept experts (KL vs unpruned, set 1):

Criterion KL Top-1
REAP (mean) 0.097 86.1%
REAP-sum 0.150 82.2%
RAZOR (arXiv 2609.30465) 0.098 —
OMP-MoE (arXiv 2609.31631) 0.114 —
Routing-weight frequency 0.155 82.0%
Global (non-uniform per layer) allocation 0.176 80.5%
Loop-aware global allocation 0.160 81.7%

Calibration data matters more than volume. Per-expert scores are normalized per layer and averaged over two sets:

  • (a) 16k tokens of the pi coding-agent source and docs plus Python/JS code, measured with MTPLX on the Mac;
  • (b) 600k tokens of Python code (codeparrot) and coding instructions (self-oss-instruct-sc2), measured with transformers on an A100.
Calibration E112 KL set1 / set2 E96 KL set1 / set2
16k local tokens 0.0341 / 0.0252 0.0966 / 0.0947
1.5M mixed (code, instruct, web, chat, tool calls) 0.0582 / 0.0329 0.1332 / 0.1054
agentic-weighted mix 0.0679 / 0.0451 0.1313 / 0.1061
600k code only 0.0432 / 0.0238 0.1072 / 0.0645
hybrid (16k local + 600k code), shipped 0.0317 / 0.0216 0.0915 / 0.0583

Web, chat and tool-call data in the calibration set hurt coding quality.

What didn't work (healing). None of these was shipped:

  • Forward-only fixes after pruning (low-rank output correction, evolution-strategies router-bias tuning, top-k 9/10, redirecting pruned experts' traffic, "novice" mean experts) were flat or worse.
  • KL+CE distillation on an A100 improved in-distribution NLL, but on held-out text it moved away from the original model (KL 0.1004 vs 0.0966).

Files

  • expert_order.json: for each layer, all 128 original expert indices from most to least important. Cut any size N from the original with the same order.
  • kept_experts.json: the 112 kept per layer, in original order.
  • truncate_official.py: builds this checkpoint from the official one. forge_pack.py: builds the MTPLX pack.
  • prune_omlx.py: applies the same pruning to an oMLX oQ checkpoint.

Apache-2.0, as the base model; also subject to Thinking Machines' acceptable use policy. This is an independent community derivative and is not affiliated with Thinking Machines.

Downloads last month
28
Safetensors
Model size
23B params
Tensor type
F32
·
BF16
·
F8_E4M3
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for joseveda/Inkling-2-Mini-REAP-E112

Finetuned
(195)
this model