Skip to content

ci: pin Claude Code's small/fast model to a group the gateway serves - #24

Merged
aroff merged 1 commit into
mainfrom
ci/small-fast-model
Sep 4, 2026
Merged

aroff merged 1 commit into
mainfrom
ci/small-fast-model

Conversation

@aroff

@aroff aroff commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Claude Code keeps a separate small/fast model slot for background work — session titles, compaction summaries, quick classifiers. Unset, the CLI asks for its own default haiku id, which this gateway does not register, so those calls 404 and the CLI retries them with exponential backoff. That backoff is what turned a previous run into ~4.6 min of pure sleep per affected call.

This is insurance, not a fix for an observed failure

Measured against a recording endpoint with three distinct model ids, a plain -p run issued exactly one request — the main model, thinking: adaptive, 26 tools — and never touched the small/fast slot. So it is not hit on every run.

Worth taking anyway: the downside is minutes of wall clock inside an already timeout-bounded job, and the cost is two env lines that cannot be wrong.

Why both names

Both are still read by the CLI (verified in the 2.1.259 binary): ANTHROPIC_DEFAULT_HAIKU_MODEL is the current name, ANTHROPIC_SMALL_FAST_MODEL the legacy alias.

Each falls back to LLM_GATEWAY_MODEL, so the workflow is correct with no new secret — today that resolves to tools-advanced, which is measured as serving every request shape Claude Code sends. Setting ANTHROPIC_SMALL_FAST_MODEL later repoints background calls at a cheaper group without editing this file.

Scope

One env: block in the live-eval job. No behaviour change on the PR path — validate and score-fixtures do not run the sweep.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DobwJ8YTnfowwqwhspU1kQ

Claude Code keeps a separate "small/fast" model slot for background work --
session titles, compaction summaries, quick classifiers. Unset, the CLI asks
for its own default haiku id, which this gateway does not register, so those
calls 404 and the CLI retries them with exponential backoff. That backoff is
what turned a previous run into ~4.6 min of pure sleep per affected call.

Measured against a recording endpoint, a plain `-p` run issues exactly one
request and it uses the main model, so the slot is not hit on every run: this
is insurance, not a fix for an observed failure. It is worth taking anyway
because the downside is minutes of wall clock inside a job that is already
timeout-bounded, and the cost is two env lines.

Both names are set because both are still read by the CLI (2.1.259):
ANTHROPIC_DEFAULT_HAIKU_MODEL is the current one, ANTHROPIC_SMALL_FAST_MODEL
the legacy alias. Each falls back to the agent pin, so the workflow is correct
with no new secret; set ANTHROPIC_SMALL_FAST_MODEL later to point background
calls at a cheaper group than the agent's without editing this file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DobwJ8YTnfowwqwhspU1kQ
@aroff
aroff enabled auto-merge (squash) September 4, 2026 19:57
@aroff
aroff merged commit 89a16be into main Sep 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant