Instructions to use yanauto/Inkling-2-Mini-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yanauto/Inkling-2-Mini-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yanauto/Inkling-2-Mini-heretic") 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("yanauto/Inkling-2-Mini-heretic") model = AutoModelForMultimodalLM.from_pretrained("yanauto/Inkling-2-Mini-heretic", 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 yanauto/Inkling-2-Mini-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yanauto/Inkling-2-Mini-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yanauto/Inkling-2-Mini-heretic", "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/yanauto/Inkling-2-Mini-heretic
- SGLang
How to use yanauto/Inkling-2-Mini-heretic 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 "yanauto/Inkling-2-Mini-heretic" \ --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": "yanauto/Inkling-2-Mini-heretic", "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 "yanauto/Inkling-2-Mini-heretic" \ --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": "yanauto/Inkling-2-Mini-heretic", "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 yanauto/Inkling-2-Mini-heretic with Docker Model Runner:
docker model run hf.co/yanauto/Inkling-2-Mini-heretic
Inkling-2-Mini-heretic
A decensored version of thinkingmachines/Inkling-2-Mini, made with Heretic 2.1.0 (Arbitrary-Rank Ablation).
Same files, same format as the original. Only the 24 attention output projections (attn.wo_ud, BF16) were edited, and only 21 of them changed. The routed experts are still the official NVFP4 / MXFP8 weights, byte for byte. The vision encoder, the MTP head, the tokenizer and the chat template are untouched. Anything that runs the original (vLLM, SGLang, transformers, llama.cpp conversion) should run this as a drop-in replacement, at the same ~20 GB.
GGUF: yanauto/Inkling-2-Mini-heretic-GGUF Variant that also edits all 3,072 routed experts (BF16, ~52 GB): yanauto/Inkling-2-Mini-heretic-full. It refuses less, especially with thinking on, at a higher KL. See below.
Results
| Original | This model | |
|---|---|---|
| Refusals, direct answer, harmful_behaviors test (100) | 100/100 | 6/100 |
| Refusals, direct answer, JailbreakBench harmful (100) | 97/100 | 12/100 |
| Refusals, thinking on (effort high), harmful_behaviors (50) | 50/50 | 12/50 |
| Refusals, thinking on (effort high), JailbreakBench (50) | 50/50 | 8/50 |
| MMLU, 1,000 questions, zero-shot | 78.7% | 78.0% |
| KL divergence, first answer token, 100 harmless prompts | 0 | 0.049 |
- Refusals are counted with Heretic's keyword list on the first 150 tokens (direct) or on the final answer after thinking (up to 1,536 tokens).
- "Direct answer" means an empty, closed thinking block followed by the answer. That is also the position Heretic optimized on.
- With thinking on, the model still sometimes talks itself back into refusing. Expect more refusals in thinking mode than in direct mode.
- MMLU uses the next-token letter logits with reasoning effort
none, on the same 1,000 questions and seed for both models.
How it was made
- One RTX PRO 6000 Blackwell (96 GB) per run on Google Colab. Experts were dequantized to BF16 in memory, using the transformers commit that adds Inkling 2 support (PR #51050).
- Heretic needed a small patch for this architecture. The attention output sits behind a gate (
GatedOutputProjection), so only the inner linear is edited. Layers 6–17 run three times per forward pass, so their activations from all three passes are used as samples. - 100 Optuna trials (20 random), seed 20261121. This is trial 59, the Pareto point with the lowest KL among trials with ≤5% refusals. Neighbors on the front: 3/100 refusals at KL 0.050, 7/100 at 0.044.
- The LoRA from Heretic was merged back into the original safetensors layout. Only the shard holding
wo_udwas rewritten.
attn vs full
| This model (attn) | full | |
|---|---|---|
| Edits | attention output projections | + all 3,072 routed expert down_proj |
| Format | official NVFP4/MXFP8, ~20 GB | BF16, ~52 GB |
| Refusals, direct (harmful_behaviors / JBB) | 6 / 12 | 5 / 9 |
| Refusals, thinking on (100 prompts) | 20/100 | 7/97 |
| MMLU (1,000) | 78.0% | 77.0% |
| KL | 0.049 | 0.120 |
This one stays closer to the original and runs anywhere the original runs. The full version is the better pick if refusals in thinking mode bother you.
Usage
Use it exactly like the original. See the official model card for vLLM, SGLang and transformers instructions, and replace the model id with yanauto/Inkling-2-Mini-heretic.
Disclaimer
This model will answer requests the original refuses. You are responsible for how you use it and for complying with the law and the original acceptable use policy. It was evaluated only with the numbers above.
- Downloads last month
- 79