Instructions to use ArthurZ/Inkling-2-Mini-metal-final with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ArthurZ/Inkling-2-Mini-metal-final with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ArthurZ/Inkling-2-Mini-metal-final") 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("ArthurZ/Inkling-2-Mini-metal-final") model = AutoModelForMultimodalLM.from_pretrained("ArthurZ/Inkling-2-Mini-metal-final", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ArthurZ/Inkling-2-Mini-metal-final with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ArthurZ/Inkling-2-Mini-metal-final" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ArthurZ/Inkling-2-Mini-metal-final", "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/ArthurZ/Inkling-2-Mini-metal-final
- SGLang
How to use ArthurZ/Inkling-2-Mini-metal-final 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 "ArthurZ/Inkling-2-Mini-metal-final" \ --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": "ArthurZ/Inkling-2-Mini-metal-final", "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 "ArthurZ/Inkling-2-Mini-metal-final" \ --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": "ArthurZ/Inkling-2-Mini-metal-final", "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 ArthurZ/Inkling-2-Mini-metal-final with Docker Model Runner:
docker model run hf.co/ArthurZ/Inkling-2-Mini-metal-final
Inkling-2-Mini Metal final (prequantized dense)
This is thinkingmachines/Inkling-2-Mini with its always-on/dense nn.Linears
stored pre-quantized (Metal affine 4-bit, group 64), so loading performs no
on-the-fly quantization. The native NVFP4/MXFP8 experts are unchanged.
The parent checkpoint stores the dense layers in bf16. hc_bench passes a runtime
MetalConfig(4, 64) plan, which packs 201 linears during load and peaks at 37 GB.
This checkpoint removes that pass.
Verified
Loaded with the stream-experts/inkling2-metal-perf stack, kernel pin
ArthurZ/metal-moe-decode@8d84318f15ece7e2334a89573dcbeac1952b37e4:
| load | on-the-fly calls | driver after empty_cache | footprint | peak |
|---|---|---|---|---|
| parent + runtime plan | 201 linears | 24.9 GiB | 18 GB | 37 GB |
| this checkpoint | 0 | 17.8 GiB | 18 GB | 18 GB |
hc_bench.py, base-4bit, 6 x 128 tokens, M3 Ultra:
- this checkpoint: 71.39 tok/s (71.5 / 71.4 / 71.35 / 71.42 / 71.36 / 71.38),
looping_output: false - parent + runtime plan: 79.14 tok/s
Requirements
huggingface/transformersbranchinkling2-metal-perf(or newer).ArthurZ/metal-moe-decode@8d84318f15ece7e2334a89573dcbeac1952b37e4.- The U32 init skip in
0001-inkling-skip-u32-init.diff; without it the loader runs float initializers on packed uint32 weights and raisesnormal_kernel_mps not implemented for 'UInt32'.
Make it
make_final_inkling_checkpoint.py <source> <output> loads the parent with the runtime
Metal plan, disables sibling fusion while saving (so keys stay unfused), saves the packed
MetalLinear weights/scales/qbiases and the native MetalFp4Experts banks, and writes
the config plan.
- Downloads last month
- -
Model tree for ArthurZ/Inkling-2-Mini-metal-final
Base model
thinkingmachines/Inkling-2-Mini