Inkling 2 Mini on your computer: transformers, llama.cpp and MLX

Inkling 2 Mini on your computer: transformers, llama.cpp and MLX
Inkling 2 Mini on your computer: the looped model with transformers, llama.cpp, MLX and SGLang
I also explain it in this video, on my Articulator EN channel. The figures in this post are frames from the video.
32 GBof memory for the 4-bit version (IQ4_NL)
20.1 = 20.1a tie with Qwen3.8-27B on the Artificial Analysis index
×4.4more tokens per second with DSpark, measured on a B300
13 / 13checks passed by the app it built from a napkin sketch

What Inkling 2 Mini islink

It's a multimodal mixture of experts: about 26 billion parameters in total, but only 3 billion active per token. It understands images and text and supports a one-million-token context. Its trick for getting more capacity is a loop: some layers are visited three times in a row, so it works as if it had more parameters than it actually stores.

It ships in mixed precision: the expert weights come in NVFP4 and MXFP8 (four and eight bits), and it includes a small draft model, DSpark, that speeds up generation at the cost of a little extra memory.

It's much smaller than its big sibling, Inkling 2 Small, and it's designed for local use. In the Hugging Face team's informal "vibe" tests it's "at least comparable" with Qwen 3.8 27B, though they say more validation is needed. From day one it works with transformers, llama.cpp and MLX, and on datacenter servers with SGLang.

24 layers, 48 visitslink

The model has 24 layers. The first six (0-5) run once; the twelve in the middle (6-17) run three times, always with the same weights; and the last six (18-23), once again. Six, plus three times twelve, plus six: 48 logical layers from just 24 physical ones.

