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
cortiq 0.9.15: Inkling-2-Mini at 220 tok/s (298 with DSpark) and 14K tok/s prompts on one RTX PRO 6000
An update to #18. cortiq 0.9.15 is out, and the CMF build of Inkling-2-Mini now carries the release's DSpark drafter: https://huggingface.co/infosave/Inkling-2-Mini-cmf (one file, Inkling-2-Mini-q4tp.cmf, 15.12 GB, every weight on one 24 GB card).
Fastest results, NVIDIA RTX PRO 6000 Blackwell, CUDA:
| Decode | 220.1 tok/s |
| Decode with DSpark, JSON / Python code | 298.2 / 279.9 tok/s |
| Prompt of 2 048 tokens | 0.15 s (14.0K tok/s) |
| Prompt of 32 768 tokens | 2.69 s (12.2K tok/s), then 182.1 tok/s decode in 20.7 GB |
Other hardware:
- NVIDIA L4 (24 GB), CUDA: 50.9 tok/s, with DSpark 70.8 on code and 63.8 on JSON; a 32 768-token prompt in 31.5 s.
- The same L4 over Vulkan: 35.4 tok/s.
- MacBook Air M4 (24 GB): 25.0 tok/s through Metal, a 2 048-token prompt in 13.0 s; 10.3 tok/s on the CPU alone.
WikiText-2 perplexity 9.058 against 8.944 for the release's own weights in f32 (Transformers); CUDA, Vulkan and Metal agree within 0.1 %.
What made the CUDA numbers: fused decode kernels with programmatic dependent launch, prompt attention as a flash kernel on the tensor cores, the experts grouped in parallel GEMMs. On Metal: fused decode stages and flash attention on the simdgroup matrices.
cargo install cortiq-cli --features cuda
hf download infosave/Inkling-2-Mini-cmf Inkling-2-Mini-q4tp.cmf --local-dir .
CMF_GPU=cuda cortiq run Inkling-2-Mini-q4tp.cmf --greedy --prompt "Why is the sky blue?"
DSpark runs on CUDA with greedy decoding (--greedy, or temperature 0 through cortiq serve); CMF_INKLING_SPEC=0 turns it off. Prebuilt binaries for Linux, macOS and Windows are on the releases page.