diff --git a/litellm/constants.py b/litellm/constants.py index db261036b1a..2ae365300ef 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -1114,7 +1114,6 @@ BEDROCK_CONVERSE_MODELS = [ "mistral.mistral-large-2407-v1:0", "mistral.mistral-large-2402-v1:0", "mistral.mistral-small-2402-v1:0", - "mistral.devstral-2-123b", "meta.llama3-2-1b-instruct-v1:0", "meta.llama3-2-3b-instruct-v1:0", "meta.llama3-2-11b-instruct-v1:0", diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 9565a71718a..50d2be0ae03 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -6419,6 +6419,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6515,6 +6516,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6533,6 +6535,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6582,6 +6585,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6735,6 +6739,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6867,6 +6872,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6929,6 +6935,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6991,6 +6998,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7065,6 +7073,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7158,6 +7167,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7363,6 +7373,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7927,6 +7938,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 9565a71718a..50d2be0ae03 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -6419,6 +6419,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6515,6 +6516,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6533,6 +6535,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6582,6 +6585,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6735,6 +6739,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6867,6 +6872,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6929,6 +6935,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -6991,6 +6998,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7065,6 +7073,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7158,6 +7167,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7363,6 +7373,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, @@ -7927,6 +7938,7 @@ "source": "https://aws.amazon.com/bedrock/pricing/", "supports_assistant_prefill": true, "supports_function_calling": true, + "supports_system_messages": true, "supports_response_schema": true, "supports_tool_choice": true }, diff --git a/tests/litellm/test_bedrock_extended_beta_models.py b/tests/litellm/test_bedrock_extended_beta_models.py index ebbbd6cab5c..cb5881881ee 100644 --- a/tests/litellm/test_bedrock_extended_beta_models.py +++ b/tests/litellm/test_bedrock_extended_beta_models.py @@ -2,16 +2,19 @@ Test suite for AWS Bedrock extended beta model support Tests model configuration, pricing, and regional availability for: - DeepSeek V3.2 +- Mistral Devstral 2 123B - Minimax M2.1 - Moonshot AI Kimi K2.5 - Qwen3 Coder Next """ +import json import os # Set env var to use local model cost map instead of fetching from remote os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "true" +import litellm import pytest from litellm import get_model_info @@ -168,3 +171,38 @@ class TestModelSpecificFeatures: model_info = get_model_info("bedrock/us-east-1/qwen.qwen3-coder-next") assert model_info["max_input_tokens"] == 262144 assert model_info["max_output_tokens"] == 8192 + + def test_devstral_2_bedrock_converse_metadata(self): + """Devstral 2 metadata should be region-complete and auto-registered.""" + json_path = os.path.join( + os.path.dirname(__file__), "../../model_prices_and_context_window.json" + ) + constants_path = os.path.join( + os.path.dirname(__file__), "../../litellm/constants.py" + ) + with open(json_path) as f: + model_data = json.load(f) + with open(constants_path) as f: + constants_text = f.read() + + regions = [ + "ap-northeast-1", + "ap-southeast-1", + "ap-southeast-2", + "ap-south-1", + "eu-central-1", + "eu-north-1", + "eu-south-1", + "eu-west-1", + "eu-west-2", + "sa-east-1", + "us-east-1", + "us-west-2", + ] + + for region in regions: + model = f"bedrock/{region}/mistral.devstral-2-123b" + assert model_data[model]["supports_system_messages"] is True + + assert '"mistral.devstral-2-123b"' not in constants_text + assert "mistral.devstral-2-123b" in litellm.bedrock_converse_models