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
- 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
sm_120 support for dflash/speculative decoding
Is there going to be a support for speculative decoding for sm_120 gpus?
I also noticed this problem when attempting the vllm recipe on RTX Pro 6000.
I had my agent (running Qwen 3.8 Flash) investigate and solve the problem. Here's the information:
- Symptom: the DSpark drafter crashed on RTX PRO 6000 Blackwell (sm_120) at the key-normalization line in the hand-written drafter kernels.
- Root cause part one: the shipped kernels carry no sm_120 cubins β the fa3 library loaded by the drafter's KV-cache write carries only sm_75 binaries.
- Root cause part two: FlashInfer's precompiled RMSNorm has no native switch β patched with plain torch fp32 math.
- Root cause part three: the low-M matrix-multiply path in linear.py picks FlashInfer CuTe-DSL when use_sm100_kernels β same class of problem.
- Isolated probes (norm class, argmax, reshape at real shapes) all passed β the failure was at library-load time, not the math.
- Nsight Systems profiling recorded a kernel-image miss at library-load time, pointing at the sm_75-only fa3 library.
- Fix part one: patch the container's RMSNorm with plain torch fp32 math.
- Fix part two: swap in the official vLLM 0.34.0 core extension (_C_stable_libtorch.abi3.so β 69 sm_120 binaries, including the reshape and cache kernels).
- Fix part three: restore the ENTRYPOINT (vllm serve) β the prep container had baked in "sleep".
- Verified after relaunch: DSpark live, output on a 128k prompt: prose: 318 t/s, python code: 410 tok/s, roughly 3x the drafter-off baseline.
I've created a github repo with a simple script to patch the vllm docker image.
See: https://github.com/Steven0236/inkling2mini-sm120-speculator-fix
Enjoy!
thank you i will try it
For anyone on SGLang instead of vLLM: the SGLang cookbook's rtx6000 DSpark recipe ran on an RTX PRO 6000 Blackwell (sm_120) as printed, with the stock lmsysorg/sglang:inkling-2-mini image (sha256:efac853b46811ccb760545b7b29e7119bdf907537ccf6e863fac3011fe8b98de), no patches.
- Chat (
sglang.benchmark.serving, 12 ShareGPT prompts, 1024 output tokens, one request at a time): 231.3 output tok/s with DSpark, 159.5 with the cookbook's Balanced recipe (no drafter). End-to-end, prefill included. - Mean accept length 2.71 on chat, 2.27β2.38 on 20kβ120k-token prompts (
--speculative-num-draft-tokens 8). - FP8 KV (
--kv-cache-dtype fp8_e4m3) fails with--attention-backend fa4:q.dtype torch.bfloat16 != k.dtype torch.float8_e4m3fnin_flash_attn_fwdduring CUDA graph capture. bf16 KV works.
One card, one run per config. Flags, logs and the rest of the numbers: https://github.com/adcostanza/benchmarks/tree/main/inkling2-mini-vs-qwen38-27b