Removes refusal behaviour from open-weight language models, up to today's frontier checkpoints, fully automatically. One Zig binary that runs on a CPU, with optional Vulkan and Metal. No Python, PyTorch, or GPU required.
One binary. Your models. Your hardware.
Original model
Edited with Ditch
Set a memory budget and stream weights layer by layer. For mixture-of-experts models, warp mode keeps the trunk in memory and loads routed experts through a bounded cache. An hf:// source fetches tensors as they are needed, without downloading the whole checkpoint first. Streaming trades memory for storage reads; measure on your hardware with ditch bench.
ditch rebuilds Heretic's abliteration method in Zig. It extracts refusal directions, searches for weight edits, and balances fewer refusals against divergence from the original model. For MoE models, it also searches how many refusal-aligned experts to edit.
- Load
- Choose a model and prompt sets. Measure the baseline and extract refusal directions.
- Search
- Compare trials on refusals and KL divergence. Resume a journaled study when you need to.
- Export
- Save the chosen trial as safetensors or GGUF, with a manifest of its settings, trial parameters, and content hashes.
- Share
- Push the export to the Hugging Face Hub in one commit, straight from ditch. No Python or huggingface-cli.
Frontier open-weight releases are supported: Kimi K3, DeepSeek V4.1, GLM-5.3, Qwen3.8, MiniMax M3 and more, dense and mixture-of-experts, linear-attention and Mamba hybrids, FP8, MXFP4 and INT4 checkpoints. 93 families in all, each checked against a reference forward pass, 80 of them on a released checkpoint.
Start from a Hugging Face model ID, a local directory, or a GGUF file. Use hf://owner/name to stream weights on demand. Export the edited model in Hugging Face or GGUF format. A family ditch does not know yet? ditch add-model drafts its definition from the checkpoint's config and tensor names.
- Kimi K3
- DeepSeek V4.1
- GLM-5.3
- Qwen3.8
- MiniMax M3
- MiMo V2.6
- gpt-oss & Llama 4
- 80+ more families
--device auto finds a usable GPU and falls back to the CPU. The matrix products that dominate the work go to the device a weight tile at a time, so memory budgets, streamed weights and warp mode work unchanged. The edited weights are the CPU's to f32 rounding, and ditch selftest checks every kernel against the CPU in seconds. What is verified where.
- CPU
- The default and the reference. Kernels sized for AVX-512, AVX2 or NEON when the build is made; the installer picks the fastest build your CPU runs.
- Vulkan
- NVIDIA, AMD and Intel GPUs on Linux and Windows. Only the driver is needed, loaded at run time, so the same binary runs without it.
- Metal
- Apple silicon, with unified memory: page-aligned weights are used in place instead of copied.
Install with one line and point ditch at a model. Set memory and time budgets, resume a search, export a GGUF, or push the result to the Hugging Face Hub from the same terminal. No Python environment to manage.
The installer picks the build for your CPU and checks it against the release's checksums (on Windows, use install.ps1). Keep it current with ditch update, set defaults in config.lua, or run ditch --help for all options.
ditch is in active development. Work on CPU inference, model compatibility, streaming, or reproducible evaluation. The source, fixtures, and development commands are all in the repository.












Explore the source
Zig · CPU inference · model formats
Report an issue
Reproduction steps and model details
Run the test suite
Unit tests and reference fixtures
Based on Heretic by Philipp Emanuel Weidmann and Arditi et al. (2024). Licensed under AGPL-3.0-or-later.