TLDR;Inkling 2 Mini 是一种新型循环 Transformer 模型。它是一个多模态混合专家(Mixture-of-Experts)模型,拥有约 260 亿的物理总参数量和每个 token 30 亿的活动参数量。它使用了一个巧妙的技巧来增加容量:部分层在一个重复三次的循环中被访问,这使得它表现得像是拥有更多参数一样。它支持 100 万 token 的上下文大小,并接受图像和文本输入。Thinking Machines Lab 以混合精度格式发布该模型,包含 NVFP4 和 MXFP8 专家权重。此外还包含一个 DSpark 草稿生成器,以较小的内存代价提供额外的加速效果。
Inkling 2 Mini 比 Inkling 2 Small 小得多,专为本地 AI 设置而设计。我们认为这是一款令人耳目一新的优秀本地模型。在我们的直观测试中,它的表现至少可与 Qwen 3.8 27B 相媲美。还需要更多的验证,但我们对这次发布感到非常兴奋!
我们提供 Transformer、Llama App(llama.cpp)和 MLX 支持。SGLang 也为数据中心硬件上的生产部署提供了零天推理支持。
本文介绍了 Inkling Mini 的不同之处、我们的一些直观测试结果,以及你如何将其用于你的设置。
Inkling 2 Mini 有什么新特性?
Inkling 2 Mini 是一个混合专家模型,拥有 24 个解码器层,但中间的 12 个层在循环中运行三次。因此,该模型表现得好像拥有 48(6 + 3*12 + 6)个逻辑层,而实际上只有 24 个物理层。
与 Inkling 2 Small 类似,Inkling 2 Mini 每个 token 执行 48 次层访问。隐藏层大小为 2,304,而不是 4,608。在每次层访问中,两种变体都将 token 路由到 8 个专家,但 Mini 从每层的 128 个专家中选择,而 Small 从 384 个专家中选择。
解码器运行第 0–5 层一次,第 6–17 层三次,以及第 18–23 层一次。通过第 6–17 层的三次传递重用相同的权重。
Nanbeige 等架构此前曾探索过循环技术。但 Inkling 2 Mini 探索了一种有趣的方法。每次通过循环核心(第 6–17 层)时,都从相同的输入开始,即前六层的输出。信息通过跨传递消息在传递之间移动。每个循环层从其自身的学习查询(一个用于其查询、键、值和多感知层输入的查询)中读取来自前一次传递输出的消息。然后,一个小型门控控制器查看该层的当前输入和消息。它决定忘记多少当前输入以及添加多少消息。因此,每次传递都细化了前一次计算的结果。
每个六层块包含五个滑动窗口层和一个全注意力层。局部窗口最多容纳 1,024 个 token。
注意力机制使用 24 个查询头和八个 KV 头。它使用学习到的相对位置对数几率、一个学习到的吸收点(sink)和一个输出门。全注意力层使用动态键和值卷积。
路由器为每个 token 从 128 个 SwiGLU 专家中选择八个。它对选定的分数进行归一化,并将权重乘以 8。
在第 2 和第 3 次传递期间,每个核心层关注来自前一次传递的两个残差块。四个秩为 64 的门将单独的消息混合到查询、键、值和 MoE 输入中。
文本解码器宽度为 2,304,每个专家的中间宽度为 1,152。重用核心权重减少了检查点存储的不同层数。该模型仍然执行所有 48 次访问,并且每次访问都保留其自己的 KV 和短卷积状态。
除了旗舰版 Inkling 2 Mini 模型外,还发布了一个研究产物。它共享相同的架构,但这个变体被训练为接受可变数量的循环传递 🤯。将设置改为 1 或 2 次传递而不是 3 次将使推理运行速度快得多,但生成的质量可能略低。我们测试了这个变体,它确实有效,但我们尚未对其进行深入评估。
基准测试结果
在 Artificial Analysis Intelligence Index v5 (AAv5) 中,Inkling 2 Mini 在其类别中处于领先地位,并在各类别的众多基准测试中表现优异。与 Gemma 4 31B、Muse Glimmer、Qwen3.8-27B 和 Nemotron 3.5 Super VL 相比,Inkling 2 Mini 在 48 项基准测试中的 32 项中领先。这些测试涵盖编码与自动研究、知识工作的代理搜索与工具使用、视觉解读与创作、推理与知识,以及安全与对齐等方面。请参阅 Inkling 2 Mini 模型卡片以获取完整的基准测试列表和分数。
Inkling 2 Mini 是一款出色的本地编码助手。它在 FrontierCode v2.0 中领先,在 Terminal-Bench 4.0 中与 Qwen3.8-27B 持平,但在 AutomationBench-AA v1.0.6 中落后于 Qwen。您可以查看下方我们列出的关于编码和知识工作的一些亮点。请注意,AA Briefcase 采用 ELO 评级,分数越高越好。
推理支持
在本节中,您可以了解如何在 transformers、llama.cpp、MLX 和 SGLang 中使用 Inkling 2 Mini。
Transformers
我们为 Inkling 2 Mini(固定循环)和 TML-d24-varloop-research(可变循环)研究变体提供支持。
使用 Inkling 2 Mini 的固定循环
您可以使用 AutoModelForMultimodalLM 类。
import torch
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)
input_len = inputs[ "input_ids" ].shape[- 1 ]
outputs = model.generate(**inputs, max_new_tokens= 1024 )
print (processor.decode(outputs[0][input_len:], skip_special_tokens= False ))
可变循环
要在研究检查点中设置循环次数,您可以按如下方式修改 text_config 中的 loop_num_passes。下面的示例使用两个循环。
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
model_id = "thinkingmachines/TML-d24-varloop-research"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(
model_id,
text_config={ "loop_num_passes" : 2 },
)
messages = [{ "role" : "user" , "content" : [{ "type" : "text" , "text" : "Why is the sky blue?" }]}]
inputs = processor.apply_chat_template(
messages, reasoning_effort= "medium" , tokenize= True , add_generation_prompt= True , return_dict= True , return_tensors= "pt" ,
).to(model.device)
input_len = inputs[ "input_ids" ].shape[- 1 ]
outputs = model.generate(**inputs, max_new_tokens= 1024 )
print (processor.decode(outputs[0][input_len:], skip_special_tokens= False ))
图像与文本
对于图像提示,请将上述任一示例中的 messages 替换为以下列表,并按常规进行推理。
messages = [
{
"role" : "user" ,
"content" : [
{ "type" : "image" , "image" : "/path/to/image.jpg" },
{ "type" : "text" , "text" : "What is in this image?" },
],
}
]
推理力度
向 processor.apply_chat_template(...) 传递 reasoning_effort="medium" 以设置请求的推理力度。聊天模板会将数值作为系统消息添加到提示中。默认值为 high (0.9)。
inputs = processor.apply_chat_template(
messages, reasoning_effort= "medium" , tokenize= True , add_generation_prompt= True , return_dict= True , return_tensors= "pt" ,
).to(model.device)
可用的级别包括 none (0.0)、minimal (0.1)、low (0.2)、medium (0.7)、high (0.9; 默认值)、xhigh (0.99) 和 max (0.99)。您也可以传递 0.0 到 0.99 之间的数字,例如 reasoning_effort=0.35 。
工具调用
让我们让模型调用一些工具。
在这个示例中,我们向模型询问给定位置的当前温度。通过提示词(prompt),我们还提供了用于执行此操作的工具(get_current_temperature)。模型请求调用工具,我们代表它调用该工具,然后将输出添加到下一个指令集中。它利用工具的输出来为我们提供最终结果。
如果您想了解有关工具调用的更多信息,我们建议您查阅我们的官方文档。
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
model_id = "thinkingmachines/Inkling-2-Mini"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map= "auto" )
def get_current_temperature ( location: str , unit: str ):
"""
Get the current temperature at a location.
Args:
location: The location to get the temperature for, in the format "City, Country"
unit: The unit to return the temperature in. (choices: ["celsius", "fahrenheit"])
"""
return 22.0
def ask ( messages ):
inputs = processor.apply_chat_template(
messages, tools=[get_current_temperature], reasoning_effort= "low" , tokenize= True , return_dict= True , return_tensors= "pt"
).to(model.device)
output = model.generate(**inputs, max_new_tokens= 1024 )[ 0 ][inputs[ "input_ids" ].shape[- 1 ] :]
parsed = processor.parse_response(output, prefix=inputs[ "input_ids" ][ 0 ])
return parsed
messages = [{ "role" : "user" , "content" : "Hey, what's the temperature in Paris right now?" }]
reply = ask(messages)
call = reply[ "tool_calls" ][ 0 ][ "function" ]
print ( "Model calls:" , call[ "name" ], call[ "arguments" ])
temperature = get_current_temperature(**call[ "arguments" ])
messages += [reply, { "role" : "tool" , "name" : call[ "name" ], "content" : str (temperature)}]
print (ask(messages)[ "content" ])
Llama App 和 Llama.cpp
Llama App 让您能够轻松地在 macOS(从菜单栏)或 Windows(系统托盘)上运行和管理本地语言模型。它由同一团队基于 llama.cpp 构建。该应用还提供了与 OpenAI 兼容的本地 API,便于与编码代理、编辑器和脚本集成。
针对 Inkling 2 Mini 发布,我们为这两个模型提供了 GGUF 4-bit (IQ4_NL) 和 8-bit (Q8_0) 量化版本。
如果您使用的是 Linux 系统,或者希望从命令行界面(CLI)提供模型服务,您可以对固定循环(fixed-loop)模型运行以下命令:
llama serve -hf ggml-org/Inkling-2-Mini-GGUF:IQ4_NL
要运行可变循环(variable-loop)模型,您可以执行:
llama serve -hf ggml-org/TML-d24-varloop-research-GGUF:IQ4_NL
若要加载 8-bit 权重,请将后缀更改为 :Q8_0 。
在此处,我们要求 4-bit 模型为一个名为“植物疗法”(Plant Therapy)的 SaaS 网站制作网页,该平台将植物与持证治疗师进行匹配。模型非常自主,它为自己网站的视觉效果制作了 SVG 图形,甚至构建了匹配逻辑。
SGLang
Inkling 2 Mini 在 SGLang 中提供 Day 0 支持。您可以安装最新版本的 SGLang 并执行以下命令以启动服务器。其中一个必要的前提条件是将其运行在 SM103 上。
export MODEL= "thinkingmachines/Inkling-2-Mini"
python -m sglang.launch_server \
--model-path $MODEL \
--served-model-name inkling \
--attention-backend fa4 --bf16-gemm-backend torch --dtype bfloat16 \
--tp 1 --page-size 128 --grammar-backend xgrammar \
--host 0.0.0.0 --port 30000
服务器启动后,您应该能够像这样请求 API:
curl -s localhost:30000/health_generate && echo OK
curl -s localhost:30000/v1/models | python -m json.tool
curl -s localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "inkling",
"messages": [{"role": "user", "content": "What is 17 times 24?"}],
"max_tokens": 512,
"reasoning_effort": "low"
}' | python -m json.tool
还可以通过设置 --enable-multimodal 来启用多模态功能。
推测解码
SGLang 可以使用三层 DSpark 草稿为待验证的目标模型提议 token。该草稿读取解码器在第 5、23 和 41 次访问时的输入,以及索引 48 处的最终归一化状态。在存在草稿权重的情况下,请向服务器命令添加 --speculative-algorithm DSPARK --context-length 131072。
我们对有无推测解码(speculative decoding)的模型进行了基准测试,并在单块 NVIDIA B300 GPU 上测量了生成速度,其中每个请求包含 1,024 个 token 的提示词,并精确生成 1,024 个 token,并发数分别为 1、4、16 和 64。
显示 SGLang 基准测试脚本
MODEL=thinkingmachines/Inkling-2-Mini
for TAG in base mtp; do
EXTRA= "" ; [ $TAG = mtp ] && EXTRA= "--speculative-algorithm DSPARK"
python -m sglang.launch_server --model-path $MODEL \
--attention-backend fa4 --bf16-gemm-backend torch --dtype bfloat16 \
--tp 1 --page-size 128 --context-length 131072 --max-running-requests 64 \
--port 30000 $EXTRA > $TAG . log 2>&1 &
until curl -sf localhost:30000/health_generate > /dev/null; do sleep 10; done
for C in 1 4 16 64; do
python -m sglang.bench_serving --backend sglang --port 30000 --model $MODEL \
--dataset-name random --apply-chat-template \
--random-input-len 1024 --random-output-len 1024 --random-range-ratio 1.0 \
--num-prompts $(( C 4 < 32 ? 32 : C 4 )) --max-concurrency $C \
--output-file results_ $TAG .jsonl
done
kill %1; wait
done
MLX
我们将 MLX 支持上游提交到了 mlx-lm 项目,包括多模态图像和文本输入,并通过 mlx-community 组织共享了量化模型。
MLX 推理也适用于原始检查点(checkpoint)。在这种情况下,使用原生的 nvfp4 + mxfp8 量化方案而无需重新转换:您将得到作者原本意图的原始质量。
以下是示例 CLI 调用:
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
演示与直观测试
我们让 Inkling 2 Mini 尝试了许多有趣的任务,请在本节中查看。
3D 着色器飞行漫游
相同的提示词生成了两个程序化山脉和反射水面上的日落飞行漫游,每个均由单个 WebGL 片段着色器渲染。
Sunset Ridge (Inkling 2 Mini)
Over the Still Sea (Qwen 3.8 27B)
显示共享的飞行漫游提示词
构建你能做到的最令人印象深刻的原始实时场景:缓慢的电影式镜头飞越程序化山脉,穿过体积云,低空掠过带有反射的水面,所有光线均由日落提供。将其作为当前目录中的单个自包含 index.html 交付,所有内容均通过代码在单个全屏 WebGL 片段着色器中渲染(不使用任何纹理、图像、字体、库、外部文件或任何形式的网络请求)。它必须在桌面 Chrome 上以 1920x1080 分辨率流畅运行,目标是在桌面 GPU 上达到 60 fps,并具备自动分辨率缩放回退机制,当帧率下降时降低内部渲染分辨率,且飞行必须无限期持续而无故障。为了检查你的工作,请运行 node shot.cjs index.html shot.png 6(第三个参数是等待的秒数;逗号分隔列表如 3,12,25 可保存每张时间点的截图,第四个可选参数设置大小,默认为 1280x720):它将在无头 Chrome 中渲染页面,保存截图,并打印 WebGL 渲染器、粗略帧率和任何控制台错误;然后查看图像。此机器上的无头渲染器可能仅支持软件渲染,因此其帧率可能远低于真实桌面 GPU 达到的水平,且并非目标。由你自己决定何时完成结果,然后回复一段简短的描述说明你构建了什么。
星月夜,栩栩如生
文森特·梵高,《星月夜》(1889)
Inkling 2 Mini 重现
我们为 Inkling 2 Mini 提供了梵高画作的参考图像,并在 Pi 编码环境中使用了截图辅助工具。Inkling 生成了一个自包含的 HTML 页面,其中仅包含一个 WebGL2 片段着色器。该着色器通过代码绘制场景,无需加载参考图像或其他任何资源。它利用时间变量来驱动动画效果:旋转的天空、星星的光芒、摇曳的柏树以及村庄窗户的闪烁。
Inkling 经过 24 轮截图检查,对其作品进行了渲染和审查。我们在 Apple M4 Max 设备上以 1080p 分辨率和 60 fps 帧率逐帧录制了最终的动画画面。
显示提示词
在此文件夹中,starry-night.jpg 是文森特·梵高的《星月夜》(1889年,公有领域)。将其重现为一幅动态画作:一个自包含的 index.html(所有代码位于
TLDR; Inkling 2 Mini is a new looped transformer model. It’s a multimodal Mixture-of-Experts with ~26B physical total and 3B active parameters per token. It uses a neat trick to increase capacity: some layers are visited in a loop that repeats three times, which makes it work like it had more parameters. It supports a 1M-token context size, accepts images and text inputs. Thinking Machines Lab ships the model in a mixed-precision format, with NVFP4 and MXFP8 expert weights. A DSpark drafter is also included for additional speed-up at a small memory cost.
Inkling 2 Mini is much, much smaller than Inkling 2 Small, and is designed for local AI setups. We think this is a refreshingly new great local model. In our vibe tests, it's at least comparable with Qwen 3.8 27B. More validation is needed, but we are super excited about this release!
We ship transformers, Llama App (llama.cpp), and MLX support. SGLang also provides day-zero inference support for production deployments on datacenter hardware.
This post goes through what makes Inkling Mini different, some of our vibe tests, and how you can use it with your setup.
What is new with Inkling 2 Mini?
Inkling 2 Mini is a mixture-of-experts model with 24 decoder layers, but the 12 middle layers run three times in a loop. Therefore, the model acts as if it had 48 (6+ 3*12 + 6) logical layers with just 24 physical ones.
Similar to Inkling 2 Small, Inkling 2 Mini executes 48 layer visits per token. The hidden size is 2,304 instead of 4,608. At each layer visit, both variants route the token to 8 experts, but Mini selects them from among 128 experts per layer, while Small selects from 384.
The decoder runs layers 0–5 once, layers 6–17 three times, and layers 18–23 once. All three passes through layers 6–17 reuse the same weights.
Architectures such as Nanbeige have explored looping before. But Inkling 2 Mini explores an interesting approach. Every pass through the looped core (layers 6–17) starts from the same inputs which is the output of the first six layers. Information moves between passes through cross-pass messages . Each looped layer reads a message from the previous pass's outputs with its own learned query (one message for its query, key, value and MLP inputs). A small gating controller then looks at both the layer's current input and the message. It decides how much of the current input to forget and how much of the message to add. Each pass therefore refines what the previous one computed.
Each six-layer block has five sliding-window layers and one full-attention layer. The local window holds up to 1,024 tokens.
Attention uses 24 query heads and eight KV heads. It uses learned relative position logits, a learned sink, and an output gate. Full-attention layers use dynamic key and value convolutions.
The router selects eight of 128 SwiGLU experts for each token. It normalizes the selected scores and scales the weights by 8.
During passes 2 and 3, each core layer attends over two residual blocks from the previous pass. Four rank-64 gates mix separate messages into the query, key, value, and MoE inputs.
Text decoder width is 2,304, and the intermediate width of each expert is 1,152. Reusing core weights reduces the number of distinct layers the checkpoint stores. The model still executes all 48 visits, and each visit keeps its own KV and short-convolution state.
In addition to the flagship Inkling 2 Mini model, a research artifact has also been released. It shares the same architecture, but this variant was trained to accept a variable number of passes through the loop 🤯. Setting 1 or 2 passes instead of 3 will make inference run a lot faster, but generations may be of slightly lower quality. We tested this variant, and it works, but we haven’t evaluated it in depth.
Benchmark Results
Inkling 2 Mini is state-of-the-art in its class in the Artificial Analysis Intelligence Index v5 (AAv5), as well as across many benchmarks in various categories. Compared with Gemma 4 31B, Muse Glimmer, Qwen3.8-27B, and Nemotron 3.5 Super VL, Inkling 2 Mini leads in 32 benchmarks out of 48. These cover coding and autoresearch, agentic search and tool use for knowledge work, vision interpretation and creation, reasoning and knowledge, and safety and alignment. See the Inkling 2 Mini model card for the full list of benchmarks and scores.
Inkling 2 Mini is a great local coding companion. It leads in FrontierCode v2.0, ties with Qwen3.8-27B on Terminal-Bench 4.0, and trails Qwen on AutomationBench-AA v1.0.6. You can check out a few of our highlights below for coding and knowledge work. Note that AA Briefcase is in ELO rating, higher is better.
Inference Support
In this section, you can find how to use Inkling 2 Mini in transformers, llama.cpp, MLX, and SGLang.
Transformers
We provide support for both Inkling 2 Mini (fixed loop) and the TML-d24-varloop-research (variable loop) research variant.
Fixed loop with Inkling 2 Mini
You can use the AutoModelForMultimodalLM class.
import torch
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)
input_len = inputs[ "input_ids" ].shape[- 1 ]
outputs = model.generate(**inputs, max_new_tokens= 1024 )
print (processor.decode(outputs[ 0 ][input_len:], skip_special_tokens= False ))
Variable loop
To set the number of loops in the research checkpoint, you can modify the loop_num_passes in text_config as follows. The example below uses two loops.
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
model_id = "thinkingmachines/TML-d24-varloop-research"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(
model_id,
text_config={ "loop_num_passes" : 2 },
)
messages = [{ "role" : "user" , "content" : [{ "type" : "text" , "text" : "Why is the sky blue?" }]}]
inputs = processor.apply_chat_template(
messages, reasoning_effort= "medium" , tokenize= True , add_generation_prompt= True , return_dict= True , return_tensors= "pt" ,
).to(model.device)
input_len = inputs[ "input_ids" ].shape[- 1 ]
outputs = model.generate(**inputs, max_new_tokens= 1024 )
print (processor.decode(outputs[ 0 ][input_len:], skip_special_tokens= False ))
Images and text
For an image prompt, replace messages in either example with the list below and infer as usual.
messages = [
{
"role" : "user" ,
"content" : [
{ "type" : "image" , "image" : "/path/to/image.jpg" },
{ "type" : "text" , "text" : "What is in this image?" },
],
}
]
Reasoning Effort
Pass reasoning_effort="medium" to processor.apply_chat_template(...) to set the effort for a request. The chat template adds the numeric value to the prompt as a system message. The default is high (0.9).
inputs = processor.apply_chat_template(
messages, reasoning_effort= "medium" , tokenize= True , add_generation_prompt= True , return_dict= True , return_tensors= "pt" ,
).to(model.device)
Available levels are none (0.0), minimal (0.1), low (0.2), medium (0.7), high (0.9; default), xhigh (0.99), and max (0.99). You can also pass a number from 0.0 to 0.99, such as reasoning_effort=0.35 .
Tool calling
Let’s get our model to call some tools.
In this example we ask our model about the current temperature at a given location. With the prompt, we also provide the tool ( get_current_temperature ) to do it. The model asks for a tool call, we call the tool on its behalf and then add the output to the next instruction set. It uses the output of the tool and provides us with the final result.
If you want to know more about tool calling, we recommend going to our official docs .
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
model_id = "thinkingmachines/Inkling-2-Mini"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map= "auto" )
def get_current_temperature ( location: str , unit: str ):
"""
Get the current temperature at a location.
Args:
location: The location to get the temperature for, in the format "City, Country"
unit: The unit to return the temperature in. (choices: ["celsius", "fahrenheit"])
"""
return 22.0
def ask ( messages ):
inputs = processor.apply_chat_template(
messages, tools=[get_current_temperature], reasoning_effort= "low" , tokenize= True , return_dict= True , return_tensors= "pt"
).to(model.device)
output = model.generate(**inputs, max_new_tokens= 1024 )[ 0 ][inputs[ "input_ids" ].shape[- 1 ] :]
parsed = processor.parse_response(output, prefix=inputs[ "input_ids" ][ 0 ])
return parsed
messages = [{ "role" : "user" , "content" : "Hey, what's the temperature in Paris right now?" }]
reply = ask(messages)
call = reply[ "tool_calls" ][ 0 ][ "function" ]
print ( "Model calls:" , call[ "name" ], call[ "arguments" ])
temperature = get_current_temperature(**call[ "arguments" ])
messages += [reply, { "role" : "tool" , "name" : call[ "name" ], "content" : str (temperature)}]
print (ask(messages)[ "content" ])
Llama App and Llama.cpp
Llama App lets you easily run and manage local language models on macOS (from the menu bar) or Windows (system tray). It’s built on llama.cpp, and by the same team. The app also provides a local OpenAI-compatible API for easy integration with coding agents, editors, and scripts.
For the Inkling 2 Mini release we provide GGUF 4-bit ( IQ4_NL) and 8-bit ( Q8_0 ) quants for both models.
If you’re on Linux or you want to serve the model from the CLI, you can run the following command for the fixed-loop model:
llama serve -hf ggml-org/Inkling-2-Mini-GGUF:IQ4_NL
To run the variable-loop model, you can run
llama serve -hf ggml-org/TML-d24-varloop-research-GGUF:IQ4_NL
To load the 8-bit weights, change the suffix to :Q8_0 .
Here we ask the 4-bit model to make a website to a SaaS called plant therapy where plants get matched to licensed therapists. Model is quite autonomous, it has made its own SVGs for the visuals on the website, and even built the matching logic.
SGLang
Inkling 2 Mini comes with Day 0 support inside SGLang. You can install the latest version of SGLang and execute the following to get the server up and running. One prerequisite to take care of is to run it on SM103 .
export MODEL= "thinkingmachines/Inkling-2-Mini"
python -m sglang.launch_server \
--model-path $MODEL \
--served-model-name inkling \
--attention-backend fa4 --bf16-gemm-backend torch --dtype bfloat16 \
--tp 1 --page-size 128 --grammar-backend xgrammar \
--host 0.0.0.0 --port 30000
After the server is up you should be able to request the APIs like so
curl -s localhost:30000/health_generate && echo OK
curl -s localhost:30000/v1/models | python -m json.tool
curl -s localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "inkling",
"messages": [{"role": "user", "content": "What is 17 times 24?"}],
"max_tokens": 512,
"reasoning_effort": "low"
}' | python -m json.tool
One can also enable multimodality by setting --enable-multimodal .
Speculative decoding
SGLang can use a three-layer DSpark draft to propose tokens for the target model to verify. The draft reads the inputs to decoder visits 5, 23, and 41, plus the final normalized state at index 48. With the draft weights present, add --speculative-algorithm DSPARK --context-length 131072 to the server command.
We benchmarked the models with and without speculative decoding, and measured generation speed on a single NVIDIA B300 GPU where every request has a 1,024-token prompt and generates exactly 1,024 tokens and concurrency of 1, 4, 16 and 64.
Show SGLang benchmarking script
MODEL=thinkingmachines/Inkling-2-Mini
for TAG in base mtp; do
EXTRA= "" ; [ $TAG = mtp ] && EXTRA= "--speculative-algorithm DSPARK"
python -m sglang.launch_server --model-path $MODEL \
--attention-backend fa4 --bf16-gemm-backend torch --dtype bfloat16 \
--tp 1 --page-size 128 --context-length 131072 --max-running-requests 64 \
--port 30000 $EXTRA > $TAG . log 2>&1 &
until curl -sf localhost:30000/health_generate > /dev/null; do sleep 10; done
for C in 1 4 16 64; do
python -m sglang.bench_serving --backend sglang --port 30000 --model $MODEL \
--dataset-name random --apply-chat-template \
--random-input-len 1024 --random-output-len 1024 --random-range-ratio 1.0 \
--num-prompts $(( C 4 < 32 ? 32 : C 4 )) --max-concurrency $C \
--output-file results_ $TAG .jsonl
done
kill %1; wait
done
MLX
We upstreamed MLX support to the mlx-lm project, including multimodal image and text inputs, and shared quants through the mlx-community organization.
MLX inference works with the original checkpoint too. In this case, the native nvfp4 + mxfp8 quantization scheme is used without reconversion: you get the original quality the authors intended.
Here’s an example CLI invocation:
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
Demos and Vibe Tests
We have given Inkling 2 Mini a shot in many fun tasks, check them out in this section.
3D shader flythroughs
The same prompt produced two sunset flythroughs over procedural mountains and reflective water, each rendered with a single WebGL fragment shader.
Sunset Ridge (Inkling 2 Mini)
Over the Still Sea (Qwen 3.8 27B)
Show shared flythrough prompt
Build the most impressive original real-time scene you can: a slow, cinematic camera flight over procedural mountains, through volumetric clouds and low over water with reflections, all lit by a sunset. Deliver it as a single self-contained index.html in the current directory that renders everything in one full-screen WebGL fragment shader, purely from code (no textures, images, fonts, libraries, external files or network requests of any kind). It must run smoothly in desktop Chrome at 1920x1080, aiming for 60 fps on a desktop GPU, with an automatic resolution-scale fallback that lowers the internal render resolution when the frame rate drops, and the flight must keep going indefinitely without glitches. To check your work, run node shot.cjs index.html shot.png 6 (the third argument is how many seconds to wait; a comma list such as 3,12,25 saves one screenshot per time, and an optional fourth argument sets the size, default 1280x720): it renders the page in headless Chrome, saves the screenshot(s), and prints the WebGL renderer, a rough frame rate and any console errors; then look at the images. The headless renderer on this machine may be software-only, so its frame rate can be far below what a real desktop GPU achieves and is not the target. Decide for yourself when the result is finished, then reply with a short description of what you built.
Starry Night, Alive
Vincent van Gogh, The Starry Night (1889)
Inkling 2 Mini recreation
We gave Inkling 2 Mini a reference image of Van Gogh’s painting and a screenshot helper in the Pi coding harness. Inkling wrote a self-contained HTML page with a single WebGL2 fragment shader. The shader draws the scene from code without loading the reference image or any other assets. It uses time to animate the swirling sky, the glow of the stars, the swaying cypress, and the flicker of the village windows.
Inkling rendered and reviewed its work over 24 rounds of screenshot checks. We recorded the final animation frame by frame at 1080p and 60 fps on an Apple M4 Max.
Show prompt
In this folder, starry-night.jpg is Vincent van Gogh's The Starry Night (1889, public domain). Recreate it as a living painting: a single self-contained index.html (all code in
首次收录 · 2026-11-21 · 9.95 分