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(constants): move AUTH_OBJECTS_TARGET into litellm.constants (#45779)
nate-berri12c36b054b22
diff --git a/litellm/constants.py b/litellm/constants.pyindex 8252e923ae5..a339fb76976 100644--- a/litellm/constants.py+++ b/litellm/constants.py@@ -1969,6 +1969,7 @@ LITELLM_SETTINGS_SAFE_DB_OVERRIDES: Final = []SPECIAL_LITELLM_AUTH_TOKEN: Final = ["ui-token"]DEFAULT_MANAGEMENT_OBJECT_IN_MEMORY_CACHE_TTL = int(os.getenv("DEFAULT_MANAGEMENT_OBJECT_IN_MEMORY_CACHE_TTL", 60))+AUTH_OBJECTS_TARGET: Final = "auth_objects"DEFAULT_ACCESS_GROUP_CACHE_TTL: Final = int(os.getenv("DEFAULT_ACCESS_GROUP_CACHE_TTL", 600))SPEND_LOG_KEY_METADATA_CACHE_TTL: Final = 600SPEND_LOG_KEY_METADATA_MISS_CACHE_TTL: Final = 30diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.pyindex 8f4d1df2662..797c443e712 100644--- a/litellm/integrations/prometheus.py+++ b/litellm/integrations/prometheus.py@@ -21,6 +21,7 @@ import litellmfrom litellm._internal_context import with_service_targetfrom litellm._logging import print_verbose, verbose_loggerfrom litellm.constants import (+ AUTH_OBJECTS_TARGET,PROMETHEUS_OVERFLOW_SERIES_LABEL_VALUE,PROXY_LLM_PROVIDER_FALLBACK,PROXY_REJECTED_BEFORE_ROUTING_KEY,@@ -53,7 +54,6 @@ from litellm.models.team import LiteLLM_TeamTablefrom litellm.models.user import LiteLLM_UserTablefrom litellm.models.verification_token import LiteLLM_DeletedVerificationTokenfrom litellm.proxy._types import UserAPIKeyAuth-from litellm.proxy.common_utils.user_api_key_cache import AUTH_OBJECTS_TARGETfrom litellm.repositories.base_repository import BaseRepositoryfrom litellm.repositories.budget_repository import BudgetRepositoryfrom litellm.repositories.organization_repository import OrganizationRepositorydiff --git a/litellm/proxy/common_utils/user_api_key_cache.py b/litellm/proxy/common_utils/user_api_key_cache.pyindex 8c830816207..e64fd755ef9 100644--- a/litellm/proxy/common_utils/user_api_key_cache.py+++ b/litellm/proxy/common_utils/user_api_key_cache.py@@ -21,7 +21,7 @@ if TYPE_CHECKING:T = TypeVar("T", bound=BaseModel)-AUTH_OBJECTS_TARGET: Final = "auth_objects"+from litellm.constants import AUTH_OBJECTS_TARGET as AUTH_OBJECTS_TARGET # noqa: E402, PLC0414 # public re-export_HASHED_TOKEN_CACHE_KEY: Final = re.compile(r"[0-9a-f]{64}")