Repository navigation
docs(prompt-caching): implicit is the default mode for injected OpenAI breakpoints - #2128
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BerriAI/litellm#42281 (merged) changes the
prompt_cache_optionsLiteLLM adds when a configuredcache_control_injection_pointsentry lands on an OpenAI GPT-5.6+ deployment from{"mode": "explicit"}to{"mode": "implicit"}on/chat/completionsand/v1/responses, and BerriAI/litellm#45121 does the same for/v1/messages. The auto-inject tutorial still documentedexplicitas that default in the mapping table, the prose under it, the per-deployment override example and the "same request on OpenAI" JSONThe 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: explicitsince that is now the thing you opt into. A new "What LiteLLM sends by default" table covers the other scenarios: caller or deploymentprompt_cache_optionswinning, no point landing, client-supplied marks, customapi_basewith 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 oneBehaviour claims were checked against the hook on
mainafter #42281 and at the head of #45121 (get_chat_completion_promptandmaybe_inject_cache_controlinlitellm/integrations/anthropic_cache_control_hook.py) and against livegpt-5.6calls 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