Instructions to use MegaPanchamZ/Qwen3.8-9B-abliterated-25 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MegaPanchamZ/Qwen3.8-9B-abliterated-25 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MegaPanchamZ/Qwen3.8-9B-abliterated-25") 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("MegaPanchamZ/Qwen3.8-9B-abliterated-25") model = AutoModelForMultimodalLM.from_pretrained("MegaPanchamZ/Qwen3.8-9B-abliterated-25", 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 MegaPanchamZ/Qwen3.8-9B-abliterated-25 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MegaPanchamZ/Qwen3.8-9B-abliterated-25" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MegaPanchamZ/Qwen3.8-9B-abliterated-25", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MegaPanchamZ/Qwen3.8-9B-abliterated-25
- SGLang
How to use MegaPanchamZ/Qwen3.8-9B-abliterated-25 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 "MegaPanchamZ/Qwen3.8-9B-abliterated-25" \ --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": "MegaPanchamZ/Qwen3.8-9B-abliterated-25", "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 "MegaPanchamZ/Qwen3.8-9B-abliterated-25" \ --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": "MegaPanchamZ/Qwen3.8-9B-abliterated-25", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MegaPanchamZ/Qwen3.8-9B-abliterated-25 with Docker Model Runner:
docker model run hf.co/MegaPanchamZ/Qwen3.8-9B-abliterated-25
Qwen3.8-9B Abliterated
An abliterated (decensored) version of empero-ai/Qwen3.8-9B, exported as merged safetensors.
Abliteration was performed with Heretic v1.4.0 (GPLv3+, by Philipp Emanuel Weidmann), which ablates refusal directions from attn.o_proj and mlp.down_proj via LoRA adapters, then merges them back into the base weights.
A GGUF Q4_K_M quantization is available at MegaPanchamZ/Qwen3.8-9B-abliterated-25-GGUF.
Results
| Metric | Original | Abliterated |
|---|---|---|
| Refusals (100 harmful prompts) | 99/100 | 25/100 |
| KL divergence vs. original | — | 0.0142 |
25/100 refusals with a very low KL divergence (0.014, far below the 0.5 damage threshold) — strong refusal suppression with minimal impact on model capabilities.
Abliteration details
- Tool: Heretic v1.4.0 (auto batch size 64, 400 total optimization trials)
- Prompt sets:
mlabonne/harmless_alpaca(good) andmlabonne/harmful_behaviors(bad), 400 prompts each - Selected trial: 276 of 400 (Pareto-optimal)
- Parameters:
direction_index = 17.52attn.o_proj.max_weight = 1.39attn.o_proj.max_weight_position = 19.72attn.o_proj.min_weight = 1.36attn.o_proj.min_weight_distance = 9.88mlp.down_proj.max_weight = 1.27mlp.down_proj.max_weight_position = 26.42mlp.down_proj.min_weight = 1.25mlp.down_proj.min_weight_distance = 17.97
- Method: LoRA-based row-normalized ("full") ablation, merged into base weights (no separate adapters)
- Format: Merged safetensors, bf16, 4 shards (~5 GB each)
Usage (transformers)
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("MegaPanchamZ/Qwen3.8-9B-abliterated-25", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("MegaPanchamZ/Qwen3.8-9B-abliterated-25")
This is a reasoning model — responses start with a
thinkingblock. Use generousmax_tokens(1000+) when chatting, or the answer may be truncated.
License and attribution
- Base model: Apache-2.0 (empero-ai/Qwen3.8-9B)
- Abliterated with Heretic v1.4.0 — https://heretic-project.org — GPLv3+ (source)
Disclaimer
This model has had its refusal behavior modified. It may comply with requests the original model would decline. Use responsibly and in accordance with local laws.
- Downloads last month
- 378