docs(anthropic_unified): document metadata.user_id to prompt_cache_key mapping - #959
Merged
Merged
Conversation
…y mapping The /v1/messages bridge now derives OpenAI's prompt_cache_key from metadata.user_id alongside user, capped at 64 characters. Adds the row to the Responses mapping table and a note on the chat-completions path, where the key is only set for providers that support it, plus the client-sent override
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b1c7315. Configure here.
… derived prompt_cache_key
Collaborator
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit dff3633. Configure here.
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
metadata.user_idon the/v1/messagesbridge now maps to OpenAI'sprompt_cache_keyas well asuser, capped at 64 characters, so the Responses mapping table gets a second row for it. A short note under the table covers the chat-completions path, where the key is only set for providers that support it, and that aprompt_cache_keysent by the client wins over the derived onePairs with BerriAI/litellm#37623, which ships the behavior
Related: LIT-5875
Note
Low Risk
Documentation-only change with no runtime or security impact; behavior is described as shipped in a paired implementation PR.
Overview
Documents that
metadata.user_idon the/v1/messages→ Responses bridge now maps toprompt_cache_keyin addition touser, using the same value truncated to 64 characters so per-user traffic can reuse OpenAI prompt cache entries. The table notes when the derived key is omitted (empty/nulluser_id) and that an explicit requestprompt_cache_keyoverrides the derived value.Adds a short note for the chat-completions path: the same two fields are derived from
metadata.user_id, butuseris not truncated andprompt_cache_keyis only forwarded when the target provider supports it (OpenAI/Azure-compatible yes; Gemini, Vertex, Bedrock, Anthropic no).Reviewed by Cursor Bugbot for commit b1c7315. Bugbot is set up for automated code reviews on this repo. Configure here.