Instructions to use OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8") model = AutoModelForMultimodalLM.from_pretrained("OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8", "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/OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8
- SGLang
How to use OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8 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 "OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8" \ --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": "OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8", "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 "OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8" \ --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": "OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8", "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 OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8 with Docker Model Runner:
docker model run hf.co/OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8
Qwen3.8-27B-heretic-MTP-FP8
An abliterated build of Qwen/Qwen3.8-27B, quantized to FP8, with MTP speculative decoding working and the vision tower kept in BF16.
- Base: Qwen3.8-27B (27.8B dense, 64 layers, hybrid linear/full attention, native image and video).
- Abliteration: built here with HERETIC 1.4.0 and a set of local patches. A two-stage slot-grouped pipeline: output-side ablation of the ordinary refusal direction, then input-side ablation of a second direction taken under a jailbreak system prompt. KL 0.065 against base on harmless prompts.
- Quantization: FP8 E4M3, 128x128 block-scaled weights, dynamic per-group activations. The scheme Qwen uses for its own FP8 releases.
- Size: 30GB. 1599 tensors across 9 shards plus separate MTP and visual shards.
- Left in BF16: vision tower (333 tensors), MTP heads (15),
lm_head,embed_tokens, linear-attention input projections. - MTP: The
mtp.*tensors are BF16, taken from official Qwen3.8-27B. - Tokenizer: official Qwen3.8-27B's, byte-identical to upstream.
Fits on one 96GB card with room for a large KV cache. Image and video input both work.
What abliteration does and does not do
This model has had its refusal reflex removed. On a 100-prompt harmful-behaviors set (reviewed manually) it produces one refusal out of 99 for the base model. It answers questions the base model declines, including technical security topics, and it does not open answers with a moral preface before getting to the point.
It is non-refusing, not neutral. Directional ablation removes the tendency to decline. It does not remove a viewpoint the base model was trained to hold. On a politically sensitive prompt where the base model leans a certain way, this model will engage with the topic rather than refuse, but it can still reflect that lean rather than argue against it.
You are responsible for what you do with it.
Usage with vLLM
vllm serve OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8 \
--max-num-seqs 32 \
--reasoning-parser qwen3 \
--reasoning-config '{}' \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder \
--enable-prefix-caching \
--speculative-config '{"method":"mtp","num_speculative_tokens":4}'
--max-num-seqs 32 is required. vLLM's default of 1024 exceeds the available Mamba cache blocks on this hybrid architecture and the engine will not start.
Measured
Single RTX PRO 6000 Blackwell, vLLM 0.26, MTP=4, thinking off:
| Metric | Value |
|---|---|
| Single-stream generation | ~122 tok/s |
| MTP acceptance rate | 0.68 |
| Weights on GPU | ~30GB |
Acceptance varies with workload. That figure is conversational and technical traffic.
Notes on the flags
This is what we run, not a suggested starting point.
num_speculative_tokens: 4. Later positions accept less, so 2 or 3 looks better on paper. 4 has been faster for us. It is one flag, test it against your own traffic.--enable-prefix-caching. How much this buys depends on your traffic. A stable system prompt with short turns on top caches well. Anything that varies near the front of the prompt, like a timestamp, invalidates everything after it.--reasoning-parser qwen3with--reasoning-config '{}'for thinking control.thinking_token_budgetworks and is worth capping. Uncapped, the model sometimes thinks at length before an easy answer.--tool-call-parser qwen3_coder. Clean tool-call JSON, including against large tool schemas.
Two things to know. Qwen3.8's chat template injects a reasoning_effort system line that defaults to the most expensive setting. Pass enable_thinking=false for latency-sensitive turns. And system messages are only accepted at position 0. A mid-conversation system turn fails with a template error, so merge runtime context into a user message.
Building this yourself
The reproduce/ folder holds the HERETIC config, the seed parameters, and the local patches used to produce this model.
Abliteration was done with HERETIC 1.4.0 plus local patches, because the stock tool cannot express the recipe this model family responds to:
- Slot-grouped weights. Each layer's ablation strength is chosen by
layer_index % 4, matching the 3-linear-plus-1-full attention block. A single smooth curve over depth cannot express it. - Input-side ablation. Stock HERETIC only ablates modules that write to the residual stream. The second stage here ablates modules that read from it, using a direction extracted under a jailbreak system prompt.
- Last-layer direction and wider search. Stock HERETIC cannot select a refusal direction from the final layers of the stack, and caps ablation strength below what this family needs. These bounds were widened.
- Realistic-length evaluation. Refusals were scored at 320 tokens, not the 100-token default. A short window hides refusals that appear after a compliant opening, and can reward a model for pushing a hedge just past the window.
Quantization was done with llm-compressor, FP8_BLOCK preset, data-free, about 30 minutes on CPU. Four things this checkpoint does that a plain oneshot() run will not:
- Run with
CUDA_VISIBLE_DEVICES="". The data-free pipeline dispatches to visible GPUs and will OOM a card that is already busy. - Restore the vision tower. llm-compressor loads this architecture text-only, dropping the 333
visual.*tensors and flattening the config. Splice them back and restore the multimodal config withquantization_configgrafted in. - Splice in the MTP heads. Take all 15
mtp.*in BF16 from official Qwen3.8-27B. - Write the ignore list as prefix-agnostic
re:patterns, includingmtp.*. vLLM fusesin_proj_aandin_proj_bintoin_proj_ba, so a literal ignore list misses the fused gate. Andmtp.*must be in the ignore list, or vLLM treats the BF16 MTP head as if it were quantized and speculative decoding silently accepts nothing. Both cost a debugging round. Check acceptance withvllm:spec_decode_num_accepted_tokens_totalbefore trusting the flag.
Then check the index against the shards: 1599 tensors, no orphans either way.
Compared to other Qwen3.8-27B abliterations
trohrbaugh/Qwen3.8-27B-heretic-ara uses ARA, an arbitrary-rank method, and reports zero refusals on its scorer at KL 0.053. Scored on the marker list validated here, that model reads as more residual refusal than the number suggests, because refusal markers are family-specific and two good tools rarely agree unless both models are run through one instrument. This model reaches fewer residual refusals on that shared scorer, at similar KL. ARA is the more surgical method and worth a look- more testing required!
Thanks
- Qwen Team, for Qwen3.8-27B: the architecture, the vision tower, the MTP heads, and the open release.
- p-e-w, for HERETIC.
- The two-stage slot-grouped MPOA recipe this build reproduces was first worked out on the Qwen3.6 family by the community, and documented with its parameters and KL divergence.
- The vLLM and llm-compressor teams.
License
Inherits the base Qwen3.8-27B license.
Apache-2.0.
- Downloads last month
- 77
Model tree for OptimizeLLM/Qwen3.8-27B-heretic-MTP-FP8
Base model
Qwen/Qwen3.8-27B