mirror of
https://github.com/ollama/ollama.git
synced 2026-10-20 18:41:17 +00:00
launch: disable claude code token countdown to preserve KV cache (#17918)
Claude Code adds a "tokens left" system message after every tool result. Since ollama moves system messages to the front of the prompt, this breaks the KV cache on every request.
This commit is contained in:
parent
124e9af9d2
commit
add1f92bdd
2 changed files with 2 additions and 0 deletions
|
|
@ -70,6 +70,7 @@ func (c *Claude) envVars(model string) []string {
|
|||
"ANTHROPIC_API_KEY=",
|
||||
"ANTHROPIC_AUTH_TOKEN=ollama",
|
||||
"CLAUDE_CODE_ATTRIBUTION_HEADER=0",
|
||||
"CLAUDE_CODE_TOTAL_TOKENS_REMINDER=off",
|
||||
"DISABLE_ERROR_REPORTING=1",
|
||||
"DISABLE_FEEDBACK_COMMAND=1",
|
||||
"CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1",
|
||||
|
|
|
|||
|
|
@ -353,6 +353,7 @@ func TestClaudeEnvVars(t *testing.T) {
|
|||
"ANTHROPIC_API_KEY": "",
|
||||
"ANTHROPIC_AUTH_TOKEN": "ollama",
|
||||
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
|
||||
"CLAUDE_CODE_TOTAL_TOKENS_REMINDER": "off",
|
||||
"DISABLE_ERROR_REPORTING": "1",
|
||||
"DISABLE_FEEDBACK_COMMAND": "1",
|
||||
"CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue