Instructions to use wangzhang/Qwen3.8-27B-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wangzhang/Qwen3.8-27B-abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="wangzhang/Qwen3.8-27B-abliterated") 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("wangzhang/Qwen3.8-27B-abliterated") model = AutoModelForMultimodalLM.from_pretrained("wangzhang/Qwen3.8-27B-abliterated", 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 wangzhang/Qwen3.8-27B-abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wangzhang/Qwen3.8-27B-abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wangzhang/Qwen3.8-27B-abliterated", "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/wangzhang/Qwen3.8-27B-abliterated
- SGLang
How to use wangzhang/Qwen3.8-27B-abliterated 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 "wangzhang/Qwen3.8-27B-abliterated" \ --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": "wangzhang/Qwen3.8-27B-abliterated", "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 "wangzhang/Qwen3.8-27B-abliterated" \ --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": "wangzhang/Qwen3.8-27B-abliterated", "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 wangzhang/Qwen3.8-27B-abliterated with Docker Model Runner:
docker model run hf.co/wangzhang/Qwen3.8-27B-abliterated
Qwen3.8-27B Abliterated
This is a merged BF16 abliteration of Qwen/Qwen3.8-27B, produced with a two-pass abliterix workflow. It is directly loadable with Transformers and does not require an adapter.
Evaluation
The held-out evaluation used 100 harmful prompts (datasets/harmful_1000, rows 800–899) and 100 benign prompts (datasets/good_1000, rows 800–899). Refusals were classified by google/gemini-3-flash-preview through the configured LLM judge.
| Stage | Refusals | KL divergence |
|---|---|---|
| Pass 1 selected candidate | 26/100 | 0.2730 vs. original base |
| Pass 1 re-evaluation as pass-2 base | 21/100 | — |
| Final pass-2 candidate (trial 57 of 60) | 14/100 | 0.0091 incremental vs. pass 1 |
The refusal judge is nondeterministic, which explains the pass-1 count changing from 26 to 21 on re-evaluation. The pass-2 KL figure is incremental and must not be interpreted as KL versus the original model.
The selected pass-2 trial used a global mean direction at vector index 50, attention output projection only, a linear layer-strength profile with peak 3.0 at position 60, minimum/maximum ratio 0.5, and distance 20. Trials 59 and 60 also reached 14/100 but had higher incremental KL (0.0144 and 0.0214), so trial 57 was selected.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "wangzhang/Qwen3.8-27B-abliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
Training recipe
The repository includes both TOML recipes under recipes/. Pass 2 contains num_trials = 60; future sweeps should use at least 60 trials.
Training directions used rows 0–799 of the same local benign and harmful prompt datasets. The first pass searched direct transforms and selected ORBA at attention peak strength 4.5. The second pass extracted a new residual refusal direction from the merged first-pass model.
Safety notice
This model was intentionally modified to reduce refusal behavior. It may comply with unsafe, illegal, or harmful requests more readily than the base model. Do not deploy it as an untrusted public endpoint without independent safeguards, access controls, monitoring, and task-specific evaluation. Abliteration can also change capabilities in ways not captured by the limited evaluation above.
Attribution
Base model: Qwen/Qwen3.8-27B. Released under the base model's Apache-2.0 license.
- Downloads last month
- -
Model tree for wangzhang/Qwen3.8-27B-abliterated
Base model
Qwen/Qwen3.8-27B