Image-Text-to-Text
Transformers
Safetensors
inkling2_loop
conversational
Mixture of Experts
Eval Results
8-bit precision
modelopt
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 mini on 1/2/4 Intel B70/b65
#37
by ulkaa - opened
If you want to run this model on a Intel B70 (tested) or similar xe2 cards, please check out: https://hub.docker.com/r/rahulunair/sglang-xpu#6-inkling-2-mini
Download model:
hf download thinkingmachines/Inkling-2-Mini \
--local-dir "$PWD/models/Inkling-2-Mini"
TP1 works - but we have to reduce the max context.
TP2 512k Context on B70:
docker run -d --name inkling2-mini --restart unless-stopped \
--device=/dev/dri -v /dev/dri:/dev/dri \
--group-add video --group-add "$(getent group render | cut -d: -f3)" \
--ipc=host --shm-size=32g --ulimit nofile=1048576:1048576 \
-p 30000:30000 \
-e ZE_AFFINITY_MASK=0,1 \
-v "$PWD/models/Inkling-2-Mini:/model:ro" \
--entrypoint python rahulunair/sglang-xpu:inkling2-mini-20261121 \
-m sglang.launch_server --model-path /model --served-model-name Inkling-2-Mini \
--host 0.0.0.0 --port 30000 --device xpu --tp 2 --ep 2 \
--attention-backend inkling2_xpu --page-size 64 \
--context-length 524288 --max-total-tokens 528384 \
--chunked-prefill-size 8192 --mem-fraction-static 0.95 \
--swa-full-tokens-ratio 0.006 --max-running-requests 8 \
--hybrid-cache-checkpoints-level 2 --max-mamba-cache-size 64 \
--speculative-algorithm DSPARK --speculative-num-draft-tokens 8 \
--speculative-draft-attention-backend inkling2_xpu \
--cuda-graph-config '{"decode":{"backend":"full","bs":[1,2,4,8],"max_bs":8},"prefill":{"backend":"disabled"}}' \
--enable-multimodal --reasoning-parser inkling --tool-call-parser inkling2 \
--grammar-backend xgrammar --enable-cache-report --skip-server-warmup \
--watchdog-timeout 1200
TP4 on B70 with 1 Million context:
docker run -d --name inkling2-mini --restart unless-stopped \
--device=/dev/dri -v /dev/dri:/dev/dri \
--group-add video --group-add "$(getent group render | cut -d: -f3)" \
--ipc=host --shm-size=32g --ulimit nofile=1048576:1048576 \
-p 30000:30000 \
-e ZE_AFFINITY_MASK=0,1,2,3 \
-v "$PWD/models/Inkling-2-Mini:/model:ro" \
--entrypoint python rahulunair/sglang-xpu:inkling2-mini-20261121 \
-m sglang.launch_server --model-path /model --served-model-name Inkling-2-Mini \
--host 0.0.0.0 --port 30000 --device xpu --tp 4 --ep 4 \
--attention-backend inkling2_xpu --page-size 64 \
--context-length 1048576 --max-total-tokens 1052672 \
--chunked-prefill-size 8192 --mem-fraction-static 0.95 \
--swa-full-tokens-ratio 0.006 --max-running-requests 8 \
--hybrid-cache-checkpoints-level 2 --max-mamba-cache-size 64 \
--speculative-algorithm DSPARK --speculative-num-draft-tokens 8 \
--speculative-draft-attention-backend inkling2_xpu \
--cuda-graph-config '{"decode":{"backend":"full","bs":[1,2,4,8],"max_bs":8},"prefill":{"backend":"disabled"}}' \
--enable-multimodal --reasoning-parser inkling --tool-call-parser inkling2 \
--grammar-backend xgrammar --enable-cache-report --skip-server-warmup \
--watchdog-timeout 1200
Thanks for your effort. Is there a chance for it to work on B60 with some reasonable context? Is RAM offload possible if needed on 24 GB card?