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
Getting stuck in a infinite loop in reasoning stops me from using the model!
This is a very cool model, but it has one big drawback.
Please fine tune it and release Inkling 2.1 Mini version without getting stuck in infinite loops of reasoning.
based on what I have seen so far if you are looping you aren't running it right. check my post. running through some work 3.8 27b did so far and there are things being caught that were missed. no loops, pretty impressed so far.
based on what I have seen so far if you are looping you aren't running it right. check my post. running through some work 3.8 27b did so far and there are things being caught that were missed. no loops, pretty impressed so far.
cool so no clue? what post? whats the right way?, looping occurs to me also but i also think this could be a degeneration/quant issue.
based on what I have seen so far if you are looping you aren't running it right. check my post. running through some work 3.8 27b did so far and there are things being caught that were missed. no loops, pretty impressed so far.
cool so no clue? what post? whats the right way?, looping occurs to me also but i also think this could be a degeneration/quant issue.
I don't know what everyone else has but i ran this https://eliovp.com/blog/paiton-inkling-2-mini-radeon-ai-pro-r9700 vllm/paition original format not 3 bit with context 558,496 fp8 kv, token gen is 100+ tk/s on a single R9700 with no looping so far. tool calls seem on point.
I used this model for several days in a row on software development tasks. The model was used in the original weights (nvfp4): https://huggingface.co/jesdga/Inkling-2-Mini-Basalt .
In any tasks at the "plan a rework based on such-and-such requirements" or "recheck the plan" or "check the plan's execution" level, it gets stuck in a loop 30% of the time, starting from the "Medium" reasoning level.
The model doesn't get stuck in a loop when set to the "Low" level. But in this case, it's useless for planning or rechecking.
I found that sampling parameters matters A LOT for this model: if you use a temperature that's not 1.0 and a top_k that's not 0.0 the model just loops. on coding it doesn't too much, but if you ask a reasoning task it straight up loops itself. Also tool calling is good, but even when explicitly told to use harness tools it falls back to use shell and heredocs instead of write, eedit, read ecc...
It great but not as memory efficient, its maximum token pool is large, like REALLY large but unfortunately its lacking memory efficiency makes this hard to use outside of a server rack. Aside of that its an outstanding model. I can see it being used in local business infrastructure by companies that do not want to rely on subscription or online services. Can't confirm the looping but by experience this is mostly caused by the environments ai are run in - software side. Its context window makes it an unique model especially if you are working with large data inputs. There will come a point where you simply reach the token limit in any model. This model pushed this by the factor ten compared to other models. But it is resource hungry hardware side.