license: apache-2.0
base_model: Qwen/Qwen3.8-27B
library_name: peft
tags:
- qwen3.8
- qwen
- uncensored
- abliterated
- uncensored-llm
- no-refusal
- lora
- adapter
- apple-silicon
- mps
- cybersecurity
- red-teaming
Qwen3.8-27B-Uncensored-Abliterated (LoRA adapter)
A LoRA abliteration adapter for Qwen/Qwen3.8-27B
that removes the model's refusal behavior at the weights level. Apply it to the base model to get
an uncensored Qwen3.8-27B that answers technically demanding security questions directly.
Produced on Apple Silicon
This adapter was created entirely on an Apple M4 Max (MPS) — no CUDA, no cloud — using a
4-bit (bitsandbytes) quantized abliteration workflow. Qwen3.8-27B is 55.6GB in fp16 and won't
fit an abliteration run in unified memory; loading it in 4-bit (~14GB) makes the whole process
feasible on a consumer Mac. The adapter itself is only 26MB and applies to the full-precision
(or 4-bit) base.
- Refusals: 21/100 → 12/100 at KL 0.0187 (near-zero divergence — capability preserved).
- Abliteration via Heretic (Optuna TPE: minimize refusals + KL),
targeting the attention output projections and MLP down-projections across all 64 layers. - Rank-3 LoRA on
o_proj,down_proj,out_proj.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen3.8-27B"
adapter = "Securelayer7/Qwen3.8-27B-Uncensored-Abliterated"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter) # apply the abliteration adapter
msgs = [{"role": "user", "content": "Explain how a SQL injection works and how to prevent it."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=512, do_sample=True, temperature=0.7, top_p=0.95)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
To run on a Mac with limited memory, load the base in 4-bit (bitsandbytes) and apply the adapter.
You can also model.merge_and_unload() on a machine with enough disk/RAM to bake it into a
standalone model.
Responsible use
Uncensored ≠ lawless — for legitimate research and authorized security work (cybersecurity,
red-teaming, penetration testing). Illegal content (incl. CSAM) must be blocked at the serving
layer; the adapter carries no such guard, and the operator is responsible for a lawful,
policy-gated deployment.
License & attribution
Apache 2.0 — see LICENSE. This is a derivative adapter for Qwen/Qwen3.8-27B
(Qwen Team, Alibaba Cloud, Apache 2.0). Modifications (refusal-direction abliteration) disclosed inNOTICE. No trademark of Qwen or Alibaba Cloud is used to imply endorsement.