From 3c3803f37afa488a5fad08b2fc2f39d1c36f740c Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 16:04:44 -0700 Subject: [PATCH] test(bedrock): point unit tests at model ids still in the cost map (#42606) #42521 retired the cohere.command-r ids from the cost map, and a bare Bedrock id resolves its provider through that map, so test_model_group_info and the cohere cases in test_bedrock_dynamic_auth_params_unit_tests failed with LLM Provider NOT provided. The completion tests keep the cohere invoke request and URL assertions through the bedrock/ prefix, the bare parametrize entry moves to amazon.nova-2-lite-v1:0 with the mock response shape picked by the real Bedrock route, and the router test builds its group info from bedrock/amazon.nova-2-lite-v1:0. Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> --- .../test_bedrock_dynamic_auth_params_unit_tests.py | 11 ++++++----- tests/local_testing/test_router.py | 9 ++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py b/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py index 2d1d2815026..184a0ae0749 100644 --- a/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py +++ b/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py @@ -9,6 +9,7 @@ import litellm from litellm.llms.custom_httpx.http_handler import HTTPHandler from unittest.mock import Mock from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM +from litellm.llms.bedrock.common_utils import BedrockModelInfo @@ -42,7 +43,7 @@ def test_bedrock_completion_with_region_name(): # Pass the client so that the HTTP call will be intercepted. response = litellm.completion( - model="cohere.command-r-v1:0", + model="bedrock/cohere.command-r-v1:0", messages=[{"role": "user", "content": "Hello, world!"}], aws_region_name="us-west-12", client=client, @@ -98,7 +99,7 @@ def test_bedrock_completion_with_dynamic_authentication_params(): # Pass the client so that the HTTP call will be intercepted. response = litellm.completion( - model="cohere.command-r-v1:0", + model="bedrock/cohere.command-r-v1:0", messages=[{"role": "user", "content": "Hello, world!"}], aws_access_key_id="dynamically_generated_access_key_id", aws_secret_access_key="dynamically_generated_secret_access_key", @@ -146,7 +147,7 @@ def test_bedrock_completion_with_dynamic_bedrock_runtime_endpoint(): # Pass the client so that the HTTP call will be intercepted. response = litellm.completion( - model="cohere.command-r-v1:0", + model="bedrock/cohere.command-r-v1:0", messages=[{"role": "user", "content": "Hello, world!"}], aws_bedrock_runtime_endpoint="https://my-fake-endpoint.com", client=client, @@ -179,7 +180,7 @@ class DummyCredentials: "model", [ "bedrock/converse/cohere.command-r-v1:0", - "cohere.command-r-v1:0", + "amazon.nova-2-lite-v1:0", "bedrock/cohere.command-r-v1:0", "bedrock/invoke/cohere.command-r-v1:0", ], @@ -250,7 +251,7 @@ def test_dynamic_aws_params_propagation(model, param_name, param_value, expected "finish_reason": "COMPLETE", } ) - if "converse" in model: + if BedrockModelInfo.get_bedrock_route(model) == "converse": mock_response.text = json.dumps( { "output": { diff --git a/tests/local_testing/test_router.py b/tests/local_testing/test_router.py index bd0a9bf8df4..4c62c28530d 100644 --- a/tests/local_testing/test_router.py +++ b/tests/local_testing/test_router.py @@ -1284,15 +1284,18 @@ def test_model_group_info(): router = Router( model_list=[ { - "model_name": "command-r-plus", - "litellm_params": {"model": "cohere.command-r-plus-v1:0"}, + "model_name": "nova-2-lite", + "litellm_params": {"model": "bedrock/amazon.nova-2-lite-v1:0"}, } ] ) - response = router.get_model_group_info(model_group="command-r-plus") + response = router.get_model_group_info(model_group="nova-2-lite") assert response is not None + assert response.model_group == "nova-2-lite" + assert response.providers == ["bedrock"] + assert response.max_input_tokens is not None def test_consistent_model_id():