diff --git a/litellm/utils.py b/litellm/utils.py index 81e772b1765..02fb346bba9 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2765,8 +2765,9 @@ def register_model(model_cost: Union[str, dict]): # noqa: PLR0915 for key, value in loaded_model_cost.items(): ## get model info ## provider = value.get("litellm_provider", "") + _key_str = str(key) if provider in _skip_get_model_info_providers or any( - key.startswith(f"{p}/") for p in _skip_get_model_info_providers + _key_str.startswith(f"{p}/") for p in _skip_get_model_info_providers ): existing_model = litellm.model_cost.get(key, {}) model_cost_key = key diff --git a/tests/router_unit_tests/test_router_helper_utils.py b/tests/router_unit_tests/test_router_helper_utils.py index 99926b39c9f..3001aec8b86 100644 --- a/tests/router_unit_tests/test_router_helper_utils.py +++ b/tests/router_unit_tests/test_router_helper_utils.py @@ -807,7 +807,7 @@ def test_add_deployment(model_list): deployment = router.get_deployment_by_model_group_name( model_group_name="gpt-3.5-turbo" ) - deployment["model_info"]["id"] = 100 + deployment["model_info"]["id"] = "100" ## Test 1: call user facing function router.add_deployment(deployment=deployment)