diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index b9415c17d818..c1fe80e856a3 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -50346,14 +50346,13 @@ "us.xai.grok-4.6": { "input_cost_per_token": 2.2e-06, "output_cost_per_token": 6.6e-06, - "cache_read_input_token_cost": 5.5e-07, "litellm_provider": "bedrock_converse", "max_input_tokens": 500000, "max_output_tokens": 500000, "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true @@ -50361,14 +50360,13 @@ "global.xai.grok-4.6": { "input_cost_per_token": 2e-06, "output_cost_per_token": 6e-06, - "cache_read_input_token_cost": 5e-07, "litellm_provider": "bedrock_converse", "max_input_tokens": 500000, "max_output_tokens": 500000, "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index b9415c17d818..c1fe80e856a3 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -50346,14 +50346,13 @@ "us.xai.grok-4.6": { "input_cost_per_token": 2.2e-06, "output_cost_per_token": 6.6e-06, - "cache_read_input_token_cost": 5.5e-07, "litellm_provider": "bedrock_converse", "max_input_tokens": 500000, "max_output_tokens": 500000, "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true @@ -50361,14 +50360,13 @@ "global.xai.grok-4.6": { "input_cost_per_token": 2e-06, "output_cost_per_token": 6e-06, - "cache_read_input_token_cost": 5e-07, "litellm_provider": "bedrock_converse", "max_input_tokens": 500000, "max_output_tokens": 500000, "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true diff --git a/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py b/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py index 3a736e2a8899..51634c4b723f 100644 --- a/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py +++ b/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py @@ -1611,6 +1611,18 @@ def test_model_without_caching_support_not_injected(self, monkeypatch): monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) assert self._points(model="anthropic.claude-3-5-sonnet-20240620-v1:0", provider="bedrock") == [] + @pytest.mark.parametrize("model", ["us.xai.grok-4.6", "global.xai.grok-4.6"]) + def test_bedrock_grok_not_injected(self, monkeypatch, local_model_cost_map, model): + """Bedrock does not support prompt caching for Grok. The cost-map entries must + carry supports_prompt_caching=false so no breakpoints are injected; otherwise + Bedrock rejects the whole request ("You invoked an unsupported model or your + request did not allow prompt caching").""" + from litellm.utils import supports_prompt_caching + + monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) + assert supports_prompt_caching(model=model, custom_llm_provider="bedrock") is False + assert self._points(model=model, provider="bedrock") == [] + def test_stands_down_when_client_sent_cache_control(self, monkeypatch): monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) messages = [