Skip to content

feat(deploy): upgrade LiteLLM and turn on prompt caching - #9589

Open
bobbai00 wants to merge 1 commit into
apache:mainfrom
bobbai00:feat/agent-prompt-caching-step-limit
Open

bobbai00 wants to merge 1 commit into
apache:mainfrom
bobbai00:feat/agent-prompt-caching-step-limit

Conversation

@bobbai00

@bobbai00 bobbai00 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Claude caches only prompts that carry cache marks, and nothing set them, so every agent call was billed in full. LiteLLM 1.94 and later can add the marks itself, so this PR:

Change Where
LiteLLM 1.83.10 → 1.108.17, LiteLLM's long-term support line bin/single-node/docker-compose.yml, bin/k8s/values*.yaml
enable_anthropic_prompt_caching: true litellm_settings in bin/litellm-config.yaml, bin/single-node/litellm-config.yaml, bin/k8s/values*.yaml

LiteLLM then marks the system prompt and the latest message of every Claude request. The agent rewrites its latest message on every call, so for the agent only the system prompt and tool definitions are reused.

The upgrade also fixes five published advisories that affect 1.83.10, two rated high (GHSA-g5ff-637f-6q2m, GHSA-7488-6r32-c95q). LiteLLM 1.108 refuses to start without a master key; the shipped .env and Helm values set one.

Any related issues, documentation, discussions?

Closes #9588
Part of #9576
Docs: LiteLLM automatic checkpoints for Claude

How was this PR tested?

  • LiteLLM 1.108.17 with each edited config and a stand-in provider: Claude requests carried marks on the system prompt and the last message, OpenAI requests none.
  • Upgrade: 1.108.17 started on a Postgres database made by 1.83.10, applied the remaining migrations, and kept its virtual key and stored model.
  • Started as compose and Helm start it; bin/k8s/tests/test_helm_values.sh passes. Not run against the real Claude API.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Fable 5.2, Claude Opus 5.5)

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan, @Ma77Ball
    You can notify them by mentioning @aglinxinyuan, @Ma77Ball in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.57%. Comparing base (bf6bf9f) to head (3c25cfc).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9589   +/-   ##
=========================================
  Coverage     91.57%   91.57%           
  Complexity     5182     5182           
=========================================
  Files          1300     1300           
  Lines         58131    58131           
  Branches       7615     7615           
=========================================
  Hits          53235    53235           
  Misses         2958     2958           
  Partials       1938     1938           
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from bf6bf9f
agent-service 99.56% <100.00%> (ø)
amber 85.46% <ø> (ø) Carriedforward from bf6bf9f
computing-unit-managing-service 63.88% <ø> (ø) Carriedforward from bf6bf9f
config-service 87.50% <ø> (ø) Carriedforward from bf6bf9f
file-service 82.16% <ø> (ø) Carriedforward from bf6bf9f
frontend 96.45% <ø> (ø) Carriedforward from bf6bf9f
notebook-migration-service 83.77% <ø> (ø) Carriedforward from bf6bf9f
pyamber 98.38% <ø> (ø) Carriedforward from bf6bf9f
result-service 85.71% <ø> (ø) Carriedforward from bf6bf9f
workflow-compiling-service 78.30% <ø> (ø) Carriedforward from bf6bf9f

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bobbai00

bobbai00 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

@sshiv012 could you take a look? This is part of #9576: it turns on prompt caching for Claude models.

Also I request @parshimers 's review as you are at collaborator role.

@bobbai00
bobbai00 force-pushed the feat/agent-prompt-caching-step-limit branch from 3c25cfc to b79b7de Compare November 21, 2026 08:08
@bobbai00 bobbai00 changed the title feat(agent-service): cache prompts and lower the step limit feat(deploy): cache Claude prompts in the LiteLLM configs Nov 21, 2026
@bobbai00
bobbai00 force-pushed the feat/agent-prompt-caching-step-limit branch from b79b7de to 18dd730 Compare November 21, 2026 09:01
@bobbai00 bobbai00 changed the title feat(deploy): cache Claude prompts in the LiteLLM configs feat(deploy): upgrade LiteLLM and turn on prompt caching Nov 21, 2026
@bobbai00
bobbai00 requested a review from parshimers November 22, 2026 20:49
@bobbai00
bobbai00 force-pushed the feat/agent-prompt-caching-step-limit branch from 18dd730 to c68d6ef Compare November 24, 2026 06:55
Claude caches only prompts that carry cache marks, and nothing in Texera
set them, so every agent call was billed in full. LiteLLM 1.94 and later
can add the marks itself with enable_anthropic_prompt_caching, so pin
LiteLLM 1.108.17 (its long-term support line) instead of 1.83.10 and
turn that setting on in every default config.
@bobbai00
bobbai00 force-pushed the feat/agent-prompt-caching-step-limit branch from c68d6ef to 5c82bfe Compare November 24, 2026 23:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade LiteLLM and turn on prompt caching for Claude models

2 participants