Run this model with HF Jobs
Run austindixson/Inkling-2-Mini-ToolCall-Cartridge 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/austindixson/Inkling-2-Mini-ToolCall-Cartridge. 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/austindixson/Inkling-2-Mini-ToolCall-Cartridge 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/austindixson/Inkling-2-Mini-ToolCall-Cartridge. 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/austindixson/Inkling-2-Mini-ToolCall-Cartridge. 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 austindixson/Inkling-2-Mini-ToolCall-Cartridge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use austindixson/Inkling-2-Mini-ToolCall-Cartridge with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("austindixson/Inkling-2-Mini-ToolCall-Cartridge") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use austindixson/Inkling-2-Mini-ToolCall-Cartridge with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "austindixson/Inkling-2-Mini-ToolCall-Cartridge" --prompt "Once upon a time"
- Atomic Chat
Inkling 2 Mini tool-calling cartridge
A 27,989,502-byte deletion-tuning skill cartridge for thinkingmachines/Inkling-2-Mini. It turns off 13,217,851 even-row MoE gate weights ($13{,}217{,}851 / 4{,}076{,}863{,}488 = 0.3242%$ of the masked subset) and does not update any remaining weights. Model files on disk are not edited.
On the held-out 97-item ToolAlpaca test, a 4-bit MLX build goes from 32 of 97 (33.0%) to 66 of 97 (68.0%): $66/97 - 32/97 = 34/97 = +35.1$ points, or $66 / 32 = 2.06\times$. A two-sided McNemar test on 35 gains and 1 loss is
General-task mean on 4,439 questions went from 72.21% to 71.97% (β0.24 points). Exact forward KL from the base model is 0.004362. The recommended file is masks/inkling2_toolalpaca_sft_e64_step400.cart.zlib, mode nearest_zero. On an M3 Max with 128 GB, Sparse-XOR apply is 391.33 ms and eject is 387.36 ms, with a bit-exact restore.
This is an unofficial derivative. Credit for the model belongs to its authors. License is Apache-2.0, same as the base model. The 4-bit Mac weights this cartridge was measured on are in austindixson/Inkling-2-Mini-MLX-4bit. The fused Metal kernels and DFlash2 runtime used for the speed check are in austindixson/Inkling-2-Mini-Neon-Kernels.
What it is
The cartridge is a live switch, not a fine-tune and not a second copy of the model. It writes a packed keep-mask over the even rows [:, 0::2, :] of model.model.language_model.layers.{0..23}.mlp.experts.gate_up_proj, on the top 64 ToolAlpaca-routed experts per layer only. Odd (up_proj) rows are left untouched. Format: INKCART1 ([magic][JSON header][zlib-compressed little-endian packed keep bits]).
The memory-frugal path on Apple silicon is a Sparse-XOR dial: it stores only the 12,211,000 changed uint32 words (97.69 MB persistent RAM). Applying the XOR mask toggles base β masked; applying it again restores base, because $(w \oplus d) \oplus d = w$.
How to apply and eject
The apply/eject helpers are in src/inkling_cartridge.py. nearest_zero is the recommended mode.
from pathlib import Path
from mlx_lm import load
from src.inkling_cartridge import precompute_sparse_xor, toggle_sparse_xor
model, tokenizer = load("austindixson/Inkling-2-Mini-MLX-4bit")
cart_path = Path("masks/inkling2_toolalpaca_sft_e64_step400.cart.zlib")
# Stream the file and build the compact dial (cold; about 6 s on an M3 Max).
sparse = precompute_sparse_xor(model, cart_path)
# Apply (warm median on an M3 Max: 391.33 ms). Call again to eject (387.36 ms).
toggle_sparse_xor(model, sparse) # on
# ... generate ...
toggle_sparse_xor(model, sparse) # off, bit-exact restore
If you have about 7.59 GiB of extra RAM, the dense pointer-swap path is faster to toggle after a one-time precompute:
from src.inkling_cartridge import load_cartridge, precompute_cartridge, apply_prepared, eject
cart = load_cartridge(cart_path)
prepared = precompute_cartridge(model, cart, mode="nearest_zero")
saved = apply_prepared(model, prepared)
# ... generate ...
eject(model, saved)
The fused-kernel weight cache does not hold gate_up_proj. Apply and eject clear the compiled decode closures so the fused + DFlash2 path picks up the active weights. You can also use the cartridge on a stock mlx-lm load of the 4-bit weights; the kernels are optional.
ToolAlpaca (held-out 97)
Protocol: greedy (temp=0), max_new_tokens=1024, reasoning_effort="none", pinned idanshen/Self-Distillation scorer at d77573212fa0a3ae2eeb64b9b44db1c251f75e3e, visible text from <|content_text|>...<|end_message|>. Test set: idanshen/toolalpaca_eval (97 items). Raw outputs: results/eval_base.json and results/eval_best_nearest_zero.json.
| Condition | Score | Share |
|---|---|---|
Fresh no-mask baseline (mlx-4bit-g32, none) |
32/97 | 33.0% |
step400 cartridge (nearest_zero) |
66/97 | 68.0% |
step400 cartridge (requant) |
66/97 | 68.0% |
| Nov 21 native Inkling, none | 36/97 | 37.1% |
| Nov 21 Flash | 41/97 | 42.3% |
Net: $66 - 32 = +34$ items. Versus the November 21 Flash number: $66 - 41 = +25$ items, $+25.8$ points. Those last two rows are the earlier same-set figures, not a same-day rerun.
Paired table (nearest_zero and requant identical): both correct 31, gained 35, lost 1 (item 73, searchHolidays), both wrong 30. Thinking traces went from 97/97 to 0/97. Mean generated tokens fell from 235.7 to 85.1. Under plain_skip_special without stripping thinking blocks, the baseline is 30/97 and the cartridge is still 66/97.
Checkpoint selection used only a 100-item dev split carved from train (seed 42). Dev: results/dev_selection.json. Step 400 tied step 300 at 43/100 and was selected for lower loss and shorter generations.
KL, perplexity, and retention
| Metric | Fresh base | step400 nearest_zero |
|---|---|---|
| Exact forward KL(base β₯ masked), 48Γ1024 | 0.000000 | 0.004362 |
| Top-1 next-token agreement, 48Γ1024 | 100.00% | 97.15% |
| WikiText-2 PPL, 48Γ1024 (49,104 tok) | 7.8585 | 7.8562 |
| WikiText-2 PPL, 32Γ2048 (65,504 tok) | 7.0926 | 7.0940 |
| Task | Base | Cartridge | Ξ |
|---|---|---|---|
| HellaSwag acc_norm, 1,000 of 10,042 val | 76.30% | 76.10% | β0.20 points |
| MMLU acc, 1,000 of 14,042 test | 76.10% | 75.70% | β0.40 points |
| ARC-Challenge acc, full 1,172 test | 63.82% | 63.23% | β0.60 points |
| WinoGrande acc, full 1,267 val | 72.61% | 72.85% | +0.24 points |
| Mean of the four (4,439 questions) | 72.21% | 71.97% | β0.24 points |
requant ties 66/97 but has higher KL (0.004765), so nearest_zero is the production mode. It also leaves scales and biases unchanged, which the Sparse-XOR dial needs.
Decode speed (M3 Max, 128 GB)
Measured with the fused-kernel tree (Inkling-2-Mini-Neon-Kernels, commit b75cc5e), greedy, 1024-token cap, four prompts, median of 3, 36,516 generated tokens, peak MLX 15.37 GiB. Mean of per-prompt medians:
| Arm | Base | Cartridge on | Change |
|---|---|---|---|
| plain fused | 62.15 tok/s | 64.30 tok/s | +3.5% |
| fused + DFlash2 live gate | 73.76 tok/s | 76.79 tok/s | +4.1% |
The cartridge did not slow decode on this machine. SHA-256 token identity was 9/9 across unfused, fused, and DFlash2, off-mask, on-mask, and after eject. Raw numbers: results/local_verify_step400_full.json and results/local_verify_step400_dial.json.
Training
SFT deletion tuning, 400 steps, seed 0, AdamW $5 \times 10^{-4}$, batch size 4, answer-token cross-entropy only, reasoning_effort="none", max_seq_len=2048. Wanda initialization ($\eta = 1/2048 \approx 0.0488%$, 256 ToolAlpaca prompts). Data: idanshen/toolalpaca_train (4,046 rows) split seed 42 into 3,946 train / 100 dev; test is idanshen/toolalpaca_eval (97).
Decontamination against GPQA, LiveCodeBench, AIME, IFBench/IFEval, BFCL, and HLE found 0 hits. The mask was trained on the top 64 routed experts per layer (85.72% of ToolAlpaca routing mass on 256 calibration prompts), not all 128, so training would fit on one 141 GB H200. Hugging Face H200 time was $30.41 of a $50 cap, over 6 hours 4 minutes 53 seconds.
Training metrics: results/inkling2_toolalpaca_sft_e64_metrics.jsonl. Intermediate checkpoints (step100 / step200 / step300) are in masks/ for comparison. src/expert_delta_mm.py is the custom MLX gather_mm VJP used during training.
Files
| Path | Role |
|---|---|
masks/inkling2_toolalpaca_sft_e64_step400.cart.zlib |
Winning cartridge, 27,989,502 bytes |
masks/inkling2_toolalpaca_sft_e64_step{100,200,300}.cart.zlib |
Earlier checkpoints |
src/inkling_cartridge.py |
Apply / eject |
src/expert_delta_mm.py |
Training VJP helper |
results/eval_base.json |
Fresh no-mask ToolAlpaca, KL, PPL, retention |
results/eval_best_nearest_zero.json |
step400 nearest_zero evals |
results/eval_best_requant.json |
step400 requant evals |
results/dev_selection.json |
Dev-100 checkpoint pick |
results/local_verify_step400_full.json |
M3 Max speed and SHA checks |
results/local_verify_step400_dial.json |
Apply / eject timings |
Limitations
- The test set is 97 items. The McNemar p-value is small, and the gain is 34 items, but 97 is still a small set.
- One item was lost (
searchHolidays). - Elimination of thinking traces is part of why the scorer moves.
- The mask covers the top 64 routed experts per layer, not all 128.
- Absolute tok/s still moves with machine state.
Model tree for austindixson/Inkling-2-Mini-ToolCall-Cartridge
Base model
thinkingmachines/Inkling-2-Mini