Inkling 2 Mini for MLX: the release's NVFP4/MXFP8 weights, tuned for a 48 GB Mac

Thinking Machines' Inkling 2 Mini for Apple Silicon. The weights are the release's own, repacked into MLX's nvfp4 and mxfp8 formats without requantizing. This repository also holds a measured serving setup: a fork of mlx-vlm with fixes for this model's decode, prefill and long conversations, the launch configuration, and the results.

Inkling 2 Mini is a looped mixture-of-experts model with 26.2B parameters and ~3.4B active per token. The middle 12 of its 24 layers run three times, for 48 layer passes per token. It takes text and images.

Measured on a MacBook Pro M5 Pro with 48 GB, behind an OpenAI-compatible server (2026-11-20, updated 2026-11-22):

stock inkling2-mlx this setup
decode 24.0–24.8 tok/s 34.2 tok/s (42.2 with the 8-bit speed option below)
prefill, 3.3K / 12.9K-token prompts 557–611 / 591–595 tok/s 838 / 836 tok/s
125K-token prompt, cold memory guard stop ~300 s, 3/3 hidden codes found
context window — 262,144 tokens (a 300K conversation measured; 400K engine-only)
follow-ups on a long conversation refused ~2 s at 150K, ~2.4 s at 300K, whole conversation cached
decode with ~100K / ~300K tokens in context - 23.7 / 19.3 tok/s
an agent session replayed to 90K tokens - completes, no turn re-reads the conversation
memory at 300K (speed option) - 31 GB footprint at the peak; 23% of 48 GB free next to ~9 GB of other apps

For comparison, Unsloth's UD-Q4_K_XL GGUF on Unsloth's llama.cpp build decoded at 28.4 tok/s (it requantizes the attention weights) and prefilled at 252–304 tok/s. See results/RESULTS.md for the method, every change and what was rejected.

Files

Path What
model-0000{1..4}-of-00004.safetensors, model.safetensors.index.json the release's weights in MLX's layout, 19.53 GB: NVFP4 experts in layers 0–19, MXFP8 in 20–23, the rest BF16
mtp.safetensors the release's DSpark speculative-decoding drafter, unmodified (0.64 GB; off in this setup)
config.json, tokenizer, tiktoken/, chat_template.jinja, processor_config.json the release's files; config.json adds the MLX quantization map
scripts/build-engine.sh installs the mlx-vlm fork at the pinned commit into a venv with the exact package versions
scripts/render-config.py writes the server launch these numbers were measured with, for your paths (--json for a router)
scripts/verify-against-release.py checks every tensor here against Thinking Machines' checkpoint
config/requirements.lock.txt the 72 packages the measurements ran on (MLX 0.32.4, transformers 5.23.0, torch 2.15.0 for the image processor)
results/RESULTS.md measurements, engine changes, quality checks, rejected options, limits
SHA256SUMS checksums of every file

Setup on a Mac

