Run this model with HF Jobs
Run joseveda/Inkling-2-Mini-REAP-E96-MTPLX on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/joseveda/Inkling-2-Mini-REAP-E96-MTPLX. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/joseveda/Inkling-2-Mini-REAP-E96-MTPLX on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/joseveda/Inkling-2-Mini-REAP-E96-MTPLX. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/joseveda/Inkling-2-Mini-REAP-E96-MTPLX. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use joseveda/Inkling-2-Mini-REAP-E96-MTPLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use joseveda/Inkling-2-Mini-REAP-E96-MTPLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("joseveda/Inkling-2-Mini-REAP-E96-MTPLX") config = load_config("joseveda/Inkling-2-Mini-REAP-E96-MTPLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use joseveda/Inkling-2-Mini-REAP-E96-MTPLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "joseveda/Inkling-2-Mini-REAP-E96-MTPLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "joseveda/Inkling-2-Mini-REAP-E96-MTPLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use joseveda/Inkling-2-Mini-REAP-E96-MTPLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "joseveda/Inkling-2-Mini-REAP-E96-MTPLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default joseveda/Inkling-2-Mini-REAP-E96-MTPLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use joseveda/Inkling-2-Mini-REAP-E96-MTPLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "joseveda/Inkling-2-Mini-REAP-E96-MTPLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "joseveda/Inkling-2-Mini-REAP-E96-MTPLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Inkling-2-Mini-REAP-E96-MTPLX
- TL;DR numbers (MacBook Air M4, 24 GB)
- How to load (read this first)
- Test machine and software
- Speed on the M4 Air (MTPLX 2.13.2, E96 MTPLX pack, DSpark MTP draft depth 1)
- Quantization of the source checkpoint (official release)
- Quality vs. the unpruned model
- How the experts were chosen
- Files (in the official-format repo)
- TL;DR numbers (MacBook Air M4, 24 GB)
Inkling-2-Mini-REAP-E96-MTPLX
Inkling 2 Mini with 32 of 128 routed experts removed from every MoE layer (96 kept, still 8 active per token), chosen by REAP saliency (Lasby et al. 2025). No retraining; in the source checkpoint 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 repo is the ready-to-run Apple Silicon pack for MTPLX (Bare Speed recipe, 12.55 GB of weights).
It was built from joseveda/Inkling-2-Mini-REAP-E96 (official format, for transformers/vLLM/SGLang),
using MTPLX's own forge with only the publisher-hash check removed (forge_pack.py in the official-format repo). mtplx-pack.json records the source revision and hashes.
Quantization in this pack:
- Routed experts: NVFP4. Layers 0-19 keep the published codes. Layers 20-23 are re-coded from MXFP8 to NVFP4.
- Attention projections, vocabulary head and input embedding: 4-bit, group size 64.
- Router, loop controllers, norms, convolutions: published precision.
- Vision tower and DSpark draft head: unchanged.
This 4-bit recipe reads about 3 GB of weights per token instead of about 5.5 GB, which is where the speed comes from.
Why: the full model barely fits a 24 GB Mac, leaving room for only ~25-30k tokens of context. With 25% of the experts removed, the same Mac plans 135k tokens of context, with top-1 agreement of 87-92% with the unpruned model.
TL;DR numbers (MacBook Air M4, 24 GB)
| Unpruned (MTPLX Bare Speed) | E112 | E96 (this) | |
|---|---|---|---|
| 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 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-E96-MTPLX --local-dir ~/models/Inkling-2-Mini-REAP-E96-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-E96-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 (about 135k tokens; MTPLX prints the exact planned context at startup), 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 prune_omlx.py and expert_order.json from the official-format 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-E96-oQ4e-mtp --n 96 --order expert_order.json
# enable MTP for it in ~/.omlx/model_settings.json: {"version": 3, "models": {"Inkling-2-Mini-REAP-E96-oQ4e-mtp": {"mtp_enabled": true}}}
omlx serve --model-dir ~/models/omlx --port 8000 --memory-guard-gb 18.5
- In the official-format repo:
prune_omlx.pyneeds MLX (run it with the Python that oMLX is installed in). It writes a full copy of the model, so you need about 13 GB of free disk. --memory-guard-gb 18.5is 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, sopkill -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_expertschanges, from 128 to 96. Load it with the same code as the original model card and point it atjoseveda/Inkling-2-Mini-REAP-E96. This MTPLX pack does not work with transformers. - 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 80% 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 (scripts are in the official-format repo)
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, withMTPLX_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, E96 MTPLX pack, DSpark MTP draft depth 1)
| Prompt | Prefill tok/s | Decode tok/s | Time to first token |
|---|---|---|---|
| 2k | 135 | 23.4 | 16 s |
| 32k | 118 | 15.5 | 272 s |
| 50k | 105 | 14.3 | 484 s |
- Draft depth (E112, 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 (E112) 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.5Git 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 prune_omlx.py from the official-format repo (14.0 GB loaded; run with omlx serve --memory-guard-gb 18.5, Lightning MTP on):
| Prompt | Prefill tok/s | Decode tok/s | TTFT |
|---|---|---|---|
| 2k | 115 | 24.1 | 17 s |
| 32k | 165 | 17.4 | 197 s |
| 50k | 143 | 12.1 | 348 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.
# files from joseveda/Inkling-2-Mini-REAP-E96
python prune_omlx.py ~/models/Inkling-2-Mini-oQ4e-mtp ~/models/Inkling-2-Mini-REAP-E96-oQ4e-mtp --n 96 --order expert_order.json
Quantization of the source checkpoint (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 a third of the E96 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.0915 | 86.9% | +0.0720 |
| Set 2 (prose + CPython) | 0.0583 | 92.3% | +0.0486 |
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 (in the official-format repo)
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 96 kept per layer, in original order.truncate_official.py: builds this checkpoint from the official one.forge_pack.py: builds the MTPLX pack.- In the official-format repo:
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
- 88
4-bit