launch: disable claude attribution header to preserve KV cache

Claude Code sends an x-anthropic-billing-header that changes on every
request. This is embedded in the system prompt and consequently
breaks the KV cache for every request. Given the size of the prompts
that Claude Code usees, this has significant performance impact.
This commit is contained in:
Jesse Gross
2026-03-17 16:35:57 -07:00
parent 5d0000634c
commit f622b0c5fc

View File

@@ -59,6 +59,7 @@ func (c *Claude) Run(model string, args []string) error {
"ANTHROPIC_BASE_URL="+envconfig.Host().String(),
"ANTHROPIC_API_KEY=",
"ANTHROPIC_AUTH_TOKEN=ollama",
"CLAUDE_CODE_ATTRIBUTION_HEADER=0",
)
env = append(env, c.modelEnvVars(model)...)