Instructions to use thinkingmachines/Inkling-2-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thinkingmachines/Inkling-2-Mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="thinkingmachines/Inkling-2-Mini") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("thinkingmachines/Inkling-2-Mini") model = AutoModelForMultimodalLM.from_pretrained("thinkingmachines/Inkling-2-Mini", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thinkingmachines/Inkling-2-Mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thinkingmachines/Inkling-2-Mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/Inkling-2-Mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/thinkingmachines/Inkling-2-Mini
- SGLang
How to use thinkingmachines/Inkling-2-Mini with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "thinkingmachines/Inkling-2-Mini" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/Inkling-2-Mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thinkingmachines/Inkling-2-Mini" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/Inkling-2-Mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use thinkingmachines/Inkling-2-Mini with Docker Model Runner:
docker model run hf.co/thinkingmachines/Inkling-2-Mini
Inkling 2 Mini writes tool calls as XML text and loops in reasoning, on three different engines
I'm running Inkling 2 Mini on a single RTX 5090 (32 GB) as a coding-agent backend with a 10-tool Qwen Code CLI. I see the same failure on three independent engines, so I think it comes from the model and not from any one server.
Setup
- GPU: RTX 5090, driver 595.99, CUDA 13.4. Server default sampling (temperature 1.0) unless noted.
- Engines: Basalt (current main), squid5090, and the stock
vllm/vllm-openai:inkling-2-miniimage (vLLM 0.1.dev25855), with the official reasoning and tool-call parsers. Caveat on vLLM: the image is built for CUDA archs 10.0 and 10.3 only (collect_envreportsCUDA Archs: 10.0+PTX 10.3+PTX), so on a 5090 (arch 12.0) it relies on PTX fallbacks and some kernels are missing (DSpark doesn't run at all). The failures look like model output, but I can't rule out an effect of that on the vLLM numbers. - Weights: the official checkpoint on squid (exact mode, bf16) and vLLM. Basalt uses its own q8 repack.
- Test: 50 single-turn prompts, each needing one tool call, with the real tool schemas from the CLI.
What goes wrong
- The call is written as text. The model writes the tool call as XML in the message content instead of a structured call (
<invoke name="edit_file">…,<tool_call><function_calls>…, bare args JSON,functions.-prefixed XML). - It reopens thinking after the thinking block ends or the budget closes. In one logged case the next token was a near tie between starting another thinking block (0.45) and starting the call (0.36). Greedy decoding picks thinking, and that block runs to the token limit.
- Deterministic reasoning loops at temperature 0. In some cases the model restarts its reasoning after "I'll call the tool now" and repeats until the token limit.
- Lower reasoning effort doesn't help. Low, minimal and none halve the tokens but raise the number of calls written as prose.
Numbers (valid calls out of 50)
| Setup | t=0 | t=0, tool_choice=required |
t≥0.6 |
|---|---|---|---|
| vLLM stock, fp8 KV (*) | 35 | 47 | 35 (t=0.6) |
| vLLM stock, bf16 KV (*) | 25 | 46 | 25 (t=0.6) |
| squid exact, bf16 | 10 | ignored | 13–25 |
| Basalt current main | 50 | 50 | 44–48 (t=0.6), 40–47 (t=1.0) |
(*) vLLM image not built for the 5090's architecture, see the caveat above. The official-weights runs that don't have this issue are squid exact mode and the forum reports in discussion #21 (SGLang).
Questions
- Is writing the call as XML text expected for this checkpoint at sampling temperatures? If the model needs a specific system prompt or tool format, what is it?
- Is there a recommended temperature or sampling setup for tool use?
- Is the reopening of thinking after a close a known behavior, and is a logit ban on
<|content_thinking|>the intended fix?
I can share request logs, the probe harness and the logprob dump.