Text Generation
Transformers
English
multilingual
inkling2_loop
image-text-to-text
prime-quant
2-bit
4-bit precision
Mixture of Experts
inkling-2
inkling-2-mini
looped-transformer
triton
rocm
cuda
quantization
coding
openai-compatible
conversational
Instructions to use batteryphil/Inkling-2-Mini-PRIME-Quant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use batteryphil/Inkling-2-Mini-PRIME-Quant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="batteryphil/Inkling-2-Mini-PRIME-Quant") 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("batteryphil/Inkling-2-Mini-PRIME-Quant") model = AutoModelForMultimodalLM.from_pretrained("batteryphil/Inkling-2-Mini-PRIME-Quant", 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 batteryphil/Inkling-2-Mini-PRIME-Quant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "batteryphil/Inkling-2-Mini-PRIME-Quant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "batteryphil/Inkling-2-Mini-PRIME-Quant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/batteryphil/Inkling-2-Mini-PRIME-Quant
- SGLang
How to use batteryphil/Inkling-2-Mini-PRIME-Quant 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 "batteryphil/Inkling-2-Mini-PRIME-Quant" \ --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": "batteryphil/Inkling-2-Mini-PRIME-Quant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "batteryphil/Inkling-2-Mini-PRIME-Quant" \ --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": "batteryphil/Inkling-2-Mini-PRIME-Quant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use batteryphil/Inkling-2-Mini-PRIME-Quant with Docker Model Runner:
docker model run hf.co/batteryphil/Inkling-2-Mini-PRIME-Quant
File size: 1,838 Bytes
53ce2f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Third-Party Upstream Model & Attribution Notices
This repository contains **original PRIME-Quant inference software, fused Triton GPU kernels, Prime-Harmonic `P2_G32` / `P4_G32` quantization representations, and compressed SafeTensors v2 checkpoints** Copyright (c) 2026 Philip Bartsch (`@batteryphil`), licensed under the **[Bartsch Personal-Free & 5% Commercial Profit-Share License v1.0](LICENSE)**.
The quantized weights are derived from the following third-party upstream pre-trained model, whose upstream license and attribution notice apply independently to the underlying upstream model weights and tokenizer/configuration assets:
---
## `thinkingmachines/Inkling-2-Mini`
- **Upstream Source:** [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini)
- **Model Provider:** Thinking Machines Lab, Inc. (released November 20, 2026)
- **Upstream License:** **Apache License 2.0** (`https://www.apache.org/licenses/LICENSE-2.0`)
- **Upstream Acceptable Use Policy:** [Thinking Machines Model Acceptable Use Policy](https://thinkingmachines.ai/model-acceptable-use-policy/)
- **Modifications Made:**
- Weights quantized from Thinking Machines' `20.16 GB` NVFP4/MXFP8 (`52.8 GB` BF16-dequantized) checkpoint into `PRIME-Quant` signed-scale Prime-Harmonic 2-bit (`P2_G32`) and 4-bit (`P4_G32`) SafeTensors v2 checkpoints (`inkling2_mini_p2_looptop8.safetensors` at `10.87 GB`, and `inkling2_mini_p2_maxcomp.safetensors` at `8.83 GB`).
- Removed the upstream `quantization_config` (`modelopt`/`NVFP4`) stanza from `config.json` to prevent spurious loader warnings when hydrating `PRIME-Quant` checkpoints into `Inkling2LoopForConditionalGeneration`.
- Bundled standalone read-only Triton/PyTorch inference runtime (`prime_infer_runtime.py`, `inkling2_kernels.py`, `run_inkling2_prime.py`).
|