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
fix: add 10-minute TTL to UI settings cache and refresh on GET
yuneng-jiangc11477fb6fa5
diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.pyindex 04b524ebbb7..076a2c3bffd 100644--- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py+++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py@@ -981,6 +981,7 @@ async def get_in_product_nudges():UI_SETTINGS_CACHE_KEY = "ui_settings:settings_dict"+UI_SETTINGS_CACHE_TTL = 600 # 10 minutesasync def get_ui_settings_cached() -> Dict[str, Any]:@@ -1014,9 +1015,9 @@ async def get_ui_settings_cached() -> Dict[str, Any]:k: v for k, v in ui_settings.items() if k in ALLOWED_UI_SETTINGS_FIELDS}- # 3. Populate cache+ # 3. Populate cache with TTLawait user_api_key_cache.async_set_cache(- key=UI_SETTINGS_CACHE_KEY, value=ui_settings+ key=UI_SETTINGS_CACHE_KEY, value=ui_settings, ttl=UI_SETTINGS_CACHE_TTL)return ui_settings@@ -1066,6 +1067,13 @@ async def get_ui_settings():general_settings.update(_flags_to_sync)+ # Refresh DualCache so other code paths (e.g. /user/filter/ui) see fresh values+ from litellm.proxy.proxy_server import user_api_key_cache++ await user_api_key_cache.async_set_cache(+ key=UI_SETTINGS_CACHE_KEY, value=ui_settings, ttl=UI_SETTINGS_CACHE_TTL+ )+# Build config-like object for schema helperconfig: Dict[str, Any] = {"litellm_settings": {"ui_settings": ui_settings}}@@ -1157,7 +1165,7 @@ async def update_ui_settings(k: v for k, v in ui_settings.items() if k in ALLOWED_UI_SETTINGS_FIELDS}await user_api_key_cache.async_set_cache(- key=UI_SETTINGS_CACHE_KEY, value=sanitized+ key=UI_SETTINGS_CACHE_KEY, value=sanitized, ttl=UI_SETTINGS_CACHE_TTL)return {