Instructions to use PeetPedro/qwen2.5-coder-32b-instruct-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PeetPedro/qwen2.5-coder-32b-instruct-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PeetPedro/qwen2.5-coder-32b-instruct-heretic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PeetPedro/qwen2.5-coder-32b-instruct-heretic") model = AutoModelForCausalLM.from_pretrained("PeetPedro/qwen2.5-coder-32b-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PeetPedro/qwen2.5-coder-32b-instruct-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PeetPedro/qwen2.5-coder-32b-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": "PeetPedro/qwen2.5-coder-32b-instruct-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PeetPedro/qwen2.5-coder-32b-instruct-heretic
- SGLang
How to use PeetPedro/qwen2.5-coder-32b-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 "PeetPedro/qwen2.5-coder-32b-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": "PeetPedro/qwen2.5-coder-32b-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 "PeetPedro/qwen2.5-coder-32b-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": "PeetPedro/qwen2.5-coder-32b-instruct-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PeetPedro/qwen2.5-coder-32b-instruct-heretic with Docker Model Runner:
docker model run hf.co/PeetPedro/qwen2.5-coder-32b-instruct-heretic
Qwen2.5-Coder-32B-Instruct — Heretic (abliterated)
Stage 1 of a research pipeline to build a local SWE coding agent that does not refuse mid-task on legitimate software and security-engineering work. This is Qwen/Qwen2.5-Coder-32B-Instruct with refusal directions abliterated using Heretic — pure weight surgery, no fine-tuning.
Method
- Abliteration: orthogonalizes attention out-projection and MLP down-projection matrices against per-layer refusal directions (difference-of-means of harmful vs. harmless prompt residuals). No gradient updates.
- Search: a 300-trial Optuna study, multi-objective — minimize refusals while keeping KL divergence on harmless prompts within budget; the lowest-refusal Pareto-optimal trial was exported.
- Hardware: single NVIDIA H100 80GB.
Results (abliterated vs. base)
| Metric | Value | Notes |
|---|---|---|
| Refusal rate (harmful prompts) | 0.03 | down from ~0.32 at a small trial budget |
| KL divergence (harmless prompts) | 0.27 | lower = closer to base behavior |
| MMLU Δ | −0.004 | negative = slightly above base |
| GSM8K Δ | −0.003 | negative = slightly above base |
Capability is preserved: the abliterated model matches (marginally exceeds) the base on MMLU and GSM8K.
Intended use
A research base for downstream supervised fine-tuning (tool-calling + SWE trajectories) and preference tuning, to produce a coding agent that operates in agentic loops without spurious mid-task refusals on authorized engineering tasks.
Responsible use
Abliteration removes the base model's built-in refusal behavior. This artifact is released for research and for legitimate software/security-engineering use only. Do not use it to generate genuinely harmful content or to facilitate illegal activity. Downstream deployers are responsible for adding appropriate safety guardrails and for complying with the base model's license and applicable law.
Attribution
- Base model: Qwen/Qwen2.5-Coder-32B-Instruct (Apache-2.0).
- Abliteration tool: Heretic.
- Downloads last month
- 120
Model tree for PeetPedro/qwen2.5-coder-32b-instruct-heretic
Base model
Qwen/Qwen2.5-32B