Skip to content

docs(prompt-caching): implicit is the default mode for injected OpenAI breakpoints - #2128

Merged
ryan-crabbe-berri merged 2 commits into
mainfrom
litellm_openai_cache_mode_default
Oct 7, 2026
Merged

ryan-crabbe-berri merged 2 commits into
mainfrom
litellm_openai_cache_mode_default

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

BerriAI/litellm#42281 (merged) changes the prompt_cache_options LiteLLM adds when a configured cache_control_injection_points entry lands on an OpenAI GPT-5.6+ deployment from {"mode": "explicit"} to {"mode": "implicit"} on /chat/completions and /v1/responses, and BerriAI/litellm#45121 does the same for /v1/messages. The auto-inject tutorial still documented explicit as that default in the mapping table, the prose under it, the per-deployment override example and the "same request on OpenAI" JSON

The page now says implicit is what goes out on every endpoint and why: OpenAI keeps its automatic checkpoint on the latest message beside the configured ones and looks up earlier message boundaries, so a growing agent conversation reuses the previous turn's prefix instead of rewriting everything after the static prefix each turn. It names the two PRs that flipped the default, and the override example flips to mode: explicit since that is now the thing you opt into. A new "What LiteLLM sends by default" table covers the other scenarios: caller or deployment prompt_cache_options winning, no point landing, client-supplied marks, custom api_base with and without the opt-in, and the models and providers the mapping does not cover. The Claude Code note now says a session runs on the configured checkpoints plus OpenAI's automatic one

Behaviour claims were checked against the hook on main after #42281 and at the head of #45121 (get_chat_completion_prompt and maybe_inject_cache_control in litellm/integrations/anthropic_cache_control_hook.py) and against live gpt-5.6 calls with a tool call in the history: implicit mode with four explicit marks was accepted and still wrote and read through the automatic checkpoint (4106 tokens), where explicit mode stopped at the fourth mark (3638)

Merge after BerriAI/litellm#45121

Verification

$ python3 scripts/check-docs.py docs
Checked 889 markdown files in: docs
No structural problems found.
$ node scripts/check-writing-style.js docs/tutorials/prompt_caching.md
No prose em dashes found. 0 vocabulary warnings

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
litellm Ready Ready Preview Oct 7, 2026 6:37pm UTC

Request Review

@ryan-crabbe-berri
ryan-crabbe-berri merged commit 8bebf41 into main Oct 7, 2026
5 checks passed
@ryan-crabbe-berri
ryan-crabbe-berri deleted the litellm_openai_cache_mode_default branch October 7, 2026 18:39

This branch was previously deployed

1 inactive deployment
Preview — 92080fbf Deployed Oct 7, 2026 by vercel[bot]
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