[Frontend] Exclude anthropic billing header to avoid prefix cache miss (#36829)
Signed-off-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent
c34ba6b961
commit
262b76a09f
@@ -143,6 +143,10 @@ class AnthropicServingMessages(OpenAIServingChat):
|
||||
system_prompt = ""
|
||||
for block in anthropic_request.system:
|
||||
if block.type == "text" and block.text:
|
||||
# Strip Claude Code's attribution header which contains
|
||||
# a per-request hash that defeats prefix caching.
|
||||
if block.text.startswith("x-anthropic-billing-header"):
|
||||
continue
|
||||
system_prompt += block.text
|
||||
openai_messages.append({"role": "system", "content": system_prompt})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user