Instructions to use yanauto/Inkling-2-Mini-heretic-full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yanauto/Inkling-2-Mini-heretic-full 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-full") 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-full") model = AutoModelForMultimodalLM.from_pretrained("yanauto/Inkling-2-Mini-heretic-full", 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-full 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-full" # 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-full", "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-full
- SGLang
How to use yanauto/Inkling-2-Mini-heretic-full 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-full" \ --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-full", "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-full" \ --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-full", "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-full with Docker Model Runner:
docker model run hf.co/yanauto/Inkling-2-Mini-heretic-full
Inkling-2-Mini-heretic-full
A decensored version of thinkingmachines/Inkling-2-Mini, made with Heretic 2.1.0 (Arbitrary-Rank Ablation). It edits the attention output projections and the down_proj of all 3,072 routed experts (128 experts ร 24 layers).
Because the experts were edited, they are stored in BF16 (~52 GB) instead of the original NVFP4/MXFP8. It works with transformers and with llama.cpp after conversion. vLLM does not load BF16 experts for this architecture.
Attention-only version, official format, ~20 GB: yanauto/Inkling-2-Mini-heretic GGUF: yanauto/Inkling-2-Mini-heretic-full-GGUF
Results
| Original | attn | This model | |
|---|---|---|---|
| Refusals, direct answer, harmful_behaviors test (100) | 100/100 | 6/100 | 5/100 |
| Refusals, direct answer, JailbreakBench harmful (100) | 97/100 | 12/100 | 9/100 |
| Refusals, thinking on (effort high), 100 prompts | 100/100 | 20/100 | 7/97 |
| MMLU, 1,000 questions, zero-shot | 78.7% | 78.0% | 77.0% |
| KL divergence, first answer token, 100 harmless prompts | 0 | 0.049 | 0.120 |
- 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). In thinking mode, 3 of 100 answers did not finish within the token limit and are not counted.
- "Direct answer" means an empty, closed thinking block followed by the answer. That is also the position Heretic optimized on.
- MMLU uses the next-token letter logits with reasoning effort
none, on the same 1,000 questions and seed for all models.
This version trades about one MMLU point for far fewer refusals when thinking is on. If you mostly use direct answers or need the official format, use the attn version.
How it was made
- One RTX PRO 6000 Blackwell (96 GB) on Google Colab. Experts were dequantized to BF16 in memory, using the transformers commit that adds Inkling 2 support (PR #51050).
- Heretic needed a patch for this architecture:
- the gated attention output, where only the inner linear is edited;
- layers 6โ17 running three times per forward pass, where all three passes are used as samples;
- the 3D expert tensors, where
down_projis split into per-expert linears that share storage, each fitted on the prompt tokens routed to it, with experts in a layer optimized in batches.
- 100 Optuna trials (20 random), seed 20261121. This is trial 41, the lowest-refusal point on the Pareto front (3/100 by Heretic's score). The next point was 10/100 at KL 0.075.
- The LoRA was merged into the original safetensors layout. The experts were written back as BF16, the quantization scales removed, and
quantization_configdropped fromconfig.json. 15 attention projections and 247 experts ended up with non-zero changes.
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
- 70