Inkling-2-Mini 3.9+5.6 GB (LookAtMyQuant)
thinkingmachines/Inkling-2-Mini (26.4B parameters, 5.4B active, 18.89 GB native text weights / 52.8 GB in BF16) packaged as a 3.9+5.6 GB memory-and-disk split (inkling2-split-v2, 9.46 GB total download): 3.9 GB in memory (3.36 GB resident weights + 0.52 GB working space = 3.88 GB) and 5.6 GB kept on disk (5.37 GB cold experts + 0.23 GB layer-18 flash memory, streamed on demand, plus a 0.46 GB memory-mapped input embedding table and 14.2 MB dual mode-switched effort = 0 routers). Measured on an iPhone Air at 8.5–11.0 tokens/second decode, 1.59–3.56 s time to first token, and 3.84 GB peak memory footprint (matching the macOS MLX split runtime 304/304 tokens exact across 6 prompts).
Across the full 762-item high-effort (reasoning_effort = 0.9) suite (MMLU-Pro, GPQA, MATH-500, HumanEval, up to 4,096 tokens), this build scores 78.78% macro-4 average — 96.5% of the untouched 52.8 GB BF16 reference (81.66%), +32.10 percentage points above an all-in-RAM 3.9 GB quant (46.68%), and statistically tied with unmodified 8.9 GB routing (79.16%, paired McNemar p = 0.92) while cutting cold flash traffic 3.0x from 100.7 MB/token to 33.8 MB/token (96.83% RAM + 256 MB LRU cache hit rate, 11.3 ms/token at 3 GB/s NVMe). On 16K multi-needle long-context recall (up to 20,243 prompt tokens), it scores 100.0% (16/16) across 4K, 8K, 12K, and 15K depths. Total build GPU time: ~1.66 B200-hours (0.66 B200-hours for the base 8.9 GB quantization + ~1.00 B200-hour for Stage-2 flash-router distillation, layer-18 flash memory training, and full 1,526-item verification).
Run it
Install the LookAtMyQuant Apple Silicon MLX runtime:
pip install git+https://github.com/ShinMegamiBoson/lookatmyquant.git
CLI (Apple Silicon MLX):
lamq generate shinmegamiboson/Inkling-2-Mini-LookAtMyQuant-3.9-5.6GB \
-p "What is 17 * 24? Show the step-by-step calculation and final answer concisely." --stats
lamq chat shinmegamiboson/Inkling-2-Mini-LookAtMyQuant-3.9-5.6GB
lamq serve shinmegamiboson/Inkling-2-Mini-LookAtMyQuant-3.9-5.6GB --port 8080 --ui
Optional environment controls for the flash split runtime:
LAMQ_SPLIT_CACHE_MB(default256): cold-expert LRU cache size in MB (raise on 12 GB+ devices to reduce disk reads further).LAMQ_SPLIT_NOCACHE=0: allow OS page cache on cold expert reads instead of strictF_NOCACHE.LAMQ_SPLIT_ROUTER_MODE(defaultauto):autoswaps inrouters_effort0.safetensors(+0 MB active RAM) and bypasses L18 memory onreasoning_effort = 0prompts while using the 3.0x-faster Stage-2 routers on thinking prompts; setheto lock fast routing on all prompts oreffort0to force unmodified routing.
Python API (MLX):
from runtime_mlx import Runtime
rt = Runtime.load("shinmegamiboson/Inkling-2-Mini-LookAtMyQuant-3.9-5.6GB")
res = rt.generate(
"What is 17 * 24? Answer in one short sentence.",
max_tokens=64,
use_drafter=False,
)
print(res.text)
iOS and macOS Swift (runtime_swift):
The exact same files (split.json, layer_XX_packed.safetensors, layer_XX_cold.bin, embed_int8.bin, routers_effort0.safetensors, l18_memory_flash.bin, l18_memory_ram.safetensors) load directly in native Swift via the standalone LookAtMyQuantInkling Swift Package (mlx-swift, iOS 18+ / macOS 15+) with zero format conversion:
import LookAtMyQuantInkling
let model = try Inkling2Model(directory: modelDir)
let result = InklingRunner.generate(target: model, prompt: promptTokenIds, maxTokens: 256)
On iOS, enable the standard com.apple.developer.kernel.increased-memory-limit and com.apple.developer.kernel.extended-virtual-addressing entitlements (see runtime_swift/README.md).
Results
On-device iPhone Air performance (runtime_swift, Release, default routing)
Measured on an iPhone Air (A19 Pro, 11.46 GB physical RAM, 5.99 GB app memory limit, 256 MB cold-expert LRU cache, bias = 0.0, thermal state nominal throughout, serial greedy decoding):
| Prompt | New Tokens | Decode Speed | Time to First Token | RAM + Cache Hit Rate | Cold Flash Read / Tok | Peak RAM Footprint | Exact Parity vs. Mac Split |
|---|---|---|---|---|---|---|---|
High-effort math (he_math) |
64 | 10.98 tok/s | 1.59 s | 98.3% | 18.3 MB | 3.81 GB | 64/64 |
High-effort reasoning (he_reason) |
64 | 10.26 tok/s | 2.60 s | 97.1% | 31.2 MB | 3.83 GB | 64/64 |
Math (effort = 0) |
32 | 10.19 tok/s | 1.88 s | 97.7% | 23.2 MB | 3.83 GB | 32/32 |
Reasoning (effort = 0) |
48 | 8.98 tok/s | 2.83 s | 95.9% | 46.7 MB | 3.84 GB | 48/48 |
Code (effort = 0) |
48 | 8.90 tok/s | 3.56 s | 91.6% | 81.8 MB | 3.81 GB | 48/48 |
Prose (effort = 0) |
48 | 8.52 tok/s | 2.53 s | 93.0% | 78.7 MB | 3.83 GB | 48/48 |
Layer-18 flash memory (mmap) read 8.3 KB/token (1.41–1.90 ms/token); cold expert reads ran at 2.64–2.97 GB/s sustained F_NOCACHE NVMe bandwidth.
Full 762-item high-effort (reasoning_effort = 0.9) benchmark
Evaluated directly on exact OS-mmap readback weights (0.00000000 readback max absolute diff) against untouched BF16 on the same 762-item split (MMLU-Pro 200, GPQA 198, MATH-500 200, HumanEval 164; temperature = 1.0, max_new_tokens = 4,096 with loop-hygiene closing).
| Build | Total Disk | Active RAM | High-Effort Macro-4 | Delta vs BF16 (% Retained) | MMLU-Pro (200) | GPQA (198) | MATH-500 (200) | HumanEval (164) | 16K Recall (16) | Cold Flash Read / Tok |
|---|---|---|---|---|---|---|---|---|---|---|
| Untouched BF16 reference | 52.80 GB | 52.80 GB | 81.66% | — (100.0%) |
81.50% | 70.71% | 77.50% | 96.95% | 100.0% | 0.0 MB |
| Stage-1 3.9+5.3 GB split (unmodified routers) | 9.19 GB | 3.89 GB | 79.16% | -2.50 pp (96.9%) |
79.00% | 64.14% | 79.00% | 94.51% | 100.0% | 100.7 MB |
This build: Stage-2 3.9+5.6 GB (Arm 2c, dual routers) |
9.46 GB | 3.88 GB | 78.78% | -2.88 pp (96.5%) |
78.00% | 66.16% | 79.50% | 91.46% | 100.0% | 33.8 MB |
| All-in-RAM 3.9 GB (no flash) | 3.85 GB | 3.85 GB | 46.68% | -34.98 pp (57.2%) |
40.00% | 31.82% | 51.50% | 63.41% | — | 0.0 MB |
Controlled 128-item high-effort dev ablation (Stage-2 components)
| Configuration | Description | High-Effort Dev Macro-4 | Dev GPQA | 13-Lang Perplexity | Cold Flash Read / Tok |
|---|---|---|---|---|---|
| Base 8.9 GB split | Unmodified 8.9 GB routers + int8 embed | 85.16% | 65.62% | 8.37 | 100.74 MB |
Routers only (Arm 2a) |
Trained flash-aware routers only | 79.69% | 53.12% | 8.70 | 33.80 MB |
Routers + PKM (Arm 2b) |
Trained routers + 136.3 MB layer-18 1M-slot Product-Key Memory (int4+fp16) |
82.81% | 62.50% | 8.70 | 33.81 MB |
Shipped build (Arm 2c) |
Trained routers + 136.3 MB Product-Key Memory + 92.9 MB layer-18 2,440-leaf Empirical-Bayes oblique tree | 85.94% | 75.00% | 8.70 | 33.88 MB |
Static bias + hybrid (Arm 2d) |
Zero-training +0.20 static bias + adapted layer-18 hybrid memory | 84.38% | 71.88% | 8.87 | 35.86 MB |
Instant (reasoning_effort = 0) accuracy restored via dual mode-switched routers (764 items)
With single-router Stage-2 routing (LAMQ_SPLIT_ROUTER_MODE=he), no-thinking factual recall dips because trained flash routers favor the 1,059 high-effort RAM experts. By default (auto), the runtime detects Thinking effort level: 0 in the system header, swaps the 24 routers in place from routers_effort0.safetensors (+14.2 MB disk, 0 MB extra RAM), and bypasses layer-18 memory — restoring full unmodified effort = 0 accuracy (MMLU-Pro +10.00 pp, paired McNemar p = 0.00054; Unseen QA +4.00 pp, p = 0.077):
| Build / Router Mode | GSM8K (200) | HumanEval (164) | Unseen QA (200) | MMLU-Pro Effort=0 (200) |
|---|---|---|---|---|
| Stage-1 3.9+5.3 GB split (unmodified routers) | 95.00% | 96.34% | 35.50% | 58.00% |
Stage-2 single-router (LAMQ_SPLIT_ROUTER_MODE=he) |
96.50% | 93.29% | 31.00% | 48.50% |
This build: dual-router default (auto / effort0) |
96.50% | 94.51% | 35.00% | 58.50% |
Memory and disk footprint
| Component | Resident RAM | Cold Flash / Disk | Notes |
|---|---|---|---|
| 1,059 hot experts + attention/head/steering (kept in RAM) | 3.347 GB | 3.347 GB | Top calls-per-byte experts (layer_XX_packed.safetensors) + quantized attention/head + 24 trained fp32 routers |
| 2,013 cold experts (streamed on miss) | — | 5.372 GB | Page-aligned records in layer_00..23_cold.bin |
L18 flash memory (l18_memory_flash.bin) |
~0 GB (mmap) |
0.229 GB | 136.3 MB 1M-slot PKM + 92.9 MB 2,440-leaf rank-16 EB-KLTree (int4+fp16); cold experts + L18 flash = 5.60 GB |
Input embedding table (embed_int8.bin) |
~0 GB (mmap) |
0.461 GB | 200,058 x 2,304 symmetric int8 + float16 row scales |
Dual effort = 0 routers (routers_effort0.safetensors) |
0.000 GB (swapped) | 0.014 GB | 24 unmodified fp16 router weights + fp32 biases loaded in place on reasoning_effort = 0 |
| L18 RAM projections + oblique routing trees | 0.014 GB | 0.014 GB | l18_memory_ram.safetensors (fp16 dense params + tree nodes) |
| Metadata & tokenizer files | — | 0.027 GB | split.json, config.json, manifest.json, layer_XX_meta.json, tokenizer |
| Runtime working budget (256 MB LRU + 16K KV + staging) | 0.520 GB | — | Cold LRU cache + 48-visit KV cache + Metal scratch |
| Total | 3.881 GB (3.9 GB) |
9.464 GB (9.46 GB) |
Named 3.9+5.6 GB: 3.88 GB memory needed + 5.60 GB cold experts & L18 flash on disk; 0.0 mmap readback diff |
Method
- Base quantization (
v5_8p9GB): Non-uniform LookAtMyQuant trellis/NVFP4 quantization ofInkling-2-Mini(2.60bits/param experts,5.32bits/param attention), withembed_tokensstored on disk as symmetric per-rowint8 + fp16(461 MB, relative L2 error0.00853). - Hot/cold expert split: Ranked all
3,072experts (24 x 128) by high-effort calls per byte on 1,249 full-length high-effort traces, packing the top 1,059 experts (2.599 GB) into resident RAM slabs and storing the remaining 2,013 experts (5.372 GBon disk with 16 KB page alignment) inlayer_XX_cold.binfiles. - Stage-2 flash-aware router training (
Arm 2a): Straight-through distillation of the 24 MoE routers (fp32) combining teacher KL against untouched 26B BF16 on full-length on-policy traces with a differentiable cold-byte penalty — reducing cold flash reads from100.7 MB/tokento33.8 MB/token(96.83%RAM + 256 MB LRU hit rate). - Stage-2 Layer-18 hybrid flash memory (
Arm 2c): Added a229.2 MBmemory-mapped residual tap after layer 18 (first post-loop layer, executed once per token) combining:- 1M-slot
QuantSilentPKM(136.3 MBflash):1024 x 1024 x 256int4+fp16product-key memory with both per-token phase-gated lookup (think_scaleinside<|content_thinking|>) and strictly causal prompt-anchored retrieval, gated by a hard-silence ReLU threshold (margin = 0.15). - Data-adaptive
EmpiricalBayesKLTree(92.9 MBflash): 2 oblique KL-gain decision trees (2,440leaves,min_samples = 180,rank = 16local LoRA + bias inint4+fp16), Empirical-Bayes leaf shrinkage (tau = 250), and a hard-silence ReLU gate (margin = 0.12). - Recovers +6.25 pp high-effort dev accuracy (
+21.88 ppon dev GPQA) overArm 2aat0.0013-language perplexity drift and78 KB/tokenofmmapreads.
- 1M-slot
Known limitations
- Speed vs. recall on
reasoning_effort = 0: Defaultautomode swaps in unmodifiedrouters_effort0.safetensorsonreasoning_effort = 0prompts to restore full factual recall (MMLU-Pro 58.5%,Unseen QA 35.0%), which reads more cold experts per token during short instant replies than Stage-2 flash routing. SetLAMQ_SPLIT_ROUTER_MODE=he(Python) orInklingSplitStore.routerModeOverride = .highEffort(Swift) when you prefer faster8.5–10.2 tok/sinstant decode over peak no-thinking factual recall. - Cold-storage prefill cost: Long prompts touch more unique cold experts during prefill than decode; grouping tokens per expert and raising
LAMQ_SPLIT_CACHE_MBon devices with > 4 GB available RAM reduces prefill disk reads substantially. - Text weights only: Vision tower weights are excluded to stay inside the 3.9 GB RAM / 10 GB disk envelope.
Files
split.json—inkling2-split-v2manifest (kept/cold expert map, page offsets,embed_int8.binlayout,dual_routersspec,l18PKM & tree TOC).steering.safetensors— attention/conv/loop steering tensors and the 24 Stage-2 trainedfp32high-effort MoE routers.routers_effort0.safetensors— unmodified basefp16router weights +fp32biases (14.2 MB) swapped in onreasoning_effort = 0prompts with zero extra resident RAM.layer_00..23_packed.safetensors&layer_00..23_meta.json— quantized attention layers and 1,059 resident kept experts.layer_00..23_cold.bin— 2,013 page-aligned cold experts (5.372 GB).embed_int8.bin—mmapsymmetricint8 + fp16token embedding table (461 MB).l18_memory_flash.bin&l18_memory_ram.safetensors— Stage-2 layer-18int4+fp16PKM + oblique-tree flash memory (229.2 MBflash,13.8 MBRAM).head_packed.safetensors,head_meta.json,luts.safetensors,config.json,manifest.json, tokenizer files.