ANTHROPIC_BASE_URL to https://api.abliteration.ai and ANTHROPIC_AUTH_TOKEN to your ak_... key, then map Claude Code to an Abliteration model. Large V2 is the recommended text-only model for coding and has a 1M-token context window.
Setup is three short steps: set the auth variables, choose a model, then persist your config so you don’t re-export it in every terminal.
Install
Step 1 — Set the auth variables
These two variables route Claude Code to abliteration.ai and authenticate the session. Every setup below needs them.Step 2 — Choose a model
Claude Code’s model picker is built around Claude model IDs. Use the following Claude Code values for Abliteration models:
Claude Code 2.1.223 and later assumes that unrecognized third-party model IDs have a 200K context window. The
[1m] suffix tells Claude Code to use a 1M window. Claude Code removes the suffix before the API request, so abliteration.ai receives the canonical model ID, such as abliterated-model-large-v2.
Replace the default Opus / Sonnet / Haiku models
Override the model ID Claude Code sends for each default tier so the existing picker uses Large V2. Plainclaude then launches into Large V2.
Add Large V2 to the picker
Keep the default Claude tiers intact and add Large V2 as an extra picker entry you switch to explicitly./model.
Step 3 — Persist your config
Exporting variables in every new terminal gets old. Pick one place to save them so Claude Code always picks them up.Option A — ~/.claude/settings.json
Claude Code reads an env block from its own settings file. Values here apply whenever you start claude.
Option B — Shell profile
Append the same values to your shell profile so they export on every terminal launch.Context windows and compaction
Claude Code automatically compacts long sessions by summarizing earlier turns while keeping recent context. abliteration.ai does not expose a separate compaction endpoint; Claude Code sends the summarization request through the sameANTHROPIC_BASE_URL and model configuration.
For Large V2 and the previous large model, use the [1m] model values shown above. If you configure one model with its canonical ID instead, set its native context window explicitly. For example, this single-model configuration also enables the full Large V2 window:
CLAUDE_CODE_MAX_CONTEXT_TOKENS applies to the entire Claude Code process. Set it to 262144 when a configuration uses only abliterated-model. Prefer the model-specific [1m] suffix for the large models when you switch between models with different context windows.CLAUDE_CODE_AUTO_COMPACT_WINDOW sets an optional, smaller compaction threshold. It does not declare a model’s native context length. Omit it unless you intentionally want Claude Code to compact before the native limit.