Image-Text-to-Text
MLX
Safetensors
inkling2_loop
apple-silicon
Mixture of Experts
dspark
speculative-decoding
mlx-vlm
conversational
4-bit precision
Instructions to use netprojects/Inkling-2-Mini-LayerFit-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use netprojects/Inkling-2-Mini-LayerFit-MLX-4bit 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("netprojects/Inkling-2-Mini-LayerFit-MLX-4bit") config = load_config("netprojects/Inkling-2-Mini-LayerFit-MLX-4bit") # 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 netprojects/Inkling-2-Mini-LayerFit-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/Inkling-2-Mini-LayerFit-MLX-4bit"
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": "netprojects/Inkling-2-Mini-LayerFit-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use netprojects/Inkling-2-Mini-LayerFit-MLX-4bit 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 "netprojects/Inkling-2-Mini-LayerFit-MLX-4bit"
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 netprojects/Inkling-2-Mini-LayerFit-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use netprojects/Inkling-2-Mini-LayerFit-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/Inkling-2-Mini-LayerFit-MLX-4bit"
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 "netprojects/Inkling-2-Mini-LayerFit-MLX-4bit" \ --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"
|
Download README.md from netprojects/Inkling-2-Mini-LayerFit-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 15.3 kB
-
https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-4bit/resolve/main/README.md
- Command line
-
hf download hf://netprojects/Inkling-2-Mini-LayerFit-MLX-4bit/README.md
-
curl -L -o README.md https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-4bit/resolve/main/README.md
15.3 kB
| license: apache-2.0 | |
| license_link: https://www.apache.org/licenses/LICENSE-2.0 | |
| base_model: thinkingmachines/Inkling-2-Mini | |
| base_model_relation: quantized | |
| pipeline_tag: image-text-to-text | |
| library_name: mlx | |
| tags: | |
| - mlx | |
| - apple-silicon | |
| - inkling2_loop | |
| - moe | |
| - dspark | |
| - speculative-decoding | |
| - mlx-vlm | |
| # Inkling 2 Mini for Apple Silicon (MLX, 4-bit LayerFit) | |
| ✅ Works with stock mlx-vlm (main now, next release) · OpenAI tool calls via [inkling2-mlx](https://github.com/internet-projects/inkling2-mlx) | |
| [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (revision `6e7c824`) for MLX on | |
| Apple Silicon, with its DSpark speculative-decoding draft bundled (`mtp.safetensors`) and its vision encoder included. | |
| This build uses standard MLX affine quantization with a per-layer recipe found by our **LayerFit™** search: each group of layers gets its own bits, chosen by measuring how much each choice changes the model's output. The routed experts, re-quantized from their released NVFP4 / MXFP8 values, are 4-bit or 5-bit (group 64) depending on the layer and projection, with the up projection of layer 19 at 3-bit (group 128) and the gate projection of layer 18 at 3-bit. Attention is 8-bit (group 64) in layers 0–18 and 6-bit in layers 19–23. Embeddings are 5-bit, the output layer is 6-bit and the vision encoder is 4-bit (all group 64). The full per-layer recipe is in `quant-recipe.json`. Size: 16.5 GB plus the 0.64 GB draft, the same as the plain 4-bit build it replaces; the 4/8-bit build keeps the released expert values exactly. | |
| Inkling 2 Mini is Thinking Machines' looped mixture-of-experts model: 26.4B parameters, about 3.4B active per token, | |
| 24 layers of which the middle twelve run three times (48 layer passes per token), text and image input, up to 1M tokens of context. | |
| <!-- mac-picker:start --> | |
| ## Which build fits my Mac? | |
| Each pick leaves room for macOS and a long prompt (the download is at most about 60% of your memory). Other models for your Mac: [which build fits my Mac?](https://huggingface.co/netprojects). | |
| | Your Mac | Build | | |
| |---|---| | |
| | 16 GB ⚡ stretch | [2-bit mixed, built for 16 GB Macs](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-2bit) (9.5 GB) | | |
| | 24 GB | [2.5-bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-2.5bit) (10.8 GB) | | |
| | 32 GB | [3-bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-3bit) (14.1 GB) | | |
| | 32 GB, more fidelity | **[4-bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-4bit) (16.5 GB)** (this build) | | |
| | 48 GB and up | [4/8-bit, recommended](https://huggingface.co/netprojects/Inkling-2-Mini-MLX-4-8bit) (19.5 GB) | | |
| ⚡ *Stretch:* close other apps, keep prompts to a few thousand tokens, and let the GPU use more memory with `sudo sysctl iogpu.wired_limit_mb=12800` (lasts until restart). | |
| <!-- mac-picker:end --> | |
| ## Builds | |
| | Build | Size | Same next token as Thinking Machines' code | KL vs their code | GSM8K (50 questions) | Peak memory, 8K-token prompt | | |
| |---|---|---|---|---|---| | |
| | [netprojects/Inkling-2-Mini-MLX-4-8bit](https://huggingface.co/netprojects/Inkling-2-Mini-MLX-4-8bit) (recommended) | 19.5 GB + 0.64 GB draft | 98.4% | 0.0018 | 47/50 | 27.8 GB | | |
| | [netprojects/Inkling-2-Mini-LayerFit-MLX-3bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-3bit) | 14.1 GB + 0.64 GB draft | 95.5% | 0.0225 | 45/50 | 21.4 GB | | |
| | [netprojects/Inkling-2-Mini-LayerFit-MLX-2.5bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-2.5bit) | 10.8 GB + 0.64 GB draft | 91.0% | 0.0656 | 46/50 | 18.25 GB | | |
| | [netprojects/Inkling-2-Mini-LayerFit-MLX-2bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-2bit) | 9.5 GB + 0.64 GB draft | 90.2% | 0.1066 | 47/50 | 17.05 GB | | |
| | [netprojects/Inkling-2-Mini-LayerFit-MLX-4bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-4bit) | 16.5 GB + 0.64 GB draft | 97.7% | 0.0101 | 46/50 | 23.6 GB | | |
| "Thinking Machines' code" is their Transformers implementation of Inkling 2 Mini, run on the released weights; the | |
| columns are explained under "What was checked". | |
| <!-- layerfit-card:start --> | |
| ## LayerFit: same size, closer to the original | |
| **LayerFit** is how NetProjects builds its small quants. A plain build squeezes every layer the same way, but layers are | |
| not equal: some lose a lot when squeezed, others barely notice. LayerFit measures each part of each layer on its own, | |
| then searches for the recipe that stays closest to the original model at a fixed size, and spends the bits where they | |
| matter. Every LayerFit recipe is scored against the original model before we publish it. The result is a normal MLX | |
| build: it loads in stock MLX-VLM, with no custom runtime. At the same 16.5 GB, this build is much closer to Thinking Machines' code than the plain 4-bit files it replaced (mean KL 0.0101 instead of 0.0291); see "What changed". | |
| | Inkling 2 Mini, same size | Same next token as Thinking Machines' code | KL vs their code | | |
| |---|---|---| | |
| | Plain 4-bit, 16.5 GB | 95.9% | 0.0291 | | |
| | **LayerFit 4-bit, 16.5 GB (this build)** | **97.7%** | **0.0101 (65% lower)** | | |
| All Inkling 2 Mini LayerFit builds: [4-bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-4bit) · [3-bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-3bit) · [2.5-bit](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-2.5bit) · [2-bit, for 16 GB Macs](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-2bit). Also: [Qwen3.8-27B LayerFit](https://huggingface.co/netprojects/Qwen3.8-27B-LayerFit-MLX-4bit). | |
| <!-- layerfit-card:end --> | |
| ## What changed (26 November 2026) | |
| The files in this repository were replaced by a new 4-bit LayerFit build (it was called `netprojects/Inkling-2-Mini-MLX-4bit` | |
| before; the old name redirects here). The earlier build was plain affine 4-bit (group 64) everywhere. The new build chooses the bits for each group of layers | |
| (the recipe is in `quant-recipe.json`) at the same size, 16.5 GB. It loads in stock MLX-VLM like before and includes the | |
| same DSpark draft. | |
| | | Earlier files | New files | | |
| |---|---|---| | |
| | Same next token as Thinking Machines' code | 95.9% | 97.7% | | |
| | KL vs their code | 0.0291 | 0.0101 | | |
| | Greedy answers matching theirs, 3 prompts (tokens out of 24) | 4, 24, 24 | 4, 14, 24 | | |
| | GSM8K (50 questions) | 47/50 | 46/50 | | |
| | Our LayerFit test texts, against our 4/8-bit build: same next token / KL | 98.6% / 0.0064 | 99.1% / 0.0025 | | |
| The first four rows use the same 12 chat texts and 50 questions as before (the earlier numbers are the ones this card | |
| showed). The last row comes from the separate, larger set of texts the LayerFit search is scored on, so it is not | |
| comparable with the rows above. Greedy answers differ in single tokens where the top two choices are very close, so that | |
| row moves both ways. The earlier files are still available at revision | |
| [`7b7f6ee19afc`](https://huggingface.co/netprojects/Inkling-2-Mini-LayerFit-MLX-4bit/tree/7b7f6ee19afc15d30557d8160bb32551f379df94). If you downloaded this build before 26 November 2026, download it | |
| again to get the new files. | |
| ## Install | |
| Inkling 2 Mini is supported in MLX-VLM itself since 21 November 2026 (not yet in a PyPI release). Use MLX-VLM from main | |
| (Python 3.10 or newer): | |
| ```bash | |
| pip install "git+https://github.com/Neywa-Labs/mlx-vlm" torch torchvision | |
| ``` | |
| or, to also get OpenAI `tool_calls` from `mlx_vlm.server`, [internet-projects/inkling2-mlx](https://github.com/internet-projects/inkling2-mlx) (the same MLX-VLM plus | |
| Inkling's tool-call parser): | |
| ```bash | |
| pip install "git+https://github.com/internet-projects/inkling2-mlx@v0.2.7" torch torchvision | |
| ``` | |
| PyTorch and torchvision are only used on the CPU by the image processor. On 21 November 2026 this repository's weight files | |
| were updated to the tensor names MLX-VLM uses (a rename of the loop-gate tensors; the values are unchanged): if you | |
| downloaded this build before, download it again. | |
| ## Use | |
| ```python | |
| from mlx_vlm import load, generate | |
| from mlx_vlm.prompt_utils import apply_chat_template | |
| model, processor = load("netprojects/Inkling-2-Mini-LayerFit-MLX-4bit") | |
| prompt = apply_chat_template(processor, model.config, "Explain in two sentences why the sky is blue.", | |
| reasoning_effort="low") | |
| print(generate(model, processor, prompt, max_tokens=2048, temperature=0.0).text) | |
| ``` | |
| `reasoning_effort` is part of Inkling's chat template: `none`, `minimal`, `low`, `medium`, `high` (the default), `xhigh`, | |
| `max`, or a number from 0.0 to 0.99. Thinking Machines notes that the model can think at length even at `none` and can get | |
| stuck in long reasoning loops, so set `max_tokens`. | |
| With an image: | |
| ```python | |
| prompt = apply_chat_template(processor, model.config, "What error does this terminal show?", num_images=1, reasoning_effort="low") | |
| print(generate(model, processor, prompt, image=["screenshot.png"], max_tokens=2048).text) | |
| ``` | |
| With the DSpark draft (greedy output stays the model's own, up to near-ties): | |
| ```python | |
| from mlx_vlm.speculative.drafters import load_drafter | |
| draft, kind = load_drafter("netprojects/Inkling-2-Mini-LayerFit-MLX-4bit") | |
| print(generate(model, processor, prompt, max_tokens=2048, draft_model=draft, draft_kind=kind, | |
| draft_block_size=4).text) | |
| ``` | |
| Server: `mlx_vlm.server --model netprojects/Inkling-2-Mini-LayerFit-MLX-4bit --draft-model netprojects/Inkling-2-Mini-LayerFit-MLX-4bit --draft-kind dflash --draft-block-size 4`. | |
| OpenAI-compatible server, with tool calls and the thinking returned separately (`reasoning_content`): | |
| ```bash | |
| mlx_vlm.server --model netprojects/Inkling-2-Mini-LayerFit-MLX-4bit --port 8000 | |
| ``` | |
| ## Speed | |
| MacBook Pro M5 Max (128 GB), idle, 21 November 2026; median of 3 runs. Decode: 5 prompts (math, code, chat) × 256 tokens, greedy, reasoning `none`. DSpark: the bundled draft at its best block size. | |
| | Build | Prompt processing, 1K / 8K / 32K tokens (tok/s) | Generation (tok/s) | Generation with DSpark (tok/s) | | |
| |---|---|---|---| | |
| | 4-8bit | 1752 / 1658 / 1208 | 36.6 | 47.1 (×1.29, block 3) | | |
| | 4bit (this build) | 1535 / 1412 / 1104 | 43.6 | 70.9 (×1.63, block 4) | | |
| | 3bit | 1386 / 1351 / 1075 | 44.4 | 75.2 (×1.69, block 4) | | |
| | 2.5bit | not measured | not measured | not measured | | |
| | 2bit | not measured | not measured | not measured | | |
| The draft's default block size (8) is slower on this model; use 3 or 4 as below. | |
| With [inkling2-mlx](https://github.com/internet-projects/inkling2-mlx) v0.2.6 (faster decode and prompt reading, on by default; same greedy text as the original MLX-VLM, KL max 0.014), on the 4-bit build plain generation is 84.1 tok/s with a 1K prompt and 79.7 tok/s with an 8K prompt (original MLX-VLM: 40.7 / 38.5; v0.2.4: 59.5 / 57.2), and a 256-token chat answer runs at 86.4 tok/s (MLX-VLM 36.7). DSpark (block 4) reaches 125.0 tok/s at 1K on text that repeats earlier text, but on ordinary chat it is now slower than plain generation (64.3 tok/s), so use DSpark for code edits and rewrites and plain generation for chat (greedy, 23 November 2026; a separate run from the table above). Prompt reading (prefill) is 12-16% faster than in earlier versions: 1642 tok/s at 8.7K and 1608 tok/s at 16K (was 1467 / 1382). `INKLING2_FAST_DECODE=0` switches back. With v0.2.7, sampled DSpark checks drafts with speculative sampling (same output law as plain generation): on the 4-bit build a rewrite at temperature 1.0 runs at 97.4 tok/s with DSpark vs 83.3 plain (with top-p 0.95: 96.6 vs 82.0), while chat stays faster without DSpark (25 November 2026, 256 tokens, median of 3). | |
| ## Thinking Machines' results | |
| From the [Inkling 2 Mini card](https://huggingface.co/thinkingmachines/Inkling-2-Mini), for the original model (their | |
| harnesses and settings; a selection of their table): | |
| | Benchmark (Thinking Machines' figures) | Inkling 2 Mini | Qwen3.8-27B | Gemma 4 31B | | |
| |---|---|---|---| | |
| | Artificial Analysis Intelligence Index v5.0 | 20.1 | 20.1 | 4.4 | | |
| | SWE-bench Verified (bash only) | 79.2% | 77.8% | 46.1% | | |
| | SWE-bench Pro v2 Hard (mini-swe-agent) | 77.9% | 73.8% | 14.2% | | |
| | Terminal-Bench 2.1 (pi) | 71.6% | 73.0% | 43.4% | | |
| | BrowseComp (with compaction) | 79.0% | 61.6% | 37.0% | | |
| | MCP Atlas | 82.7% | 77.3% | 54.2% | | |
| | MMMU Pro | 74.9% | 76.3% | 73.4% | | |
| | OmniDocBench v1.6 | 92.8% | 91.5% | 82.5% | | |
| | LongBench v2 | 66.9% | 52.3% | 52.9% | | |
| | ARC-AGI v1 / v2 | 84.5 / 49.3% | 87.5 / 42.4% | – | | |
| ## What was checked | |
| On the same MacBook Pro M5 Max (128 GB) as the other builds, 26 November 2026, for the LayerFit files of this build, with [inkling2-mlx](https://github.com/internet-projects/inkling2-mlx) v0.2.4 (MLX-VLM plus Inkling's tool-call parser). | |
| - **Against Thinking Machines' code.** Their Transformers implementation (pull request #51050) ran on the CPU with the | |
| released weights, on 12 short chat texts (488 answer positions). This build gave the same next token at | |
| 97.7% of positions (mean KL 0.0101), and its greedy answers to 3 prompts matched theirs for the first 4, 14, 24 of 24 tokens. | |
| - **GSM8K, 50 fixed test questions** (reasoning `none`, greedy): 46/50. | |
| - **Tool calling** (reasoning `none`): an agent prompt with `bash` and `read` tools produced a well-formed call in Inkling's | |
| format, which `mlx_vlm.server` returns as OpenAI `tool_calls`. | |
| - **Coding:** 3/3 short Python tasks passed their asserts. **Thinking** (reasoning `low`): 2/2 | |
| questions answered correctly after one closed thinking block. **Vision:** named the red square and blue circle of a test image. | |
| - **Memory** (inkling2-mlx v0.2.4 defaults): weights 16.5 GB; peak 22.67 GB with a 4K-token prompt, 23.59 GB with an 8K-token prompt and 29.41 GB with a 32K-token prompt. With a smaller prefill step the peak drops (measured on the earlier files, which are the same size): 17.9 / 18.2 GB at `prefill_step_size=512` and 16.9 / 17.1 GB at `prefill_step_size=256` (4K / 8K-token prompts, plus 0.64 GB if the DSpark draft is loaded), which fits the default GPU memory limit of a 32 GB Mac: pass `prefill_step_size=256` to `generate`, or `--prefill-step-size 256` to `mlx_vlm.server`. | |
| - **DSpark:** the bundled draft loads with this build; greedy output follows the model's own except at near-ties (checked: divergences only where the top two tokens were within 0.2 logits). Speeds are under "Speed". | |
| Known limitation of the current server: when the model calls a tool, `content` can also carry a short sentence of its | |
| reasoning and the tool name. | |
| ## License and credits | |
| Apache-2.0, as Inkling 2 Mini. Use of the model is also governed by Thinking Machines' | |
| [Model Acceptable Use Policy](https://thinkingmachines.ai/model-acceptable-use-policy/). `LICENSE` is the Apache-2.0 | |
| text and `NOTICE` describes the conversion. Inkling 2 Mini is by Thinking Machines Lab; please cite their work. | |
| <!-- lfcoll -->All LayerFit builds, one pick per model: [LayerFit MLX builds](https://huggingface.co/collections/netprojects/layerfit-mlx-builds-6b0ad24ace6f450872d036e5). | |
| Published by [NetProjects](https://netprojects.com) (Internet Projects Ltd). LayerFit™ is a NetProjects trademark. Not affiliated with Thinking Machines. | |
| More MLX builds from NetProjects: [huggingface.co/netprojects](https://huggingface.co/netprojects) · [netprojects.com](https://netprojects.com) | |