p-e-w

heretic

Heretic is a fully automatic tool that removes censorship (safety alignment) from transformer-based language models using directional ablation (abliteration) without expensive post-training.

v2.1.0
Published at
5d ago
40,501
Stars
8,111
Download
Synced at
10m ago

Latest release

v2.1.0Nov 8, 2026, 07:14 AM
Downloads slow? Switch the source anytime above

README

Project Overview

Heretic is a fully automatic tool that removes censorship (safety alignment) from transformer-based language models using directional ablation (abliteration) combined with Optuna TPE optimization — no manual tuning required, preserving model intelligence while reducing refusals.

Key Features

  • Fully Automatic: One command, zero configuration
  • Abliteration: Directional ablation preserving model semantics
  • KL Divergence Optimization: Minimizes damage to original model capabilities
  • Wide Model Support: Dense, multimodal, and MoE architectures
  • Quantization: bitsandbytes 4-bit support for low-VRAM deployment

Target Audience

  • Local LLM researchers and enthusiasts
  • Users wanting uncensored AI responses
  • Interpretability researchers

Quick Start

  1. Set up Python 3.10+ with PyTorch 2.2+
  2. Install: pip install -U heretic-llm
  3. Run: heretic Qwen/Qwen3-4B-Instruct-2507
  4. After completion: save model, test chat, upload to HuggingFace, or run benchmarks

Core Advantages

  • Completely automated — no transformer internals knowledge needed
  • Outperforms manual abliterations in KL divergence
  • 4-bit quantization runs 4B models on 16GB VRAM
  • Community has generated 5000+ Heretic models

System Requirements

  • OS: Linux (recommended), macOS, Windows
  • Architecture: x64 (CUDA GPU recommended)
  • Additional dependencies: Python 3.10+, PyTorch 2.2+, optional bitsandbytes

Notes

  • Some models require newer PyTorch (e.g., MXFP4 needs 2.6+)
  • Recommended to use uv: uv run heretic
  • For legitimate research and educational purposes only

Release history

Sort