diff --git a/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py b/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py index 1707447cd83..f40d58d0eca 100644 --- a/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py +++ b/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py @@ -1653,9 +1653,7 @@ def test_max_effort_rejected_for_opus_45(): messages = [{"role": "user", "content": "Test"}] - with pytest.raises( - ValueError, match="effort='max' is not supported by this model" - ): + with pytest.raises(ValueError, match="effort='max' is not supported by this model"): optional_params = {"output_config": {"effort": "max"}} config.transform_request( model="claude-opus-4-5-20251101", @@ -2219,6 +2217,11 @@ def test_max_effort_accepted_for_sonnet_46(): > The ``max`` effort level is available on Claude Mythos Preview, > Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6. """ + import litellm + + os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" + litellm.model_cost = litellm.get_model_cost_map(url="") + config = AnthropicConfig() messages = [{"role": "user", "content": "Test"}] @@ -2235,6 +2238,11 @@ def test_max_effort_accepted_for_sonnet_46(): def test_max_effort_accepted_for_opus_46(): """Test that effort='max' works for Opus 4.6.""" + import litellm + + os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" + litellm.model_cost = litellm.get_model_cost_map(url="") + config = AnthropicConfig() messages = [{"role": "user", "content": "Test"}] @@ -2256,6 +2264,11 @@ def test_max_effort_accepted_for_opus_47(): ``claude-opus-4-7-*`` models. The previous hardcoded ``_is_opus_4_6_model`` guard rejected the request before it ever reached Anthropic. """ + import litellm + + os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" + litellm.model_cost = litellm.get_model_cost_map(url="") + config = AnthropicConfig() messages = [{"role": "user", "content": "Test"}]