litellm - 💡(How to fix) Fix [Feature]: Cache anthropic_messages [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25653Fetched 2026-04-14 05:38:23
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

The Feature

Currently, the built in cache only supports the following endpoints:

    supported_call_types: Optional[List[CachingSupportedCallTypes]] = [
        "completion",
        "acompletion",
        "embedding",
        "aembedding",
        "atranscription",
        "transcription",
        "atext_completion",
        "text_completion",
        "arerank",
        "rerank",
        "responses",
        "aresponses",
    ],

Does anyone know what it's going to take to support anthropic_messages? Or does anyone know why the current implementation doesn't support anthropic_messages?

https://github.com/BerriAI/litellm/blob/65d9fadf45f1a91c3c45fa4de9fe055a533ff2f5/litellm/caching/caching.py#L70-L83

Motivation, pitch

As Claude caching changes over time, supporting anthropic_messages would help immensely by being able to cache locally.

What part of LiteLLM is this about?

Proxy

LiteLLM is hiring a founding backend engineer, are you interested in joining us and shipping to all our users?

No

Twitter / LinkedIn details

No response

extent analysis

TL;DR

To support anthropic_messages, the supported_call_types list in the caching configuration needs to be updated to include this endpoint.

Guidance

  • Review the caching.py file and locate the supported_call_types list to understand the current caching configuration.
  • Add "anthropic_messages" to the supported_call_types list to enable caching for this endpoint.
  • Verify that the caching functionality works as expected for anthropic_messages after updating the configuration.
  • Check the LiteLLM documentation or codebase for any specific requirements or constraints related to caching anthropic_messages.

Example

supported_call_types: Optional[List[CachingSupportedCallTypes]] = [
    # ... existing endpoints ...
    "anthropic_messages",
]

Notes

The provided information does not specify any specific requirements or constraints for caching anthropic_messages. It is assumed that adding this endpoint to the supported_call_types list will enable caching.

Recommendation

Apply workaround: Update the supported_call_types list to include "anthropic_messages", as this is the most straightforward way to enable caching for this endpoint.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING