The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
refactor(prometheus): source PROXY_LLM_PROVIDER_FALLBACK from litellm.constants
yassin9a62a5ebee77
diff --git a/litellm/constants.py b/litellm/constants.pyindex 5751e6e46af..aaa1e1484a2 100644--- a/litellm/constants.py+++ b/litellm/constants.py@@ -227,6 +227,9 @@ PRE_CALL_EXECUTED_GUARDRAILS_KEY: Final = "_pre_call_executed_guardrails"# Attribute stamped on log_guardrail_information wrappers so __init_subclass__ does not wrap them againLOGS_GUARDRAIL_INFORMATION_MARKER: Final = "_litellm_logs_guardrail_information"+# llm_provider stamped on proxy-side rate limit errors when the model resolves to no deployment+PROXY_LLM_PROVIDER_FALLBACK: Final = "litellm_proxy"+# Generic fallback for unknown modelsDEFAULT_REASONING_EFFORT_MINIMAL_THINKING_BUDGET: Final = int(os.getenv("DEFAULT_REASONING_EFFORT_MINIMAL_THINKING_BUDGET", 128)diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.pyindex 2ba5d471e75..69a38e83835 100644--- a/litellm/integrations/prometheus.py+++ b/litellm/integrations/prometheus.py@@ -16,6 +16,7 @@ from pydantic import BaseModelimport litellmfrom litellm._logging import print_verbose, verbose_logger+from litellm.constants import PROXY_LLM_PROVIDER_FALLBACKfrom litellm.exceptions import (validate_rate_limit_category,validate_rate_limit_type,@@ -41,7 +42,6 @@ from litellm.proxy._types import (LiteLLM_UserTable,UserAPIKeyAuth,)-from litellm.proxy.hooks.rate_limiter_utils import PROXY_LLM_PROVIDER_FALLBACKfrom litellm.repositories.base_repository import BaseRepositoryfrom litellm.repositories.organization_repository import OrganizationRepositoryfrom litellm.repositories.team_repository import TeamRepositorydiff --git a/litellm/proxy/hooks/rate_limiter_utils.py b/litellm/proxy/hooks/rate_limiter_utils.pyindex cdc3896c10d..bbe38068638 100644--- a/litellm/proxy/hooks/rate_limiter_utils.py+++ b/litellm/proxy/hooks/rate_limiter_utils.py@@ -6,11 +6,10 @@ from typing import Finalimport litellmfrom litellm._logging import verbose_proxy_logger+from litellm.constants import PROXY_LLM_PROVIDER_FALLBACKfrom litellm.types.router import ModelGroupInfofrom litellm.types.utils import PriorityReservationDict-PROXY_LLM_PROVIDER_FALLBACK: Final = "litellm_proxy"-def resolve_llm_provider_for_rate_limit(model: str | None,