diff --git a/litellm/__init__.py b/litellm/__init__.py index 29b5bc360a..e00e4f804e 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -113,6 +113,8 @@ ssl_verify: bool = True ssl_certificate: Optional[str] = None disable_streaming_logging: bool = False in_memory_llm_clients_cache: dict = {} +### DEFAULT AZURE API VERSION ### +AZURE_DEFAULT_API_VERSION = "2024-02-01" # this is updated to the latest ### GUARDRAILS ### llamaguard_model_name: Optional[str] = None openai_moderations_model_name: Optional[str] = None diff --git a/litellm/router.py b/litellm/router.py index ac61ec729f..8d9884d1f0 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -3437,7 +3437,7 @@ class Router: if azure_ad_token.startswith("oidc/"): azure_ad_token = get_azure_ad_token_from_oidc(azure_ad_token) if api_version is None: - api_version = "2023-07-01-preview" + api_version = litellm.AZURE_DEFAULT_API_VERSION if "gateway.ai.cloudflare.com" in api_base: if not api_base.endswith("/"): diff --git a/litellm/utils.py b/litellm/utils.py index 82e3ca1712..6c1814629c 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3634,7 +3634,7 @@ def get_model_region( model=_model, api_key=litellm_params.api_key, api_base=litellm_params.api_base, - api_version=litellm_params.api_version or "2023-07-01-preview", + api_version=litellm_params.api_version or litellm.AZURE_DEFAULT_API_VERSION, timeout=10, mode=mode or "chat", )