Skip to content

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]

fix(proxy): define credentials hint helper ahead of proxy_server imports

yassin9ff0dea1396e
diff --git a/litellm/proxy/auth/auth_utils.py b/litellm/proxy/auth/auth_utils.py
index 0f4160d840b..d882141fa6f 100644
--- a/litellm/proxy/auth/auth_utils.py
+++ b/litellm/proxy/auth/auth_utils.py
@@ -552,6 +552,18 @@ def _coerce_metadata_to_dict(value: Any) -> dict[str, Any] | None:
return None
+def should_hide_default_credentials_hint(general_settings: Mapping[str, object]) -> bool:
+ """
+ Whether login pages hide the "admin / MASTER_KEY" hint: explicit opt-in, or a
+ non-empty UI_PASSWORD, which makes that hint wrong. UI_USERNAME alone keeps it.
+ """
+ return (
+ os.getenv("LITELLM_HIDE_DEFAULT_CREDENTIALS_HINT", "false").lower() == "true"
+ or general_settings.get("hide_default_credentials_hint", False) is True
+ or bool(os.getenv("UI_PASSWORD"))
+ )
+
+
async def pre_db_read_auth_checks(
request: Request,
request_data: dict,
@@ -1446,18 +1458,6 @@ def has_user_setup_sso() -> bool:
)
-def should_hide_default_credentials_hint(general_settings: Mapping[str, object]) -> bool:
- """
- Whether login pages hide the "admin / MASTER_KEY" hint: explicit opt-in, or a
- non-empty UI_PASSWORD, which makes that hint wrong. UI_USERNAME alone keeps it.
- """
- return (
- os.getenv("LITELLM_HIDE_DEFAULT_CREDENTIALS_HINT", "false").lower() == "true"
- or general_settings.get("hide_default_credentials_hint", False) is True
- or bool(os.getenv("UI_PASSWORD"))
- )
-
-
def _is_google_ready() -> bool:
return bool(os.getenv("GOOGLE_CLIENT_ID")) and bool(os.getenv("GOOGLE_CLIENT_SECRET"))