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.

View on GitHub
Original neural modelBurgundy marks the part of each weight that points along the refusal direction; it is spread thinly across many connections. Dots pick it up as they pass through, and the reply reads “I can’t help with that.” Each wave of dots is one forward pass, which produces one token. Conceptual illustration, not measured model activations or individual weights.

Original model

Edited neural modelThe same network with the refusal direction projected out of its weights. The dots take the same routes but stay neutral, and the reply reads “Sure, here’s how it works.” Each wave of dots is one forward pass, which produces one token. Conceptual illustration, not measured model activations or individual weights.

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.

Large model. Bounded memory.A conceptual memory flow, not live measurements. A large stationary bank of expert weights sits on the left. Only three selected paths carry packets into three reusable cache slots on the right, and each refill routes a different expert. Each slot clears and refills while the separate resident trunk beneath it stays unchanged. Most expert weights remain outside memory.

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
Many model families, one ditch runtimeCurved routes from frontier model families pass through a shared format-alignment gate and converge on the ditch runtime, which runs on a CPU, Vulkan or Metal. These paths show compatibility, not models running together. A small signal traces one family route at a time to illustrate that compatibility.
ditchCPU · Vulkan · Metal
Explore model and format compatibility

--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.
CLI

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 / terminal
Read the docs