Heretic is a Python-based tool designed to automatically remove safety alignment and censorship from transformer-based language models without requiring expensive post-training. The project operates under the primary language of Python and is classified by GitGenius as a CLI tool with lightweight deployment characteristics, supporting both local development and web server functionality.
The core functionality of Heretic combines an advanced implementation of directional ablation, commonly referred to as abliteration, with a TPE-based parameter optimizer powered by Optuna. This combination enables the tool to work completely automatically, finding high-quality abliteration parameters by co-minimizing the number of refusals and KL divergence from the original model. The approach requires no understanding of transformer internals, making it accessible to users who simply know how to run command-line programs.
Heretic supports a broad range of model architectures, including most dense models, many multimodal models, several different mixture-of-experts architectures, and hybrid models like Qwen3.5. However, pure state-space models and certain research architectures are not yet supported out of the box. The tool's effectiveness is demonstrated through comparative metrics showing that Heretic-generated models achieve comparable refusal suppression to manually created abliterations while maintaining significantly lower KL divergence, indicating less damage to the original model's capabilities.
According to GitGenius activity tracking across 193 issues and pull requests, the repository demonstrates a median response latency of 3.7 hours with a mean of 74.3 hours. The most active issue labels are bug with 18 occurrences and enhancement with 13 occurrences. Primary contributor p-e-w has logged 501 events, with secondary contributors Vinay-Umrethe at 70 events and kabachuha at 38 events. The repository shares overlapping contributors with ggml-org/llama.cpp, oobabooga/textgen, and comfy-org/comfyui, indicating integration within a broader ecosystem of language model tools.
The tool operates through a parametrized variant of directional ablation that identifies and orthogonalizes relevant matrices in transformer components with respect to refusal directions. Refusal directions are computed as difference-of-means between first-token residuals for harmful and harmless example prompts. The ablation process is controlled by several optimizable parameters that users can configure through command-line options or a configuration file.
Heretic includes research-focused features for interpretability studies, accessible through an optional research extra installation. These features include the ability to generate plots of residual vectors through PaCMAP projection from residual space to 2D space, with animated GIF output showing how residuals transform between layers. The tool also provides quantitative analysis of residual geometry through detailed metrics tables.
The project maintains a homepage at heretic-project.org and provides community engagement through Discord and Matrix channels. The community has created and published over 4000 models using Heretic, available on Hugging Face. The tool supports model quantization with bitsandbytes to reduce VRAM requirements and includes built-in evaluation functionality, allowing users to reproduce benchmark results and compare decensored models against baseline versions.