You need:

  • an Apple Silicon Mac with 48 GB or more of memory. Thinking Machines name 32 GB as the minimum; with less than 48 GB, use a shorter window. The weights take 20 GB, and the 8 global layer passes add 16.9 KB of KV cache per token with the int8 cache this setup uses (4.4 GB at 256K; 32 KB a token in BF16).
  • for long contexts on 48 GB, the GPU wired limit raised to what the tested Mac used: sudo sysctl iogpu.wired_limit_mb=43008 (42 GiB; it doesn't survive a reboot). The server sets MLX's memory and wired limits to the GPU's recommended working set.
  • about 23 GB free on disk, git, Python 3.11 or newer, and the hf CLI (pip install huggingface_hub).
BASE=~/Inkling-2-Mini-m5pro
hf download baytizzel/Inkling-2-Mini-MLX-M5Pro-48gb --local-dir $BASE/model
PYTHON=/opt/homebrew/opt/python@3.11/bin/python3.11 bash $BASE/model/scripts/build-engine.sh $BASE/engine
python3 $BASE/model/scripts/render-config.py --engine $BASE/engine --model $BASE/model --out $BASE/serve-inkling.sh
bash $BASE/serve-inkling.sh                       # OpenAI-compatible API on 127.0.0.1:8082

The server loads the model on the first request. Clients name the model by its absolute path; render-config.py prints a ready-made request:

curl http://127.0.0.1:8082/v1/chat/completions -H 'Content-Type: application/json' -d @- <<'JSON'
{
  "model": "REPLACE/WITH/ABS/PATH/model",
  "messages": [{"role": "user", "content": "Explain in two sentences why the sky is blue."}],
  "temperature": 1.0, "top_p": 1.0,
  "reasoning_effort": "low",
  "max_tokens": 2048,
  "context_management": []
}
JSON
  • reasoning_effort is the chat template's: none, minimal, low, medium, high (the default), xhigh. The model writes a short reasoning block even at none (returned as reasoning_content), and Thinking Machines warn that it can loop while reasoning, so always set max_tokens. The sampler settings are the model card's.
  • "context_management": [] turns off the server's own compaction. Without it, the server summarises a conversation's older turns once it reaches 3/4 of the window.
  • The window is 262,144 tokens, as measured. This server does not refuse longer requests, so keep prompt + max_tokens inside it yourself (a client's context-window setting does that).
  • Prefix reuse is RAM-only, two checkpoints, and one copy: a follow-up takes the conversation's checkpoint instead of cloning it, and its own cache becomes the next checkpoint when it ends. A conversation's next turn skips the prefill (~2 s at 150K, ~2.4 s at 300K instead of 7–22 minutes cold), and an agent's small side requests (titles) keep their own slot. A new document is read again. The first turn after a client compacts the conversation is cold, and so is a request that fails part-way (its checkpoint is not handed back).
  • Client timeouts: a cold long prompt sends no event until its first token (~5 minutes at 125K, ~17 at 256K). Clients that give up on a quiet stream need a longer limit; omp's default is 300 s (streamFirstEventTimeoutMs / streamIdleTimeoutMs on the provider's compat; this setup uses 1800000).
  • Tools come back as OpenAI tool_calls, with the arguments streamed as the model writes them. The message content can also carry a sentence of the reasoning (a limitation of the engine's parser). Images go in as image_url parts (not tested in this setup).
  • One sequence is decoded at a time (--max-num-seqs 1).

In Python, with the engine's venv:

from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template

model, processor = load("/ABS/PATH/model")
prompt = apply_chat_template(processor, model.config, "Write a haiku about the sea.", reasoning_effort="low")
print(generate(model, processor, prompt, max_tokens=1024, temperature=1.0).text)

Speed option: 8-bit attention, requantized at load

render-config.py --fast adds one environment variable, MLX_VLM_REQUANTIZE, that requantizes the attention projections and the output head to affine 8-bit (group 64) in memory while the server loads the model. Nothing else is downloaded or stored; leave it out to serve the release's precision.

Same server, M5 Pro 48 GB (2026-11-22) native --fast
decode 34.2 tok/s 42.2 tok/s (+23%)
prefill, 3.3K / 12.9K tokens 840 / 848 tok/s 811–832 / 828–840 tok/s
teacher-forced KL against an FP32 reference, 300 tokens (top-1 agreement) 0.076 (279/300) 0.077 (275/300)
long-document retrieval answers that looped, 19 documents 5 2
weights in memory 18.9 GB 17.9 GB

The quality numbers are within the run-to-run band of the BF16 paths; expect slightly different greedy outputs at near-ties, not a different model. Going lower buys little: 4–6-bit attention reached 43–44.6 tok/s at two to three times the KL, because the rest of a decode step (the 4-bit experts and the chain of kernels around them, ~22 ms) doesn't shrink with the attention's bytes.

Long context: 256K on 48 GB

Two engine options, both on in render-config.py's output:

  • MLX_VLM_INKLING_KV8=1: the 8 global layer passes keep each key/value row as int8 plus one FP32 scale (132 bytes per head and token instead of 256). The decode and prefill kernels read the packed rows directly.
  • APC_SINGLE_COPY=1: the prefix cache holds one copy of a conversation. A follow-up takes the checkpoint instead of cloning it, nothing is copied at the prefill boundary, and the request's own cache becomes the next checkpoint when it ends. The copying cache needed two or three copies in a turn: at 150K it could not keep a checkpoint at all (~12 GB of headroom for the copy and the next prefill, 8 GB free), so every turn re-read the conversation.
M5 Pro 48 GB, other apps open (2026-11-22) BF16 KV, copying cache int8 KV + one copy
one cache, engine only: largest under 20% free ~200K (256K: 19% free) 400K (22% free)
server, 150K conversation: follow-ups 400 s each (re-read) 1.7 s (BF16 KV, one copy)
server, 300K conversation: follow-ups, decode - 2.4 s, 19.3 tok/s, min free 23%
decode with 128K in context (engine) 22.9 tok/s 25.0 tok/s
teacher-forced, int8 vs BF16 KV at 32K / 128K - KL 0.0017 / 0.0026, top-1 98.3% / 98.0%
long-retrieval answers that looped, 16 documents of 32K (paired) 4 4

A cold read is still quadratic: ~17 minutes for 256K, 37 for 400K. Leave both variables out (and use a 131K window) to serve the release's BF16 cache with the copying prefix cache.

The engine changes

betizzel/mlx-vlm, branch m5pro-inkling2, commit 7ecb8083, adds 27 commits to internet-projects/inkling2-mlx v0.1.0 (MLX-VLM with Inkling 2 Mini support). build-engine.sh installs it; running it again on an existing engine directory moves that engine to the pinned commit. Briefly:

  • Decode attention without copies. The stock decode step appended a zero "sink" row to every global layer's whole K/V cache on every token (4.3 GB of copying per token at 128K). The sink now goes to the fused attention's sinks argument, and the sliding layers read their ring buffer in place.
  • A split-K decode kernel for long contexts. Each KV head's keys are read once for its three query heads, across the GPU in 512-key blocks: 8 global layers at 125K take 16.9 ms instead of 27.0 ms.
  • The server's batch caches get the fast path. mlx-vlm's server decodes long or resumed conversations on one-row batch caches, which skipped both of the above: decode with 125K in context went from 9.4 to 18.2 tok/s.
  • FP32 logits from the BF16 head, computed by one kernel instead of a cached 1.85 GB FP32 copy of the head.
  • A prefill flash kernel with the relative-position bias and sinks built in (Apple's, from ml-explore/mlx-lm #2086): no heads × chunk × keys mask, +20–30% prefill, and 9 GB less peak memory at 51K tokens.
  • Prefix-cache admission. A follow-up that restores a cached prefix was budgeted as a cold prefill of the whole prompt plus the restored copy, so near the window it was refused. A restored prefix now counts once.
  • Conversion. mlx_vlm.convert saves the repacked quantization for ModelOpt NVFP4 sources; its output failed to reload before.
  • Tool-call arguments stream (55ca2e9e, 2026-11-21). The server held an Inkling tool call's arguments until the call was complete. An agent that writes a file in one bash heredoc then got no event for minutes (a 6K-token file is ~5 minutes at ~20 tok/s), so clients with a stall timeout retried the same request until they gave up.
  • Decode in fused kernels (2026-11-21). A decode step was ~13,500 small MLX operations, each waiting for the last: the GPU was latency-bound, not bandwidth-bound. Kernels from Locals (Apache 2.0) now do each layer pass in ~13, reading the same weights: 27.2 → 33.9 tok/s on the same server. MLX_VLM_INKLING_FUSED_DECODE=0 turns them off.
  • Long agent sessions (2026-11-21). Prefill on the server's left-padded batch caches takes the flash kernel (it built a 4 GB mask per chunk at 41K); a prefix-cache store copies the conversation once, not twice; a checkpoint that continues the current one no longer also reserves room for a cold prefill (at 125K the second follow-up re-read everything); and with APC_EVICT_SUPERSEDED=1 a new turn's checkpoint replaces the one it extends, so the second slot keeps an agent's side request (a title) instead of the previous turn. A replayed 90K-token agent session that stopped at 41K now completes.
  • A reply cut off inside a tool call no longer breaks the reasoning/content splitter.
  • Long context (2026-11-22): the int8 global KV cache and the one-copy prefix cache above (both opt-in), and a server fix: before embedding a request, the server reserved memory for a cold prefill of the whole prompt, which evicted the checkpoint a long follow-up was about to restore (the first follow-up after a 150K document re-read it, 400 s). It now credits the checkpoint, as the scheduler's own admission did.

If you installed the engine before 2026-11-22, run build-engine.sh again.

Quality

  • The weights are the release's. Every tensor equals what the engine builds from Thinking Machines' checkpoint (scripts/verify-against-release.py: 0 mismatches over 1,271 tensors, 19.53 GB).
  • Rounding. Teacher-forced over 300 tokens against an FP32-activation reference with the same weights, every BF16 path disagreed with FP32 on the top token at 18–22 positions (mean KL 0.04–0.09): this looped model is sensitive to rounding. The fused decode step sits in that band (KL 0.076; the previous decode path 0.049). Greedy outputs therefore differ from the stock engine's at near-ties.
  • Long reasoning answers. Asked to list codes hidden in a long document, the model sometimes finds them, then copies the document while "verifying" until max_tokens. Over 19 documents of 16K–100K tokens the fused decode step did this on 5 and the reference decode on 2 (not significant at this size; equal at 16K). If you see it, set MLX_VLM_INKLING_FUSED_DECODE=0 (~20% slower decode); results/RESULTS.md has the details.
  • The int8 KV cache moves the output distribution 20–35× less than the 8-bit speed option does (KL against the BF16 cache 0.002–0.003 at 32K and 128K), and loops as often as the BF16 cache on long-retrieval answers (4 of 16 each). The KL against FP32 at short context is 0.086 with both options on (0.077 with the speed option alone).
  • Thinking Machines' own evaluations are on their model card; nothing here re-runs them.

Not tested

Image input, concurrent requests, reasoning efforts above low, and windows beyond 262,144 tokens in use (the model supports 1M; a 400K cache fits in one copy). Decode with the DSpark drafter was faster on code (+12–23%) but slower on prose (−5 to −26%), so this setup leaves it off.

License and credits

  • Inkling 2 Mini by Thinking Machines Lab, Apache 2.0, with their Model Acceptable Use Policy. The weights here are their release, repacked; see NOTICE.md.
  • This repository's own files: Apache 2.0, see LICENSE.
  • Engine: MLX-VLM © 2025 Prince Canuma and contributors (MIT); inkling2-mlx's Inkling 2 Mini support by NetProjects (Apache 2.0); the prefill kernel © Apple Inc. (MIT, mlx-lm #2086); the decode kernels from Locals © 2026 Arip Asadulaev (Apache 2.0); MLX © Apple Inc. (MIT).

Not affiliated with Thinking Machines.

Downloads last month
527
Safetensors
Model size
26B params
Tensor type
BF16
·
F32
·
U32
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for baytizzel/Inkling-2-Mini-MLX-M5Pro-48gb

Quantized
(227)
this model