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
Generate an SVG of a pelican riding a bicycle. <-- using Inkling-2-Mini-QVB8-1e-3
This is generated by Inkling-2-Mini-QVB8-1e-3, which is using QVB8 inference engine running with 18GB operating VRam.
https://huggingface.co/addiesam/Ripple-65B-Preview-QVB8-1e-3
http://github.com/addiesam/qvb8
You can compare the one generated by https://huggingface.co/addiesam/Ripple-65B-Preview-QVB8-1e-3.
https://huggingface.co/ricursiveAI/Ripple-65B-Preview/discussions/15
Fantastic!!!!!!!!!!! Just this very short thinking:
design a nice pelican on a bicycle. I'll create it in the working directory.
Let me draw carefully:
- Background: sky gradient, sun, clouds, ground.
- Bicycle: two wheels (circles with spokes), frame (lines), handlebar, seat, pedals.
- Pelican: body (white/gray), long beak with pouch, neck, legs pedaling, wings.
Let me write the SVG. I'll be careful with coordinates. Canvas 800x600.
Bicycle: wheels at (250, 430) and (550, 430), radius 70. Frame: bottom bracket at (400, 430). Seat at (320, 300). Handlebar at (520, 290).
Pelican: body around (400, 230), neck rising to head at (480, 130), beak extending right. Legs down to pedals.
Let me write it
IQ4_XS ,reasoning effort xhigh but i forgot to turn off reasoning budget, it was 3072. Well... it's something. Could be better.
But using Q4, the model forget to use the legs to ride. Quantitzation makes logic goes worse.
But, the sun is much better! Thinking more can give more details, like birds and better sun.
haha why do you guys obsess over pelicans ? just test the model intelligence, why is drawing a pelican the benchmark for a models abilities, are we 4 years old? can we grow up and have real world intelligence tests for AI already?
Oh. The “draw a pelican” benchmark is just to see if it can have a 4 years old level.
I’m well aware these models are capable of far more.
The Inkling-2-Mini-QVB8-1e-3 helped me to generate the readme and upload the model to hf.
