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
Surprisingly capable model for its size. A few problems.
Great to see a US company that's catching up to China on small models.
I've used it half a day with my agent (on RTX Pro 6000) and its remarkably capable for its size and the speed is good with Dspark.
The first problem was that the speculator doesn't work on SM120 chips, even though the vllm recipe implies that it should work on DGX Spark. For the solution, see the patch that my Qwen3.8-flash-next agent created at:
https://github.com/Steven0236/inkling2mini-sm120-speculator-fix
On the vision side, he model's capability to locate items using bounding boxes is very good.
However, out of a dozen attempts, it got stuck in endless thinking loops twice:
First Loop:
The image shows "temple" — the letters are rotated 90° counterclockwise — the 't' is at the BOTTOM and the letters ascend: t-e-m-p-l-e — reading bottom-to-top — rotated 90° CCW!
Wait — no. Looking at the image: "temple" — the letters are rotated 90° clockwise — the 't' is at the TOP and the letters descend: t-e-m-p-l-e — reading top-to-bottom — rotated 90° CW!
OK — I need to be honest with myself. The image shows "temple" — the 't' is at the TOP-LEFT of the box and the letters descend — actually looking at the rendered image: "temple" — the letters are rotated 90° counterclockwise — the 't' is at the BOTTOM and the letters ascend: t-e-m-p-l-e — reading bottom-to-top — rotated 90° CCW!
OK — I've been going back and forth. Let me settle this definitively by looking at the image carefully one final time:
The image shows "temple" — the letters are rotated 90° counterclockwise — the 't' is at the BOTTOM and the letters ascend: t-e-m-p-l-e — reading bottom-to-top — rotated 90° CCW!
...
Second Loop:
OK — I'll extend the box left to x=0 (it's already at x=0). The 'p' descender — looking at the image: the 'p' — the descender extends to the LEFT of the box — the orange border line at x=0 — the 'p' descender — looking at the image: the 'p' — the descender extends to x=0 — at the very edge of the box!
Hmm — wait — actually looking at the image: the orange box — the left edge — the 'p' descender — looking at the image: the 'p' — the descender extends to the LEFT of the box — the orange border line at x=0 — the 'p' descender — looking at the image: the 'p' — the descender extends to x=0 — at the very edge of the box!
OK — I'll extend the box left to x=0 (it's already at x=0). The 'p' descender — looking at the image: the 'p' — the descender extends to the LEFT of the box — the orange border line at x=0 — the 'p' descender — looking at the image: the 'p' — the descender extends to x=0 — at the very edge of the box!
...
running it with my default genpars (temperature 1.0, top_p 0.95, top_k 20, presence_penalty 0.0, repetition_penalty 1.0, and max_tokens 60000). Maybe increasing repetition penalty might help. I haven't tried it yet.