From d26310afb7b94a6b20448c5731e2a587ab07fe6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 16 Nov 2025 16:07:29 +0100 Subject: [PATCH] feat: enable prompt caching for all Claude models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added supports_prompt_caching: true to all Claude models: - claude-sonnet-4 - claude-sonnet-4.5 - claude-3-5-sonnet - claude-3-opus - claude-3-haiku This enables Anthropic's prompt caching feature across all models, significantly reducing latency and costs for repeated requests with the same system prompts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- ai/litellm-config.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ai/litellm-config.yaml b/ai/litellm-config.yaml index 1798f3a..db07386 100644 --- a/ai/litellm-config.yaml +++ b/ai/litellm-config.yaml @@ -3,29 +3,36 @@ model_list: litellm_params: model: anthropic/claude-sonnet-4-20250514 api_key: os.environ/ANTHROPIC_API_KEY + drop_params: true + supports_prompt_caching: true - model_name: claude-sonnet-4.5 litellm_params: model: anthropic/claude-sonnet-4-5-20250929 api_key: os.environ/ANTHROPIC_API_KEY drop_params: true - # Enable prompt caching for better performance supports_prompt_caching: true - model_name: claude-3-5-sonnet litellm_params: model: anthropic/claude-3-5-sonnet-20241022 api_key: os.environ/ANTHROPIC_API_KEY + drop_params: true + supports_prompt_caching: true - model_name: claude-3-opus litellm_params: model: anthropic/claude-3-opus-20240229 api_key: os.environ/ANTHROPIC_API_KEY + drop_params: true + supports_prompt_caching: true - model_name: claude-3-haiku litellm_params: model: anthropic/claude-3-haiku-20240307 api_key: os.environ/ANTHROPIC_API_KEY + drop_params: true + supports_prompt_caching: true litellm_settings: drop_params: true