From 6a2b4bcab83b564192e72178373dbb2f919dbcae Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 30 Apr 2024 15:29:35 -0700 Subject: [PATCH] fix(router.py): only check `/v1` for azure ai studio models Fixes https://github.com/BerriAI/litellm/issues/3346 --- litellm/router.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/router.py b/litellm/router.py index 8ea1a124a4..e59612a392 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -1959,8 +1959,10 @@ class Router: or "ft:gpt-3.5-turbo" in model_name or model_name in litellm.open_ai_embedding_models ): + is_azure_ai_studio_model: bool = False if custom_llm_provider == "azure": if litellm.utils._is_non_openai_azure_model(model_name): + is_azure_ai_studio_model = True custom_llm_provider = "openai" # remove azure prefx from model_name model_name = model_name.replace("azure/", "") @@ -1990,7 +1992,7 @@ class Router: if not, add it - https://github.com/BerriAI/litellm/issues/2279 """ if ( - custom_llm_provider == "openai" + is_azure_ai_studio_model == True and api_base is not None and not api_base.endswith("/v1/") ):