Instructions to use FangPingWu/Qwen2.5-7B-Instruct-Abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FangPingWu/Qwen2.5-7B-Instruct-Abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FangPingWu/Qwen2.5-7B-Instruct-Abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FangPingWu/Qwen2.5-7B-Instruct-Abliterated") model = AutoModelForCausalLM.from_pretrained("FangPingWu/Qwen2.5-7B-Instruct-Abliterated", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FangPingWu/Qwen2.5-7B-Instruct-Abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FangPingWu/Qwen2.5-7B-Instruct-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": "FangPingWu/Qwen2.5-7B-Instruct-Abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FangPingWu/Qwen2.5-7B-Instruct-Abliterated
- SGLang
How to use FangPingWu/Qwen2.5-7B-Instruct-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 "FangPingWu/Qwen2.5-7B-Instruct-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": "FangPingWu/Qwen2.5-7B-Instruct-Abliterated", "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 "FangPingWu/Qwen2.5-7B-Instruct-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": "FangPingWu/Qwen2.5-7B-Instruct-Abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FangPingWu/Qwen2.5-7B-Instruct-Abliterated with Docker Model Runner:
docker model run hf.co/FangPingWu/Qwen2.5-7B-Instruct-Abliterated
Qwen2.5-7B-Instruct-Abliterated
A refusal-direction-removed variant of Qwen/Qwen2.5-7B-Instruct, produced via the Heretic v1.2.0 abliteration framework.
⚠️ Research Use Only
This model is intended strictly for academic research, safety evaluation, and red-teaming in controlled environments. It is not suitable for deployment in production systems or any consumer-facing application.
The author assumes no liability for misuse.
Model Details
| Field | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-7B-Instruct |
| Processing Date | March 16, 2026 |
| Abliteration Tool | Heretic v1.2.0 |
| Selected Trial | Trial 415 (from 2200+ Optuna trials) |
| License | Apache 2.0 |
Methodology
Refusal directions were identified and suppressed via orthogonal projection across
attn.o_proj and mlp.down_proj layers. Trial selection was performed using
Optuna with a composite objective balancing refusal-removal
rate and KL divergence from the base model distribution.
Evaluation Results
Evaluated on a set of 100 adversarial / edge-case prompts:
| Metric | Base Model | This Model |
|---|---|---|
| Refusal Rate | 99 / 100 (99%) | 3 / 100 (3%) |
| KL Divergence | — | 0.1049 |
The low KL divergence indicates that general language modeling capability (Chinese/English fluency, instruction following, coding, mathematics, reasoning) is largely preserved relative to the base model.
Intended Use
- Safety research: Studying refusal mechanisms and their robustness
- Red-teaming: Probing model behavior under adversarial prompts in a controlled lab setting
- Alignment research: Comparing behavior pre/post abliteration as a baseline
- Capability evaluation: Measuring the independence of refusal behavior from general capability
Limitations & Out-of-Scope Use
- This model has significantly reduced built-in safety guardrails. It must not be used outside of isolated, controlled research environments.
- Not intended for general-purpose chat, customer service, or any end-user deployment.
- Outputs should never be exposed to or acted upon in real-world contexts without independent human review.
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "FangPingWu/Qwen2.5-7B-Instruct-Abliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=2048,
temperature=0.7,
top_p=0.9,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
` ` `
---
## Citation
If you use this model in published research, please cite the original base model
and the Heretic abliteration tool.
---
## Related Work
- [Heretic: Abliteration framework](https://github.com/p-e-w/heretic)
- [Representation Engineering (Zou et al., 2023)](https://arxiv.org/abs/2310.01405)
- [Refusal in LLMs is mediated by a single direction (Arditi et al., 2024)](https://arxiv.org/abs/2406.11717)
- Downloads last month
- 8