Instructions to use Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4") 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("Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4") model = AutoModelForMultimodalLM.from_pretrained("Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4", 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 Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4", "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/Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4
- SGLang
How to use Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4 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 "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4" \ --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": "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4", "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 "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4" \ --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": "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4", "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 Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4 with Docker Model Runner:
docker model run hf.co/Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4
Inkling-2-Mini-AWQ-W4A16-ASYM-INT4
English | Русский
4-bit AWQ quant of thinkingmachines/Inkling-2-Mini
(26.4B total / 3.4B active, looped MoE, text + image in → text out), made with
llm-compressor in the compressed-tensors
pack-quantized format.
The original checkpoint ships its experts in NVFP4 / MXFP8, which only run natively on Hopper/Blackwell. This quant stores them as plain INT4 (W4A16, asymmetric, group 128) — the format Ampere/Ada GPUs (RTX 30xx / 40xx, A100, L40) have fast kernels for.
Runtime status — read this first (November 2026).
vLLM: not loadable in released vLLM yet. vLLM's Inkling 2 implementation (
vllm/models/inkling2) only accepts its own NVFP4/MXFP8 expert format and requires SM90+. Two open PRs fix this:
- vllm-project/vllm#69141 adds compressed-tensors routed experts (W4A16 sym/asym, W4A8, W8A8);
- vllm-project/vllm#69165 (draft) makes Inkling 2 run on Ampere/Ada (SM80/86/89).
With both applied, this checkpoint runs on 2× RTX 3090 (TP2): wikitext-2 PPL 7.499, gsm8k 5-shot strict-match 0.816.
transformers: works, through the open PR huggingface/transformers#51050 plus the small
inkling_w4a16.pyloader in this repo (see below). transformers decompresses INT4 back to BF16 on load, so it gives correct outputs but no VRAM savings.In short: the weights are verified correct; the fast-kernel path in vLLM works but is not merged yet.
Benchmarks above are the authors' numbers for the original checkpoint, not this quant. Quant quality measurements are below.
What's inside
| Scheme | W4A16_ASYM (asymmetric, zero point), weight-only |
| Group size | 128 |
| Format | compressed-tensors / pack-quantized, int4 packed into int32 |
| Quantized | all routed experts: 24 layers × 128 experts × gate/up/down_proj = 9 216 Linear (24.4B params) |
| Kept in BF16 | attention, loop message gates, router, embeddings, lm_head, vision tower, MTP/DSpark head |
| Calibration | 64 samples × ≤1024 tokens: HuggingFaceH4/ultrachat_200k (48) + ise-uiuc/Magicoder-Evol-Instruct-110K (16), via the chat template |
| Size | 17.2 GB incl. the 0.6 GB MTP head (original NVFP4/MXFP8: 20.2 GB, BF16-equivalent: ~53 GB) |
The quantized set is the same one the authors chose for NVFP4/MXFP8: only the experts are
low-precision, everything else stays BF16. mtp.safetensors (the DSpark speculator, BF16) is
copied unchanged from the original repo.
Source weights
There is no BF16 release of Inkling 2 Mini. The experts were dequantized from the official NVFP4/MXFP8 checkpoint to BF16 (exactly, by transformers' loader) and then re-quantized to INT4. INT4 g128 is therefore applied on top of the precision already lost to NVFP4; compare the measured numbers below to the original checkpoint, not to a hypothetical BF16 model.
How the AWQ recipe was adapted to this architecture
Inkling 2 Mini is not a standard decoder, and stock llm-compressor AWQ does not work on it
out of the box. What was changed (full script: quantize_inkling.py):
- Experts linearized. transformers stores the 128 experts as fused 3D tensors; they are
split into per-expert
gate_proj / up_proj / down_projLinear layers so llm-compressor can quantize them. The generic llm-compressor linearizer would call SiLU — Inkling uses a softcapped SwiGLU (tanhsoftcaps on gate and up), so the original activation module is kept. Linearized and fused forwards were checked to be bit-identical. - Only one valid smoothing pair. AWQ moves scale between a layer and the layers that
consume its output, which is exact only if nothing non-linear sits in between:
post_attention_layernorm → experts.*.{gate,up}_proj+ the router (mlp.gate): used. The router reads the same normalized input, so it is rescaled together with the experts and routing stays exactly unchanged.up_proj → down_proj: not used —upgoes through atanhsoftcap, so smoothing across it would change the function.down_projis quantized with plain min-max g128.
- Looped layers smoothed once, over all three passes. Layers 6–17 run three times per token with shared weights. llm-compressor's sequential pipeline sees each of them three times and would smooth (and compute quantization parameters) after the first pass, then crash or re-apply on the next. Here smoothing and qparams are deferred to the third pass, so the activation statistics and the AWQ loss cover all three passes and every weight is scaled exactly once.
- Logit softcap made traceable during calibration (llm-compressor puts
lm_headonmeta).
Quality check
Measured on gpubox (2× RTX 3090), both models run in transformers with identical code.
| Original (NVFP4/MXFP8 → BF16) | This quant (INT4) | |
|---|---|---|
| wikitext-2 perplexity (32 736 tokens, 1024-token windows) | 7.441 | 7.496 (+0.75%) |
| Top-1 next-token agreement with the original | — | 94.3% |
Sample generations (greedy, default chat template) are in eval/.
Both checkpoints answer an English explanation prompt and a Russian coding prompt correctly, with near-identical wording and the same code.
Usage (transformers)
Needs transformers with Inkling 2 Mini support (until it is released:
pip install "git+https://github.com/huggingface/transformers@refs/pull/51050/head") and
compressed-tensors, plus torchvision for the image processor (AutoProcessor).
import torch
from huggingface_hub import hf_hub_download
from transformers import AutoProcessor
repo = "Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4"
import importlib.util, sys
spec = importlib.util.spec_from_file_location("inkling_w4a16", hf_hub_download(repo, "inkling_w4a16.py"))
inkling_w4a16 = importlib.util.module_from_spec(spec); spec.loader.exec_module(inkling_w4a16)
model = inkling_w4a16.load(repo, dtype=torch.bfloat16, device_map="cpu")
processor = AutoProcessor.from_pretrained(repo)
messages = [{"role": "user", "content": [{"type": "text", "text": "Why is the sky blue?"}]}]
inputs = processor.apply_chat_template(messages, tokenize=True, add_generation_prompt=True,
return_dict=True, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(out[0][inputs["input_ids"].shape[-1]:]))
inkling_w4a16.load() does three things around from_pretrained: swaps the fused experts for a
per-expert module so the packed weights load as-is, and works around two loader bugs
(compressed-tensors 0.19 sizes the asymmetric zero point unpacked on the meta device; the
compressed-tensors quantizer in transformers breaks Inkling's lm_head unpad converter).
Load with device_map="cpu" and move/dispatch afterwards: with device_map="auto", accelerate
plans placement by the packed INT4 sizes and then runs out of memory when the weights are
decompressed.
Prompting, reasoning effort and tool calling are the same as for the base model — see its model card.
Reproducibility
quantize_inkling.py (the full script), recipe.yaml (written by llm-compressor) and
eval_inkling.py are included. Versions: llm-compressor 0.14.0.1, compressed-tensors 0.19.0,
torch 2.14.0+cu130, transformers PR #51050 at a10ebc3c1c44.
Caveats
- Not validated on the authors' agentic / coding / vision benchmarks — only perplexity, next-token agreement and generation coherence were measured.
- The vision tower is untouched (BF16); image quality should track the base model, the expected degradation is in the text experts.
- License: Apache 2.0, same as the base model. Use is subject to the base model's acceptable use policy.
- Downloads last month
- 218
Model tree for Ar4ikov/Inkling-2-Mini-AWQ-W4A16-ASYM-INT4
Base model
thinkingmachines/Inkling-2-Mini