diff --git a/litellm/main.py b/litellm/main.py index 5eb38a6bd10..af0dc1f5b63 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -59,9 +59,7 @@ from litellm.litellm_core_utils.health_check_utils import ( _filter_model_params, ) from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj -from litellm.litellm_core_utils.llm_request_utils import ( - pick_cheapest_chat_models_from_llm_provider, -) +from litellm.litellm_core_utils.llm_request_utils import LitellmCoreRequestUtils from litellm.litellm_core_utils.mock_functions import ( mock_embedding, mock_image_generation, @@ -5424,8 +5422,10 @@ async def ahealth_check_wildcard_models( ) -> dict: # this is a wildcard model, we need to pick a random model from the provider - cheapest_models = pick_cheapest_chat_models_from_llm_provider( - custom_llm_provider=custom_llm_provider, n=3 + cheapest_models = ( + LitellmCoreRequestUtils.pick_cheapest_chat_models_from_llm_provider( + custom_llm_provider=custom_llm_provider, n=3 + ) ) if len(cheapest_models) == 0: raise Exception( diff --git a/tests/litellm_utils_tests/test_utils.py b/tests/litellm_utils_tests/test_utils.py index fea225e4a3b..ef9bf30c134 100644 --- a/tests/litellm_utils_tests/test_utils.py +++ b/tests/litellm_utils_tests/test_utils.py @@ -1532,12 +1532,26 @@ def test_supports_vision_gemini(): def test_pick_cheapest_chat_model_from_llm_provider(): from litellm.litellm_core_utils.llm_request_utils import ( - pick_cheapest_chat_models_from_llm_provider, + LitellmCoreRequestUtils, ) - assert len(pick_cheapest_chat_models_from_llm_provider("openai", n=3)) == 3 + assert ( + len( + LitellmCoreRequestUtils.pick_cheapest_chat_models_from_llm_provider( + "openai", n=3 + ) + ) + == 3 + ) - assert len(pick_cheapest_chat_models_from_llm_provider("unknown", n=1)) == 0 + assert ( + len( + LitellmCoreRequestUtils.pick_cheapest_chat_models_from_llm_provider( + "unknown", n=1 + ) + ) + == 0 + ) def test_get_potential_model_names():