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
Inkling-2-Mini served on 2x RTX 5060 Ti 16 GB (SM120): full docker-compose + pp/tg/context benchmarks
Sharing a fully working serving setup for the unverified corner of the recipe: 2x GeForce RTX 5060 Ti 16 GB (SM120) with the official vllm/vllm-openai:inkling-2-mini image + bind-mounted sm_120 patches (root-cause work by hyudryu and vllm#69081; DSpark patch from Lewfkrad).
Repo (docker-compose + patches + bench scripts + all numbers): https://github.com/accelerando-developers/Inkling-2-Mini-2xRTX5060Ti
Model: https://huggingface.co/thinkingmachines/Inkling-2-Mini (profile: https://open-llm-radar.com/models/inkling-2-mini)
Final healthy config (2x 5060 Ti TP2, display on an untouched RTX 3060, second 5060 Ti on an Oculink PCIe-4.0-x4 dock, no P2P -> PYNCCL all-reduce):
--kv-cache-dtype fp8(~20 KiB/token),--kv-cache-memory 4600000000(4.28 GiB/GPU, pinned explicitly),--gpu-memory-utilization 0.94--max-model-len 100000,--max-num-seqs 8,--max-num-batched-tokens 2048,--disable-custom-all-reduce, DSpark K=4 (patcheddspark.py)- runtime VRAM 15,347/16,311 MiB per card; boot 2-7 min
Benchmarks (own measurements, temp 0):
- pp/tg per context, single user: 4k: 1,868/122 | 16k: 5,274/122 | 65k: 4,129/125 | 96k: 4,577/108 tok/s (decode flat across context with fp8-KV)
- DSpark K=4 A/B (bf16-KV, 16k ctx, 512 out tok): prose 57.8 -> 55.3 (-4%), code 70.5 -> 160.7 (+128%), structured list 70.8 -> 80.2 (+13%), 4-user aggregate 117.2 -> 81.1 (-31%)
- Context ladder (fp8 + DSpark): 16k OK, 65k OK, 131k fails (needs 4.48 GiB vs 4.28 GiB available; engine max estimate 110,976) -> 100k OK, needle-in-haystack with a 82,002-token prompt found correct code (needle at 35% position, 34.3 s incl. 1,200 decoded tokens)
Traps worth repeating for other SM120 setups (all fail as "no kernel image" at unrelated async lines):
- Image is built
TORCH_CUDA_ARCH_LIST="10.0+PTX 10.3+PTX"only; TP2 additionally needs the unfused sharded-embedding path +--disable-custom-all-reduce. - Pin the extensible KV cache via
--kv-cache-memory(engine prints exact suggested bytes); the warm-up reserve bug needsKV_CACHE_WARMUP_RESERVE_FRACTION0.10 -> 0.25. - Default
--max-num-seqs 1024preallocates multi-GiB block tables - set 8-16 on small cards.
Happy to share more logs or run specific benchmarks on request.
Benchmark 1 β pp/tg vs context (single user, DSpark K=4 + fp8-KV, temp 0)
| Request ctx | pp tok/s | tg tok/s |
|---|---|---|
| 4,096 | 1,868 | 122.1 |
| 16,384 | 5,274 | 121.7 |
| 65,536 | 4,129 | 124.5 |
| 96,000 | 4,577 | 107.7 |
Decode is flat across context (fp8-KV paged layers + sliding-window layers keep per-token cost nearly constant).
pp dips at 4k only because the first chunk includes one-off compile; warmed repeats sit ~4β5K.
Benchmark 2 β DSpark K=4 A/B (bf16-KV, 16k ctx, 512 out tokens)
| Prompt type | Baseline (no DSpark) | DSpark K=4 | Ξ |
|---|---|---|---|
| Novel prose | 57.8 tok/s | 55.3 tok/s | β4 % |
| Code (Python) | 70.5 tok/s | 160.7 tok/s | +128 % |
| Structured list | 70.8 tok/s | 80.2 tok/s | +13 % |
| 4 users, aggregate | 117.2 tok/s | 81.1 tok/s | β31 % |
| 4 users, per stream | 31.6 tok/s | 20.8 tok/s | β34 % |
Read: keep DSpark on for code/agent work; switch it off for prose- or multi-user-heavy serving.
Benchmark 3 β context/memory ladder (DSpark + fp8-KV)
| max_model_len | result |
|---|---|
| 16,384 | boots clean |
| 65,536 | boots clean |
| 131,072 | fails: needs 4.48 GiB vs 4.28 GiB available; engine estimate max 110,976 |
| 100,000 | boots β needle-in-haystack at 82,002-token prompt found β (needle at 35 % position, 34.3 s incl. 1,200 decoded tokens) |
Spec-decode counters over the mixed bench run: 1,884 draft steps / 1,728 accepted tokens (~0.9/step avg across prompts incl. prose; code-type prompts pull acceptance well above 2.5).