mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix util vertex
This commit is contained in:
parent
2bef0481af
commit
27c085cc56
2 changed files with 22 additions and 8 deletions
|
@ -59,9 +59,7 @@ from litellm.litellm_core_utils.health_check_utils import (
|
||||||
_filter_model_params,
|
_filter_model_params,
|
||||||
)
|
)
|
||||||
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
|
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
|
||||||
from litellm.litellm_core_utils.llm_request_utils import (
|
from litellm.litellm_core_utils.llm_request_utils import LitellmCoreRequestUtils
|
||||||
pick_cheapest_chat_models_from_llm_provider,
|
|
||||||
)
|
|
||||||
from litellm.litellm_core_utils.mock_functions import (
|
from litellm.litellm_core_utils.mock_functions import (
|
||||||
mock_embedding,
|
mock_embedding,
|
||||||
mock_image_generation,
|
mock_image_generation,
|
||||||
|
@ -5424,8 +5422,10 @@ async def ahealth_check_wildcard_models(
|
||||||
) -> dict:
|
) -> dict:
|
||||||
|
|
||||||
# this is a wildcard model, we need to pick a random model from the provider
|
# this is a wildcard model, we need to pick a random model from the provider
|
||||||
cheapest_models = pick_cheapest_chat_models_from_llm_provider(
|
cheapest_models = (
|
||||||
custom_llm_provider=custom_llm_provider, n=3
|
LitellmCoreRequestUtils.pick_cheapest_chat_models_from_llm_provider(
|
||||||
|
custom_llm_provider=custom_llm_provider, n=3
|
||||||
|
)
|
||||||
)
|
)
|
||||||
if len(cheapest_models) == 0:
|
if len(cheapest_models) == 0:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
|
|
|
@ -1532,12 +1532,26 @@ def test_supports_vision_gemini():
|
||||||
|
|
||||||
def test_pick_cheapest_chat_model_from_llm_provider():
|
def test_pick_cheapest_chat_model_from_llm_provider():
|
||||||
from litellm.litellm_core_utils.llm_request_utils import (
|
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():
|
def test_get_potential_model_names():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue