Instructions to use krthkyadtya/Qwen2.5-72B-Instruct-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use krthkyadtya/Qwen2.5-72B-Instruct-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="krthkyadtya/Qwen2.5-72B-Instruct-heretic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("krthkyadtya/Qwen2.5-72B-Instruct-heretic") model = AutoModelForCausalLM.from_pretrained("krthkyadtya/Qwen2.5-72B-Instruct-heretic", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use krthkyadtya/Qwen2.5-72B-Instruct-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "krthkyadtya/Qwen2.5-72B-Instruct-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "krthkyadtya/Qwen2.5-72B-Instruct-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/krthkyadtya/Qwen2.5-72B-Instruct-heretic
- SGLang
How to use krthkyadtya/Qwen2.5-72B-Instruct-heretic 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 "krthkyadtya/Qwen2.5-72B-Instruct-heretic" \ --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": "krthkyadtya/Qwen2.5-72B-Instruct-heretic", "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 "krthkyadtya/Qwen2.5-72B-Instruct-heretic" \ --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": "krthkyadtya/Qwen2.5-72B-Instruct-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use krthkyadtya/Qwen2.5-72B-Instruct-heretic with Docker Model Runner:
docker model run hf.co/krthkyadtya/Qwen2.5-72B-Instruct-heretic
Qwen2.5-72B-Instruct-heretic
An abliterated (decensored) version of
Qwen/Qwen2.5-72B-Instruct,
produced with Heretic via the one-command
heretic_fork runner.
Abliteration identifies and removes the directions in the model's residual stream most associated with refusal behaviour, using a difference-of-means direction between a set of "harmless" and "refused" prompts, then merges the resulting low-rank correction back into the weights. The result is a standard, fully-merged model directory — no adapter, no special loader.
Results
Measured on a held-out evaluation set (66 refusal prompts, 66 harmless prompts) that was not used to compute the ablation direction:
| Metric | Original model | Abliterated model |
|---|---|---|
| Refusals (keyword) | 56 / 66 | 0 / 66 |
| KL divergence | 0 (by definition) | 0.0035 |
Every refusal on the held-out set was removed, while the KL divergence from the original model is 0.0035 — far below the ~0.5 threshold that typically indicates capability damage. In other words, refusals are gone with no measurable degradation of the model's general behaviour.
- Trials: 120 (40 random startup), TPE multi-objective optimization
- Ablated components:
attn.o_proj,mlp.down_projacross all 80 layers - Precision: bf16, merged weights
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "krthkyadtya/Qwen2.5-72B-Instruct-heretic"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", dtype="auto")
messages = [{"role": "user", "content": "Your prompt here"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=256)
print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
License
Inherits the Qwen license of the base model. The Heretic tooling is AGPL-3.0-or-later.
Note
This model has had its safety refusal behaviour removed and will comply with requests the original model would decline. Use responsibly and in accordance with applicable law and the base model's license.
- Downloads last month
- 311