Instructions to use thinkingmachines/Inkling-2-Small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thinkingmachines/Inkling-2-Small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="thinkingmachines/Inkling-2-Small") 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-Small") model = AutoModelForMultimodalLM.from_pretrained("thinkingmachines/Inkling-2-Small", 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-Small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thinkingmachines/Inkling-2-Small" # 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-Small", "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-Small
- SGLang
How to use thinkingmachines/Inkling-2-Small 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-Small" \ --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-Small", "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-Small" \ --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-Small", "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-Small with Docker Model Runner:
docker model run hf.co/thinkingmachines/Inkling-2-Small
Add community evaluation results for Physical-Engineering’s Last Exam
Browse filesThis PR adds community-provided evaluation results for the following benchmarks:
- **[Physical-Engineering’s Last Exam (overall-score)](https://huggingface.co/datasets/google/physical-engineerings-last-exam?eval_result=thinkingmachines/Inkling-2-Small&leaderboard_task_id=overall-score)**
- **[Physical-Engineering’s Last Exam (overall-score)](https://huggingface.co/datasets/google/physical-engineerings-last-exam?eval_result=thinkingmachines/Inkling-2-Small&leaderboard_task_id=overall-score)**
These results were extracted from the results table of https://github.com/NielsRogge/harbor-hf-jobs/blob/main/docs/ple-results.md (Inkling-2-Small row, Codex column and terminus-2 column). This is based on the new [evaluation results feature](https://huggingface.co/docs/hub/eval-results).
*Note: This is an automated PR. Please review the evaluation results before merging.*
85 unmodified lines86878885 unmodified linesurl: https://thinkingmachines.ai/model-card/inkling-2-small/name: "Inkling 2 Small model card (thinkingmachines.ai)"notes: "SWE-bench Multimodal v2, mini-swe-agent (Vals harness)."85 unmodified lines868788899091929394959697989910010110210310485 unmodified linesurl: https://thinkingmachines.ai/model-card/inkling-2-small/name: "Inkling 2 Small model card (thinkingmachines.ai)"notes: "SWE-bench Multimodal v2, mini-swe-agent (Vals harness)."- dataset:id: google/physical-engineerings-last-examtask_id: overall-scorevalue: 27.8notes: "Harness: Codex 0.162.1 (reasoning effort high), 6-hour limit per task. Mean of 3 runs on the 29 dev tasks. Community run by Hugging Face on HF Jobs sandboxes; model served via Inference Providers (primeintellect)."source:url: https://github.com/NielsRogge/harbor-hf-jobs/blob/main/docs/ple-results.mdname: harbor-hf-jobs PLE results- dataset:id: google/physical-engineerings-last-examtask_id: overall-scorevalue: 23.1notes: "Harness: Harbor terminus-2 with a 150-turn cap, no image input and no MCP client (not the leaderboard protocol). Mean of 3 runs on the 29 dev tasks. Community run by Hugging Face on HF Jobs sandboxes; model served via Inference Providers (primeintellect)."source:url: https://github.com/NielsRogge/harbor-hf-jobs/blob/main/docs/ple-results.mdname: harbor-hf-jobs PLE results