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
feat: add useUISettings and useDisableShowBlog hooks
yuneng-jiang70f8e979a02d
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/useDisableShowBlog.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useDisableShowBlog.tsnew file mode 100644index 00000000000..18532cd4c26--- /dev/null+++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useDisableShowBlog.ts@@ -0,0 +1,6 @@+import { useUISettings } from "./useUISettings";++export function useDisableShowBlog(): boolean {+ const { data } = useUISettings();+ return data?.disable_show_blog ?? false;+}diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/useUISettings.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useUISettings.tsnew file mode 100644index 00000000000..f99491d5964--- /dev/null+++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/useUISettings.ts@@ -0,0 +1,27 @@+import { getUiSettings } from "@/components/networking";+import { useQuery } from "@tanstack/react-query";++export interface UISettingsData {+ disable_model_add_for_internal_users: boolean;+ disable_team_admin_delete_team_user: boolean;+ enabled_ui_pages_internal_users: string[] | null;+ require_auth_for_public_ai_hub: boolean;+ forward_client_headers_to_llm_api: boolean;+ disable_show_blog: boolean;+}++async function fetchUISettings(): Promise<UISettingsData> {+ // getUiSettings returns the raw response: { values: {...}, field_schema: {...} }+ const data = await getUiSettings();+ return data.values as UISettingsData;+}++export function useUISettings() {+ return useQuery<UISettingsData>({+ queryKey: ["uiSettings"],+ queryFn: fetchUISettings,+ staleTime: 5 * 60 * 1000, // 5 minutes+ gcTime: 10 * 60 * 1000,+ retry: 1,+ });+}