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
vLLM Inkling-2-Mini NVFP4 on a single RTX 3090 (24 GB): working port, 128k context, DSpark
We got Inkling-2-Mini running on one consumer Ampere GPU (RTX 3090, SM86, TP=1) using the original NVFP4/MXFP8 checkpoint, with no re-quantization. The code is a fork of vLLM PR #69028:
https://github.com/Hiutaky/vllm (branch ampere-port, see INKLING2-RTX3090.md)
What we changed (all in vllm/models/inkling2)
- Made the Hopper/Blackwell-only paths work on Ampere: PDL gated to SM90+, no TMA below SM90, a Triton fallback for
conv_mix, FA2 for the vision tower, minimum capability lowered to 80. - Emulated the FP8 (E4M3) KV cache in software, since Ampere has no hardware E4M3 conversions. Our encoder matched
torch.float8_e4m3fnon 10M random values. - DSpark speculative decoding works (it needs exactly 7 speculative tokens). The draft KV cache stays in bf16.
- Squeezed VRAM for the KV cache: vision tower removed (text only), prefill chunk of 256, FP8 KV, an explicit KV budget, and the embedding table offloaded to CPU memory (
--cpu-offload-params embed_tokens).
Hopper and Blackwell code paths are untouched: every new branch is guarded by a device-capability check.
Results (single RTX 3090)
| Decode with DSpark | 112β147 tok/s (91 tok/s without it) |
| Prefill | ~2,500β2,700 tok/s up to 33k tokens, ~1,870 tok/s at 126k |
| Context | 131,072 tokens |
| KV pool | 207k tokens with 8 concurrent sequences (224k with 2) |
| Weights on GPU | 17.55 GiB (18.41 GiB without the embedding offload) |
| Embedding offload cost | decode β β1%, prefill β1% to β3% |
We ran 8 concurrent requests (2k to 17k tokens each) without errors, and tool calling works with the inkling parser. VRAM is tight (about 23.8 of 24 GB used).
Caveats
- We have not re-run quality benchmarks (HumanEval+, IFEval) with FP8 KV + DSpark, and FP8 KV is a precision change.
- The vision tower is disabled in this configuration.
- We only tested on a 3090 with the vLLM nightly image plus our Python overlay. We have not measured other GPUs.
- Speculative decoding acceptance was about 20β29% in our tests.
Feedback and tests on other Ampere cards (3080 Ti, 3090 Ti, A5000, A6000) are welcome.
Was able to reproduce it on a 3090 and, when skipping DSpark, 256k context was able to fit (gpu util 0.98). Have been using it for a little bit to verify it's stable, my harness compacts when passing 75% (~190k ctx) and haven't had an issue.
Prefill peaks between 2.5k and 4.5k depending on depth, token generation speed falls almost perfectly linearly, ~90 t/s at the start, ~64 t/s at 197k used up context. For my personal uses doubling the max kv is more useful than the ~1.4x speedup, hence why I opted out of using DSpark.
Thank you for the work on supporting this model, it does seem like a decent one for limited ram.