Like Inkling 2 Small, it makes 48 layer visits per token. The difference is size: Mini has a hidden width of 2,304 (half of Small's 4,608), and while both send each token to eight experts, Mini picks them from 128 per layer and Small from 384.

Layers 0-5 run once, 6-17 three times with the same weights, and 18-23 once: 48 visits from 24 layers
Six, plus three times twelve, plus six: 48 visits from 24 layers.

Cross-pass messageslink

Looping layers isn't new (Nanbeige had tried it). What's interesting here is how information flows: every pass through the core starts from the same input, the output of the first six layers. What the previous pass learned arrives another way, as cross-pass messages.

Each looped layer reads a message from the previous pass with its own learned query, and prepares a separate one for the query, key, value and experts. Then a small gate looks at the current input and the message and decides how much of the input to forget and how much of the message to add. That way, each pass refines what the last one computed.

The post's figure adds detail: each six-layer block has five sliding-window layers (up to 1,024 tokens back) and one full-attention layer; attention uses 24 query heads and 8 key-value heads; and the router picks 8 of 128 SwiGLU experts, normalizes their scores and scales the weights by 8.

Each looped layer reads a message from the previous pass and a gate decides how much to forget and how much to add
The gate decides how much of the input to forget and how much of the message to add.

It saves on storage, not on computelink

One important detail if you plan to run it locally: reusing the weights reduces how many distinct layers the checkpoint stores, but the model still runs all 48 visits, and each one keeps its own key-value cache. The loop saves weight memory, not compute.

The variable-loop variantlink

Besides the main model there's a research variant, TML-d24-varloop-research, with the same architecture but trained to accept a variable number of passes. With one or two instead of three, inference runs much faster, though answers may come out slightly worse. The team says they tested it and it works, but they haven't evaluated it in depth.

How it performs: headline vs. figurelink

According to the post, it's state of the art in its class on the Artificial Analysis Intelligence Index (AAv5) and, against Gemma 4 31B, Muse Glimmer, Qwen3.8-27B and Nemotron 3.5 Super VL, it leads in 32 of 48 benchmarks across coding, agentic search, vision, reasoning and safety. The full list is in the model card.

But the post's own figure qualifies that headline. On the Artificial Analysis index, Inkling 2 Mini scores 20.1, and Qwen3.8-27B scores exactly the same: it's a tie. These are the six benchmarks in the figure:

BenchmarkInkling 2 MiniQwen3.8-27BResult
AA Intelligence Index v520.120.1Tie
FrontierCode 2.015.1%14.9%Narrow win
DeepSWE v1.148.2%42.2%Win
Terminal-Bench 4.05.6%5.6%Tie
AutomationBench-AA v1.0.641.8%48.2%Loss
AA-Briefcase v1.1 (Elo)1,2631,391Loss

Behind the two on the index come Nemotron (13.6), Muse Glimmer (6.3) and Gemma (4.4). The post's text does acknowledge that it trails on AutomationBench, but it doesn't mention AA-Briefcase, where Qwen is also clearly ahead.

Artificial Analysis index: Inkling 2 Mini 20.1 and Qwen3.8-27B 20.1, a tie
The headline says "best in class"; the figure says it's a tie with Qwen.

With transformerslink

There are two models: thinkingmachines/Inkling-2-Mini, with a fixed three-pass loop, and thinkingmachines/TML-d24-varloop-research, with a variable loop. For the first one, all you need is AutoModelForMultimodalLM and its processor:

from transformers import AutoModelForMultimodalLM, AutoProcessor

model_id = "thinkingmachines/Inkling-2-Mini"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(model_id)

messages = [{"role": "user", "content": [{"type": "text", "text": "Why is the sky blue?"}]}]
inputs = processor.apply_chat_template(
    messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024)

With the research variant, you choose the number of passes when loading the model, in the text config: text_config={"loop_num_passes": 2} means two passes through the core instead of three. And asking about an image takes nothing extra: the message carries an {"type": "image", "image": "/path/to/image.jpg"} item next to the text.

Reasoning effort and toolslink

The reasoning_effort parameter goes to apply_chat_template, which adds its value as a system message. There are seven levels, and any number from 0 to 0.99 also works (for example, 0.35):

Levelnoneminimallowmediumhighxhighmax
Value0.00.10.20.70.9 (default)0.990.99

And it can call tools. In the post's example it gets a function that returns the temperature of a place and is asked what the temperature is right now in Paris. The model requests the call and fills in the arguments itself (location: "Paris, France", unit: "celsius"); the program runs the function, which returns 22, passes it back as a tool message, and the model answers that it's about 22 °C.

The seven reasoning_effort levels, from none (0) to max (0.99)
How much it reasons, as a number.

On your computer with llama.cpplink

The easiest way is the Llama app (llama.app), for Mac and Windows: pick the GGUF version you want on the Hub, click "Use this model" and choose Llama. There are two quantizations:

  • IQ4_NL, recommended for most people: the NVFP4 weights are converted to a different 4-bit format and the MXFP8 ones stay in 8 bits. It fits in 32 GB of GPU memory or unified memory, like a Mac's.
  • Q8_0: nearly lossless, but it needs more memory and runs a bit slower.

On Linux, or if you prefer the terminal, there's a one-line installer and an OpenAI-compatible server that plugs into agents like Pi or ChatGPT Desktop:

curl -LsSf https://llama.app/install.sh | sh
llama serve -hf ggml-org/Inkling-2-Mini-GGUF:IQ4_NL
# :Q8_0 for the 8-bit version, or the research variant:
llama serve -hf ggml-org/TML-d24-varloop-research-GGUF:IQ4_NL

To test the 4-bit version, they asked it, in a single sentence, for a website for a made-up business, Plant Therapy, which matches house plants with licensed therapists so they don't die. The model drew its own SVG graphics and coded the logic that finds the right therapist for each plant.

The Plant Therapy website coded by the 4-bit version of Inkling 2 Mini
Plant Therapy, built by the 4-bit model from one sentence.

On a server: SGLang and DSparklink

For production in the datacenter, SGLang supports it from day zero, with one requirement: a GPU with the SM103 architecture. You launch the server on port 30000 and test it with three calls (health, model list and a question, "What is 17 times 24?", with reasoning_effort: "low"); with --enable-multimodal it also accepts images.

This is where DSpark comes in, for speculative decoding: a three-layer draft that proposes several tokens ahead, and the big model only has to verify them. To propose them, it reads the inputs to decoder visits 5, 23 and 41 plus the final state (index 48). You enable it with --speculative-algorithm DSPARK --context-length 131072.

They measured it on a single NVIDIA B300, with requests of 1,024 tokens in and 1,024 out:

Concurrent requestsWithout DSparkWith DSparkSpeed-up
133.6 tok/s147.8 tok/s×4.4
4126.8 tok/s534.6 tok/s×4.2
16434.5 tok/s1,620.5 tok/s×3.7
641,319.9 tok/s4,058.8 tok/s×3.1

Time per token drops from 29.7 to 5.2 ms with one request, and from 47.5 to 10.9 ms with 64. Keep in mind it's measured on a datacenter GPU with SGLang, not on a laptop.

With DSpark, from 33.6 to 147.8 tokens per second with one request: 4.4 times more
DSpark: the draft proposes, the big model verifies.

On a Mac: MLXlink

Support is already in mlx-lm, with images and text, and there are quantized versions in the mlx-community organization. The neatest part is that it works with the original weights: it uses their native NVFP4 + MXFP8 format without converting it, so you get the quality the authors intended.

mlx_lm generate --model thinkingmachines/Inkling-2-Mini --image image.jpg --prompt "Describe this image.<|end_message|><|message_user|><|content_image|><|unused_200054|>" -m 1000

The testslink

Hugging Face put it through several "vibe tests". They aren't measurements, but they show what it can do:

  • 3D worlds: from a single prompt it created two sunset flights over mountains and reflecting water, all inside a single WebGL shader, with no textures or images. The prompt asked for 60 fps, lowering the resolution if it stutters, and checking the result with screenshots taken by a script.
  • The Starry Night, alive: they gave it Van Gogh's painting and a screenshot tool in the Pi agent harness. It wrote a page with a single shader that paints the scene from code, without loading the painting, and animates the swirling sky, the stars, the cypress and the village windows. It reviewed its work over 24 rounds of screenshots; they recorded it at 1080p and 60 fps on an M4 Max Mac.
  • From a napkin to an app: from a photo of a hand-drawn sketch of Trip Split, an app to share trip costs, it built the expense list, the form and the balances in a single HTML file; they recalculate and are saved in the browser. They ran three attempts and tested them with Playwright; the first passed all 13 checks: add the $90 dinner and the total goes from $405 to $495.
  • Turning itself into a browser agent: paired with the Pi coding agent, using Helium, Chromium and Hugging Face Sandboxes, it built the tool that turns it into an agent; the traces and the final file are published in a bucket.
Van Gogh's Starry Night recreated by Inkling 2 Mini with a shader
The Starry Night, painted from code.
The hand-drawn Trip Split sketch and the app Inkling 2 Mini built
From napkin to app: 13 out of 13 checks.

To sum uplink

Inkling 2 Mini runs its middle layers three times and, according to Hugging Face's figure, matches Qwen3.8-27B on the overall index, with wins and losses depending on the benchmark. In 4 bits it fits in 32 GB, and you can use it today with transformers, llama.cpp, MLX or SGLang.

In one sentence

A looped model that fits in 32 GB and that you can try today with the tool you already use.

Are you going to try it on your computer? With which tool?

Sourceslink

Continue reading

Last posts -->

Have you seen these projects?

Gymnasia

Gymnasia Gymnasia
Expo
React Native
TypeScript
OpenAI
Anthropic

Fitness app with two agents that run entirely on the device, with no backend, so the user's data never leaves the phone. A BYOK conversational coach with local tools and a remote system prompt with offline fallback, plus a food estimator that pulls macronutrients out of a photo of the plate, with barcode scanning against OpenFoodFacts.

LangGraph Deep Researcher

LangGraph Deep Researcher LangGraph Deep Researcher
Python
LangGraph
FastAPI
React
TypeScript
Docker

Multi-agent research system built with LangGraph. A supervisor breaks your question down into topics and launches search sub-agents in parallel; each one compresses its findings before handing them to a writer agent that produces the final sourced markdown report. Live streaming over WebSockets, a configurable model per role and bring-your-own API keys that are never persisted server-side.

Tau

Tau Tau
Python
LangChain

Multi-agent tutoring system for secondary school students, with one agent per subject and course material written and validated by a team of teachers. It was used with real students at a private school in Spain and at a secondary school in Colombia.

View all projects -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to watch any talk?

Last talks -->

Do you want to improve with these tips?

Last tips -->

Use this locally

Hugging Face spaces allow us to run models with very simple demos, but what if the demo breaks? Or if the user deletes it? That's why I've created docker containers with some interesting spaces, to be able to use them locally, whatever happens. In fact, if you click on any project view button, it may take you to a space that doesn't work.

Flow edit

Flow edit Flow edit

FLUX.1-RealismLora

FLUX.1-RealismLora FLUX.1-RealismLora
View all containers -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to train your model with these datasets?

short-jokes-dataset

HuggingFace

Dataset with jokes in English

Use: Fine-tuning text generation models for humor

231K rows 2 columns 45 MB
View on HuggingFace →

opus100

HuggingFace

Dataset with translations from English to Spanish

Use: Training English-Spanish translation models

1M rows 2 columns 210 MB
View on HuggingFace →

netflix_titles

HuggingFace

Dataset with Netflix movies and series

Use: Netflix catalog analysis and recommendation systems

8.8K rows 12 columns 3.5 MB
View on HuggingFace →
View more datasets -->