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(ui): replace deployment warning banners with a health icon, alert banner and panel (#46498)
yuneng-jiang5088b0cea6da
diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.jsonindex 1e8e6ee0e39..b1b6cef7320 100644--- a/ui/litellm-dashboard/eslint-suppressions.json+++ b/ui/litellm-dashboard/eslint-suppressions.json@@ -2090,179 +2090,11 @@"count": 1}},- "src/components/ui/alert-dialog.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/alert.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/avatar.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/badge.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/breadcrumb.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/button-group.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/button.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/card.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/chart.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/checkbox.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/collapsible.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/combobox.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/dialog.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/dropdown-menu.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/field.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/hover-card.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/input-group.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/input.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/label.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/popover.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/radio-group.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/scroll-area.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/select.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/separator.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/sheet.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/skeleton.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },"src/components/ui/slider.tsx": {- "local/filename-pascal-case": {- "count": 1- },"no-nested-ternary": {"count": 1}},- "src/components/ui/sonner.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/switch.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/table.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/tabs.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/textarea.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/tooltip.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },- "src/components/ui/ui-loading-spinner.tsx": {- "local/filename-pascal-case": {- "count": 1- }- },"src/components/update_model_credentials_modal.tsx": {"local/filename-pascal-case": {"count": 1diff --git a/ui/litellm-dashboard/eslint.config.mjs b/ui/litellm-dashboard/eslint.config.mjsindex ce2d933292d..acf6f624f96 100644--- a/ui/litellm-dashboard/eslint.config.mjs+++ b/ui/litellm-dashboard/eslint.config.mjs@@ -69,6 +69,7 @@ const eslintConfig = [},{files: ["src/**/*.tsx"],+ ignores: ["src/components/ui/**"],rules: {"local/filename-pascal-case": "error",},diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/deploymentWarnings/useDeploymentWarnings.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/deploymentWarnings/useDeploymentWarnings.tsnew file mode 100644index 00000000000..514a76eef2d--- /dev/null+++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/deploymentWarnings/useDeploymentWarnings.ts@@ -0,0 +1,57 @@+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";+import { backgroundFetchClient, fetchClient } from "@/lib/http/api";+import type { components } from "@/lib/http/schema";+import { toast } from "@/lib/toast";+import { isProxyAdminRole, isProxyAdminTierRole } from "@/utils/roles";+import { createQueryKeys } from "../common/queryKeysFactory";++export type DeploymentWarning = components["schemas"]["DeploymentWarning"];+export type DeploymentWarningsResponse = components["schemas"]["DeploymentWarningsResponse"];+export type DeploymentWarningIgnoreUpdate = components["schemas"]["DeploymentWarningIgnoreUpdate"];++const deploymentWarningKeys = createQueryKeys("deploymentWarnings");++const fetchDeploymentWarnings = async (): Promise<DeploymentWarningsResponse> => {+ const { data } = await backgroundFetchClient.GET("/health/deployment_warnings");+ if (data === undefined) {+ throw new Error("The proxy returned no deployment warnings payload");+ }+ return data;+};++export const useDeploymentHealthAccess = () => {+ const { accessToken, userRole, isViewOnly } = useAuthorized();+ return {+ canView: Boolean(accessToken) && isProxyAdminTierRole(userRole),+ canManage: Boolean(accessToken) && isProxyAdminRole(userRole) && !isViewOnly,+ };+};++export const useDeploymentWarnings = ({ refetchOnOpen = false }: { refetchOnOpen?: boolean } = {}) => {+ const { canView } = useDeploymentHealthAccess();+ const options = {+ queryKey: deploymentWarningKeys.all,+ queryFn: fetchDeploymentWarnings,+ enabled: canView,+ staleTime: 5 * 60 * 1000,+ retry: false,+ ...(refetchOnOpen ? { refetchOnMount: "always" as const } : {}),+ };+ return useQuery(options);+};++export const useUpdateDeploymentWarningIgnore = () => {+ const queryClient = useQueryClient();+ return useMutation({+ mutationFn: async ({ warningId, update }: { warningId: string; update: DeploymentWarningIgnoreUpdate }) => {+ const { data } = await fetchClient.PATCH("/health/deployment_warnings/{warning_id}", {+ params: { path: { warning_id: warningId } },+ body: update,+ });+ return data;+ },+ onSuccess: () => queryClient.invalidateQueries({ queryKey: deploymentWarningKeys.all }),+ onError: (error) => toast.fromError(error),+ });+};diff --git a/ui/litellm-dashboard/src/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails.ts b/ui/litellm-dashboard/src/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails.tsindex 44d9092df34..a8c281b5a23 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails.ts+++ b/ui/litellm-dashboard/src/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails.ts@@ -12,9 +12,6 @@ export interface HealthReadinessDetailsResponse {success_callbacks?: string[];use_aiohttp_transport?: boolean;log_level?: string;- is_detailed_debug?: boolean;- show_no_redis_warning?: boolean;- show_env_credential_login_warning?: boolean;}const fetchHealthReadinessDetails = async (accessToken: string): Promise<HealthReadinessDetailsResponse> => {diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.integration.test.tsxindex 537f2115eda..aa2069eb74e 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/layout.integration.test.tsx+++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.integration.test.tsx@@ -15,6 +15,9 @@ import Layout from "./layout";vi.unmock("@/app/(dashboard)/hooks/useAuthorized");vi.unmock("@/lib/toast");+let deploymentWarnings: { warnings: { id: string; severity: string; ignore: null }[]; ignore_available: boolean };+let plugins: { name: string; display_name: string; url: string }[];+vi.mock("next/navigation", () => ({useRouter: () => ({ push: vi.fn(), replace: vi.fn() }),useSearchParams: () => new URLSearchParams(),@@ -24,6 +27,8 @@ vi.mock("next/navigation", () => ({beforeEach(() => {testQueryClient.clear();localStorage.clear();+ deploymentWarnings = { warnings: [], ignore_available: true };+ plugins = [];const claims = {key: "sk-layout-test",user_id: "layout-admin",@@ -45,11 +50,16 @@ beforeEach(() => {case "/get/ui_theme_settings":return Response.json({ values: {} });case "/api/plugins":+ return Response.json(plugins);+ case "/api/plugins/auth-token":+ return Response.json({});case "/team/list":case "/organization/list":return Response.json([]);case "/health/readiness/details":return Response.json({ status: "healthy" });+ case "/health/deployment_warnings":+ return Response.json(deploymentWarnings);case "/health/license": {const license = {has_license: false,@@ -187,3 +197,35 @@ describe("dashboard overlay boundaries", () => {await waitFor(() => expect(trigger).toHaveFocus());});});++describe("deployment health in the dashboard shells", () => {+ it.each([+ { shell: "gateway header", pluginMode: null },+ { shell: "plugin navbar", pluginMode: "agent-plane" },+ ])("should show the icon, the critical row and the panel in the $shell", async ({ pluginMode }) => {+ const user = userEvent.setup();+ deploymentWarnings = {+ warnings: [{ id: "env_credential_login", severity: "critical", ignore: null }],+ ignore_available: true,+ };+ if (pluginMode) {+ plugins = [{ name: pluginMode, display_name: "Agent plane", url: "" }];+ localStorage.setItem("litellm_plugin_mode", pluginMode);+ }+ renderWithProviders(+ <AuthProvider>+ <Layout>+ <h1>Gateway page</h1>+ </Layout>+ </AuthProvider>,+ );++ expect(+ (await screen.findAllByRole("button", { name: "Deployment health, 1 active warning" })).length,+ ).toBeGreaterThan(0);+ await user.click(await screen.findByRole("button", { name: "Review" }));++ const panel = await screen.findByRole("dialog", { name: "Deployment health" });+ expect(within(panel).getByRole("article", { name: "Environment-credential login is enabled" })).toBeVisible();+ });+});diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.test.tsxindex bd5c6949c6b..154f72719e2 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/layout.test.tsx+++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.test.tsx@@ -40,22 +40,6 @@ vi.mock("@/app/(dashboard)/components/SidebarProvider", () => ({),}));-vi.mock("@/components/DebugWarningBanner", () => ({- DebugWarningBanner: () => null,-}));--vi.mock("@/components/NoRedisWarningBanner", () => ({- NoRedisWarningBanner: () => null,-}));--vi.mock("@/components/EnvCredentialLoginWarningBanner", () => ({- EnvCredentialLoginWarningBanner: () => null,-}));--vi.mock("@/components/LicenseExpiryBanner", () => ({- LicenseExpiryBanner: () => null,-}));-vi.mock("@/components/UserBanner", () => ({UserBanner: () => null,}));diff --git a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsxindex b0494f8415a..083118bc65d 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx+++ b/ui/litellm-dashboard/src/app/(dashboard)/layout.tsx@@ -9,10 +9,12 @@ import { ThemeProvider } from "@/contexts/ThemeContext";import { useAuth } from "@/contexts/AuthContext";import SidebarProvider from "@/app/(dashboard)/components/SidebarProvider";import { usePathname, useRouter, useSearchParams } from "next/navigation";-import { DebugWarningBanner } from "@/components/DebugWarningBanner";-import { NoRedisWarningBanner } from "@/components/NoRedisWarningBanner";-import { EnvCredentialLoginWarningBanner } from "@/components/EnvCredentialLoginWarningBanner";-import { LicenseExpiryBanner } from "@/components/LicenseExpiryBanner";+import {+ createDeploymentHealthHandle,+ DeploymentHealthBanner,+ DeploymentHealthIcon,+} from "@/components/DeploymentHealth/DeploymentHealth";+import { DeploymentHealthPanel } from "@/components/DeploymentHealth/DeploymentHealthPanel";import { UserBanner } from "@/components/UserBanner";import { LiteAdminFrame } from "@/components/liteadmin/LiteAdmin";import { routeSegmentForPathname, uiHref } from "@/utils/uiHref";@@ -121,6 +123,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {const isDesktop = useMediaQuery("(min-width: 768px)", { initializeWithValue: false });const [mobileNavigationKey, setMobileNavigationKey] = useState<string | null>(null);const [mobileNavigationHandle] = useState(() => DialogPrimitive.createHandle());+ const [deploymentHealthHandle] = useState(createDeploymentHealthHandle);if (mobileNavigationKey !== null && (isDesktop || mobileNavigationKey !== navigationKey)) {setMobileNavigationKey(null);}@@ -140,11 +143,13 @@ function DashboardShell({ children }: { children: React.ReactNode }) {if (!isGateway) {return (<div className="flex h-screen flex-col overflow-hidden bg-background">- <Navbar accessToken={accessToken} isPublicPage={false} />- <DebugWarningBanner accessToken={accessToken} />- <NoRedisWarningBanner accessToken={accessToken} />- <EnvCredentialLoginWarningBanner accessToken={accessToken} />- <LicenseExpiryBanner accessToken={accessToken} />+ <Navbar+ accessToken={accessToken}+ isPublicPage={false}+ deploymentHealth={<DeploymentHealthIcon handle={deploymentHealthHandle} />}+ />+ <DeploymentHealthBanner handle={deploymentHealthHandle} />+ <DeploymentHealthPanel handle={deploymentHealthHandle} /><UserBanner accessToken={accessToken} /><main className="flex min-h-0 flex-1 overflow-hidden"><AgentControlPlaneView />@@ -193,11 +198,10 @@ function DashboardShell({ children }: { children: React.ReactNode }) {<Menu /></SheetTrigger>}+ deploymentHealth={<DeploymentHealthIcon handle={deploymentHealthHandle} />}/>- <DebugWarningBanner accessToken={accessToken} />- <NoRedisWarningBanner accessToken={accessToken} />- <EnvCredentialLoginWarningBanner accessToken={accessToken} />- <LicenseExpiryBanner accessToken={accessToken} />+ <DeploymentHealthBanner handle={deploymentHealthHandle} />+ <DeploymentHealthPanel handle={deploymentHealthHandle} /><UserBanner accessToken={accessToken} /><main className="min-h-0 min-w-0 flex-1 overflow-y-auto"><TelemetryEnvBanner />diff --git a/ui/litellm-dashboard/src/components/DashboardHeader.tsx b/ui/litellm-dashboard/src/components/DashboardHeader.tsxindex 77e44a2ff9b..b31fc794f79 100644--- a/ui/litellm-dashboard/src/components/DashboardHeader.tsx+++ b/ui/litellm-dashboard/src/components/DashboardHeader.tsx@@ -34,9 +34,11 @@ import { CommandPaletteTrigger } from "@/components/CommandPalette/CommandPalettexport function DashboardHeader({accessToken,navigationTrigger,+ deploymentHealth,}: {accessToken: string | null;navigationTrigger?: ReactNode;+ deploymentHealth?: ReactNode;}) {const { title } = getBreadcrumb(usePathname());const isDesktop = useMediaQuery("(min-width: 768px)", { initializeWithValue: false });@@ -84,10 +86,12 @@ export function DashboardHeader({{!hideCommunityLinks && <CommunityEngagementButtons />}<ToolbarSeparator /><ThemeToggle />+ {deploymentHealth}<NotificationsBell accessToken={accessToken} /></div><div className="flex shrink-0 items-center gap-1 md:hidden"><CommandPaletteTrigger mobile />+ {deploymentHealth}<NotificationsBell accessToken={accessToken} /><Popover open={!isDesktop && mobileToolsOpen} onOpenChange={setMobileToolsOpen}><PopoverTrigger render={<Button variant="ghost" size="icon" className="size-11" aria-label="More options" />}>diff --git a/ui/litellm-dashboard/src/components/DebugWarningBanner.test.tsx b/ui/litellm-dashboard/src/components/DebugWarningBanner.test.tsxdeleted file mode 100644index 6f04c3d5532..00000000000--- a/ui/litellm-dashboard/src/components/DebugWarningBanner.test.tsx+++ /dev/null@@ -1,53 +0,0 @@-import { renderWithProviders, screen } from "../../tests/test-utils";-import { vi } from "vitest";-import { DebugWarningBanner } from "./DebugWarningBanner";--vi.mock("@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails", () => ({- useHealthReadinessDetails: vi.fn(),-}));--import { useHealthReadinessDetails } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";--describe("DebugWarningBanner", () => {- it("should render", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: { is_detailed_debug: true } } as any);- renderWithProviders(<DebugWarningBanner accessToken="token" />);- expect(screen.getByRole("alert")).toBeInTheDocument();- });-- it("should show warning when detailed debug mode is active", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: { is_detailed_debug: true } } as any);- renderWithProviders(<DebugWarningBanner accessToken="token" />);- expect(screen.getByText(/Performance Warning: Detailed Debug Mode Active/i)).toBeInTheDocument();- });-- it("should mention LITELLM_LOG=DEBUG in the description", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: { is_detailed_debug: true } } as any);- renderWithProviders(<DebugWarningBanner accessToken="token" />);- expect(screen.getByText("LITELLM_LOG=DEBUG")).toBeInTheDocument();- });-- it("should render nothing when is_detailed_debug is false", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: { is_detailed_debug: false } } as any);- const { container } = renderWithProviders(<DebugWarningBanner accessToken="token" />);- expect(container).toBeEmptyDOMElement();- });-- it("should render nothing when health data is undefined", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: undefined } as any);- const { container } = renderWithProviders(<DebugWarningBanner accessToken="token" />);- expect(container).toBeEmptyDOMElement();- });-- it("should pass accessToken to the readiness hook", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: undefined } as any);- renderWithProviders(<DebugWarningBanner accessToken="my-token" />);- expect(useHealthReadinessDetails).toHaveBeenCalledWith("my-token");- });-- it("should pass a null accessToken through (disables the hook)", () => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data: undefined } as any);- renderWithProviders(<DebugWarningBanner accessToken={null} />);- expect(useHealthReadinessDetails).toHaveBeenCalledWith(null);- });-});diff --git a/ui/litellm-dashboard/src/components/DebugWarningBanner.tsx b/ui/litellm-dashboard/src/components/DebugWarningBanner.tsxdeleted file mode 100644index 9591fe4bb1f..00000000000--- a/ui/litellm-dashboard/src/components/DebugWarningBanner.tsx+++ /dev/null@@ -1,31 +0,0 @@-"use client";--import React from "react";-import { TriangleAlert } from "lucide-react";-import { Alert, AlertDescription, AlertTitle } from "@/components/shared/Alert";-import { useHealthReadinessDetails } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";--interface DebugWarningBannerProps {- accessToken: string | null;-}--export const DebugWarningBanner: React.FC<DebugWarningBannerProps> = ({ accessToken }) => {- const { data: healthData } = useHealthReadinessDetails(accessToken);-- // Only show banner if detailed debug mode is explicitly enabled- if (!healthData?.is_detailed_debug) {- return null;- }-- return (- <Alert variant="warning" className="rounded-none border-x-0 border-t-0">- <TriangleAlert className="size-4" aria-hidden />- <AlertTitle>Performance Warning: Detailed Debug Mode Active</AlertTitle>- <AlertDescription>- Detailed debug logging (<code>LITELLM_LOG=DEBUG</code>) is currently enabled. This mode logs extensive- diagnostic information and will significantly degrade performance. It should only be used for troubleshooting- and disabled in production environments.- </AlertDescription>- </Alert>- );-};diff --git a/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealth.integration.test.tsx b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealth.integration.test.tsxnew file mode 100644index 00000000000..1b4d96c352d--- /dev/null+++ b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealth.integration.test.tsx@@ -0,0 +1,344 @@+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { useState } from "react";+import userEvent from "@testing-library/user-event";+import type { DeploymentWarning } from "@/app/(dashboard)/hooks/deploymentWarnings/useDeploymentWarnings";+import { renderWithProviders, screen, testQueryClient, waitFor, within } from "../../../tests/test-utils";+import { createDeploymentHealthHandle, DeploymentHealthBanner, DeploymentHealthIcon } from "./DeploymentHealth";+import { DeploymentHealthPanel } from "./DeploymentHealthPanel";++vi.unmock("@/app/(dashboard)/hooks/useAuthorized");++const NOW = new Date("2026-10-14T12:00:00Z");++interface PatchCall {+ id: string;+ body: { ignored: boolean; snooze_seconds?: number };+}++interface FakeProxy {+ warnings: DeploymentWarning[];+ ignoreAvailable: boolean;+ gets: number;+ patches: PatchCall[];+}++const proxy: FakeProxy = { warnings: [], ignoreAvailable: true, gets: 0, patches: [] };++const ENV_CREDENTIAL: DeploymentWarning = { id: "env_credential_login", severity: "critical", ignore: null };+const LICENSE_IN_3_DAYS: DeploymentWarning = { id: "license_expiry:2026-10-17", severity: "critical", ignore: null };+const NO_REDIS: DeploymentWarning = { id: "no_redis", severity: "warning", ignore: null };+const DEBUG: DeploymentWarning = { id: "detailed_debug", severity: "warning", ignore: null };++const snoozedBy = (user: string, until: string): DeploymentWarning["ignore"] => ({+ source: "admin",+ ignored_by: user,+ ignored_at: "2026-09-30T09:30:00Z",+ ignored_until: until,+});++const signIn = (userRole: string) => {+ const claims = { key: "sk-health-test", user_id: "admin-1", user_role: userRole, exp: NOW.getTime() / 1000 + 3600 };+ const token = `${btoa(JSON.stringify({ alg: "none" }))}.${btoa(JSON.stringify(claims))}.test`;+ document.cookie = `token=${token}; Path=/`;+};++const handleRequest = async (request: Request): Promise<Response> => {+ const { pathname } = new URL(request.url);+ if (pathname === "/litellm/.well-known/litellm-ui-config") {+ return Response.json({ server_root_path: "", proxy_base_url: "", admin_ui_disabled: false });+ }+ if (pathname === "/health/deployment_warnings" && request.method === "GET") {+ proxy.gets += 1;+ return Response.json({ warnings: proxy.warnings, ignore_available: proxy.ignoreAvailable });+ }+ const patched = pathname.match(/^\/health\/deployment_warnings\/(.+)$/);+ if (patched && request.method === "PATCH") {+ const id = decodeURIComponent(patched[1]);+ const body: PatchCall["body"] = await request.json();+ proxy.patches.push({ id, body });+ const ignore = body.ignored+ ? {+ source: "admin" as const,+ ignored_by: "admin-1",+ ignored_at: NOW.toISOString(),+ ignored_until: body.snooze_seconds+ ? new Date(NOW.getTime() + body.snooze_seconds * 1000).toISOString()+ : null,+ }+ : null;+ proxy.warnings = proxy.warnings.map((warning) => (warning.id === id ? { ...warning, ignore } : warning));+ return Response.json({ id, ignore });+ }+ throw new Error(`Unexpected request: ${request.method} ${request.url}`);+};++const Harness = () => {+ const [handle] = useState(createDeploymentHealthHandle);+ return (+ <>+ <header>+ <DeploymentHealthIcon handle={handle} />+ </header>+ <DeploymentHealthBanner handle={handle} />+ <DeploymentHealthPanel handle={handle} />+ </>+ );+};++const renderHealth = (userRole = "proxy_admin") => {+ signIn(userRole);+ return renderWithProviders(<Harness />);+};++const openPanel = async (user: ReturnType<typeof userEvent.setup>) => {+ await user.click(await screen.findByRole("button", { name: /^Deployment health/ }));+ return screen.findByRole("dialog", { name: "Deployment health" });+};++const EMPTY_PROXY: FakeProxy = { warnings: [], ignoreAvailable: true, gets: 0, patches: [] };++beforeEach(() => {+ vi.useFakeTimers({ toFake: ["Date"] });+ vi.setSystemTime(NOW);+ testQueryClient.clear();+ Object.assign(proxy, EMPTY_PROXY, { patches: [] });+ vi.stubGlobal(+ "fetch",+ vi.fn((input: RequestInfo | URL, init?: RequestInit) =>+ handleRequest(input instanceof Request ? input : new Request(new URL(String(input), "http://localhost"), init)),+ ),+ );+});++afterEach(() => {+ testQueryClient.clear();+ vi.unstubAllGlobals();+ vi.useRealTimers();+ document.cookie = "token=; Max-Age=0; Path=/";+});++describe("deployment health icon", () => {+ it("should show a plain shield with no count when every warning is ignored", async () => {+ proxy.warnings = [{ ...NO_REDIS, ignore: snoozedBy("admin-2", "2026-10-21T17:04:12Z") }];+ renderHealth();++ await waitFor(() => expect(proxy.gets).toBe(1));+ const icon = await screen.findByRole("button", { name: "Deployment health" });+ expect(icon).toHaveTextContent(/^$/);+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();+ });++ it.each([+ {+ name: "destructive when a critical warning is active",+ warnings: [ENV_CREDENTIAL, NO_REDIS],+ tone: "error",+ },+ { name: "quiet when only non-critical warnings are active", warnings: [NO_REDIS, DEBUG], tone: "neutral" },+ ])("should count active warnings and be $name", async ({ warnings, tone }) => {+ proxy.warnings = [...warnings, { ...LICENSE_IN_3_DAYS, ignore: snoozedBy("admin-2", "2026-10-21T17:04:12Z") }];+ renderHealth();++ const icon = await screen.findByRole("button", { name: "Deployment health, 2 active warnings" });+ expect(within(icon).getByText("2")).toHaveAttribute("data-tone", tone);+ });++ it("should not render or call the proxy for users below proxy admin viewer", async () => {+ proxy.warnings = [ENV_CREDENTIAL];+ renderHealth("internal_user");++ await waitFor(() => expect(vi.mocked(fetch)).toHaveBeenCalled());+ expect(screen.queryByRole("button", { name: /Deployment health/ })).not.toBeInTheDocument();+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();+ expect(proxy.gets).toBe(0);+ });+});++describe("deployment banner", () => {+ it("should show the first critical warning ahead of warnings without counting the rest", async () => {+ proxy.warnings = [NO_REDIS, LICENSE_IN_3_DAYS, ENV_CREDENTIAL];+ renderHealth();++ const banner = await screen.findByRole("alert", { name: "Deployment alert" });+ expect(banner).toHaveTextContent("Your LiteLLM Enterprise license expires in 3 days (Oct 17, 2026)");+ expect(banner).not.toHaveTextContent("No Redis configured");+ expect(banner).not.toHaveTextContent("more");+ });++ it("should show the top warning when no critical warning is active", async () => {+ proxy.warnings = [NO_REDIS, { ...ENV_CREDENTIAL, ignore: snoozedBy("admin-2", "2026-10-21T17:04:12Z") }];+ renderHealth();++ const banner = await screen.findByRole("status", { name: "Deployment alert" });+ expect(banner).toHaveTextContent("No Redis configured");+ expect(screen.queryByRole("alert")).not.toBeInTheDocument();+ });++ it("should open the panel from Review", async () => {+ const user = userEvent.setup();+ proxy.warnings = [ENV_CREDENTIAL];+ renderHealth();++ await user.click(await within(await screen.findByRole("alert")).findByRole("button", { name: "Review" }));++ const panel = await screen.findByRole("dialog", { name: "Deployment health" });+ expect(within(panel).getByRole("article", { name: "Environment-credential login is enabled" })).toBeVisible();+ });+});++describe("deployment health panel", () => {+ it("should group active warnings by severity and keep ignored ones collapsed with who and until when", async () => {+ const user = userEvent.setup();+ proxy.warnings = [+ ENV_CREDENTIAL,+ NO_REDIS,+ { ...DEBUG, ignore: snoozedBy("admin-2", "2026-10-21T17:04:12Z") },+ { id: "license_expiry:2026-10-01", severity: "critical", ignore: snoozedBy("admin-3", "2026-10-15T00:00:00Z") },+ ];+ renderHealth();+ const panel = await openPanel(user);++ expect(+ within(panel)+ .getAllByRole("region")+ .map((region) => region.getAttribute("aria-label")),+ ).toEqual(["Critical", "Warnings", "Ignored and snoozed"]);+ const critical = within(panel).getByRole("region", { name: "Critical" });+ expect(within(critical).getByRole("article")).toHaveTextContent(+ "general_settings.disable_env_credential_login: true",+ );+ const warnings = within(panel).getByRole("region", { name: "Warnings" });+ expect(+ within(critical)+ .getAllByRole("article")+ .map((item) => item.getAttribute("aria-label")),+ ).toEqual(["Environment-credential login is enabled"]);+ expect(+ within(warnings)+ .getAllByRole("article")+ .map((item) => item.getAttribute("aria-label")),+ ).toEqual(["No Redis configured"]);+ expect(within(warnings).getByRole("link", { name: "Read the docs" })).toHaveAttribute(+ "href",+ "https://docs.litellm.ai/docs/proxy/redis_requirements",+ );+ expect(within(warnings).getByRole("link", { name: "Read the docs" })).toHaveAttribute("target", "_blank");+ expect(within(warnings).getByRole("link", { name: "Read the docs" })).toHaveAttribute(+ "rel",+ expect.stringContaining("noopener"),+ );+ expect(within(panel).queryByRole("article", { name: "Detailed debug logging is on" })).not.toBeInTheDocument();++ await user.click(within(panel).getByRole("button", { name: "Ignored and snoozed 2" }));++ const debug = within(panel).getByRole("article", { name: "Detailed debug logging is on" });+ expect(within(debug).getByText("Snoozed")).toBeVisible();+ expect(within(debug).getByText(/^Until/)).toHaveTextContent(/^Until Oct 2[12], 2026/);+ expect(debug).toHaveTextContent("by admin-2");+ const expired = within(panel).getByRole("article", {+ name: "Your LiteLLM Enterprise license expired on Oct 1, 2026",+ });+ expect(expired).toHaveTextContent("by admin-3");++ await user.hover(within(debug).getByText(/^Until/));+ expect(await screen.findByText(/October 21, 2026 at 5:04:12\sPM UTC/)).toBeVisible();+ });++ it.each([+ { option: "Snooze for 1 day", body: { ignored: true, snooze_seconds: 86_400 }, badge: /^Snoozed$/ },+ { option: "Snooze for 7 days", body: { ignored: true, snooze_seconds: 604_800 }, badge: /^Snoozed$/ },+ { option: "Snooze for 30 days", body: { ignored: true, snooze_seconds: 2_592_000 }, badge: /^Snoozed$/ },+ { option: "Ignore forever", body: { ignored: true }, badge: /^Ignored$/ },+ ])(+ "should let a proxy admin $option and move the warning to the ignored section",+ async ({ option, body, badge }) => {+ const user = userEvent.setup();+ proxy.warnings = [ENV_CREDENTIAL, NO_REDIS];+ renderHealth();+ const panel = await openPanel(user);++ await user.click(within(panel).getByRole("button", { name: "Snooze No Redis configured" }));+ await user.click(await screen.findByRole("menuitem", { name: option }));++ await waitFor(() => expect(proxy.patches).toEqual([{ id: "no_redis", body }]));+ await waitFor(() => expect(within(panel).queryByRole("region", { name: "Warnings" })).not.toBeInTheDocument());+ await user.click(within(panel).getByRole("button", { name: "Ignored and snoozed 1" }));+ const item = within(panel).getByRole("article", { name: "No Redis configured" });+ expect(within(item).getByText(badge)).toBeVisible();+ expect(item).toHaveTextContent("by admin-1");++ await user.keyboard("{Escape}");+ expect(await screen.findByRole("button", { name: "Deployment health, 1 active warning" })).toBeVisible();+ },+ );++ it("should restore an ignored warning back into its severity group", async () => {+ const user = userEvent.setup();+ proxy.warnings = [{ ...ENV_CREDENTIAL, ignore: snoozedBy("admin-2", "2026-10-21T17:04:12Z") }];+ renderHealth();+ const panel = await openPanel(user);+ expect(within(panel).getByText("No active warnings")).toBeVisible();++ await user.click(within(panel).getByRole("button", { name: "Ignored and snoozed 1" }));+ await user.click(within(panel).getByRole("button", { name: "Restore Environment-credential login is enabled" }));++ await waitFor(() => expect(proxy.patches).toEqual([{ id: "env_credential_login", body: { ignored: false } }]));+ const critical = await within(panel).findByRole("region", { name: "Critical" });+ expect(within(critical).getByRole("article", { name: "Environment-credential login is enabled" })).toBeVisible();++ await user.keyboard("{Escape}");+ expect(await screen.findByRole("alert")).toHaveTextContent("Environment-credential login is enabled");+ });++ it("should show an env var ignore without a restore action", async () => {+ const user = userEvent.setup();+ proxy.warnings = [{ ...NO_REDIS, ignore: { source: "env_var", env_var: "LITELLM_DISABLE_NO_REDIS_WARNING" } }];+ renderHealth();+ const panel = await openPanel(user);++ await user.click(within(panel).getByRole("button", { name: "Ignored and snoozed 1" }));++ const item = within(panel).getByRole("article", { name: "No Redis configured" });+ expect(item).toHaveTextContent("By env var LITELLM_DISABLE_NO_REDIS_WARNING");+ expect(within(item).queryByRole("button")).not.toBeInTheDocument();+ });++ it("should leave only the docs link when no database is connected", async () => {+ const user = userEvent.setup();+ proxy.warnings = [NO_REDIS];+ proxy.ignoreAvailable = false;+ renderHealth();+ const panel = await openPanel(user);++ const item = within(panel).getByRole("article", { name: "No Redis configured" });+ expect(within(item).getByRole("link", { name: "Read the docs" })).toBeVisible();+ expect(within(item).queryByRole("button")).not.toBeInTheDocument();+ });++ it("should let a proxy admin viewer read warnings without ignore or restore actions", async () => {+ const user = userEvent.setup();+ proxy.warnings = [NO_REDIS, { ...ENV_CREDENTIAL, ignore: snoozedBy("admin-2", "2026-10-21T17:04:12Z") }];+ renderHealth("proxy_admin_viewer");+ const panel = await openPanel(user);+ await user.click(within(panel).getByRole("button", { name: "Ignored and snoozed 1" }));++ const active = within(panel).getByRole("article", { name: "No Redis configured" });+ const ignored = within(panel).getByRole("article", { name: "Environment-credential login is enabled" });+ expect(ignored).toHaveTextContent("by admin-2");+ expect(within(active).queryByRole("button")).not.toBeInTheDocument();+ expect(within(ignored).queryByRole("button")).not.toBeInTheDocument();+ });++ it("should refetch when opened even while the icon is served from cache", async () => {+ const user = userEvent.setup();+ proxy.warnings = [NO_REDIS];+ renderHealth();+ await screen.findByRole("button", { name: "Deployment health, 1 active warning" });+ proxy.warnings = [NO_REDIS, DEBUG];++ const panel = await openPanel(user);++ expect(await within(panel).findByRole("article", { name: "Detailed debug logging is on" })).toBeVisible();+ expect(proxy.gets).toBe(2);+ });+});diff --git a/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealth.tsx b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealth.tsxnew file mode 100644index 00000000000..edfe4a06494--- /dev/null+++ b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealth.tsx@@ -0,0 +1,83 @@+"use client";++import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";+import { CircleAlert, Shield, TriangleAlert } from "lucide-react";+import {+ type DeploymentWarning,+ useDeploymentHealthAccess,+ useDeploymentWarnings,+} from "@/app/(dashboard)/hooks/deploymentWarnings/useDeploymentWarnings";+import { Alert, AlertTitle } from "@/components/shared/Alert";+import { Badge } from "@/components/ui/badge";+import { Button } from "@/components/ui/button";+import { SheetTrigger } from "@/components/ui/sheet";+import { deploymentWarningContent } from "./DeploymentWarningContent";++export type DeploymentHealthHandle = DialogPrimitive.Handle<unknown>;++export const createDeploymentHealthHandle = (): DeploymentHealthHandle => DialogPrimitive.createHandle();++export const activeWarnings = (warnings: readonly DeploymentWarning[]): DeploymentWarning[] =>+ warnings.filter((warning) => !warning.ignore);++const pluralWarnings = (count: number): string => `${count} active ${count === 1 ? "warning" : "warnings"}`;++export const DeploymentHealthIcon = ({ handle }: { handle: DeploymentHealthHandle }) => {+ const { canView } = useDeploymentHealthAccess();+ const { data } = useDeploymentWarnings();+ if (!canView) return null;++ const active = activeWarnings(data?.warnings ?? []);+ const hasCritical = active.some((warning) => warning.severity === "critical");++ return (+ <SheetTrigger+ handle={handle}+ render={<Button variant="ghost" size="icon" className="relative text-muted-foreground hover:text-foreground" />}+ aria-label={active.length > 0 ? `Deployment health, ${pluralWarnings(active.length)}` : "Deployment health"}+ >+ <Shield className="size-4" aria-hidden />+ {active.length > 0 ? (+ <Badge+ data-tone={hasCritical ? "error" : "neutral"}+ className="absolute top-1 left-5 h-4 border-0 min-w-4 px-1 tabular-nums ring-2 ring-background data-[tone=error]:bg-destructive data-[tone=error]:text-white data-[tone=neutral]:bg-muted-foreground data-[tone=neutral]:text-background"+ aria-hidden+ >+ {active.length}+ </Badge>+ ) : null}+ </SheetTrigger>+ );+};++export const DeploymentHealthBanner = ({ handle }: { handle: DeploymentHealthHandle }) => {+ const { canView } = useDeploymentHealthAccess();+ const { data } = useDeploymentWarnings();+ const active = activeWarnings(data?.warnings ?? []);+ const top = active.find((warning) => warning.severity === "critical") ?? active[0];+ if (!canView || !top) return null;++ const critical = top.severity === "critical";+ const Icon = critical ? CircleAlert : TriangleAlert;+ return (+ <Alert+ variant={critical ? "error" : "warning"}+ role={critical ? "alert" : "status"}+ aria-label="Deployment alert"+ className="min-h-10 shrink-0 items-center *:[svg]:text-warning data-[variant=error]:*:[svg]:text-destructive rounded-none border-x-0 border-t-0 border-b-warning/25 bg-warning/10 px-4 py-2 text-[13px] leading-5 text-foreground data-[variant=error]:border-b-destructive/25 data-[variant=error]:bg-destructive/10"+ >+ <Icon aria-hidden />+ <AlertTitle className="flex flex-wrap items-center gap-x-2">+ {deploymentWarningContent(top.id).title}+ <SheetTrigger+ handle={handle}+ render={+ <Button variant="link" className="h-auto p-0 text-[13px] leading-5 font-medium text-foreground underline" />+ }+ >+ Review+ </SheetTrigger>+ </AlertTitle>+ </Alert>+ );+};diff --git a/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealthPanel.tsx b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealthPanel.tsxnew file mode 100644index 00000000000..957dcff4bcd--- /dev/null+++ b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentHealthPanel.tsx@@ -0,0 +1,321 @@+"use client";++import {+ BellOff,+ ChevronDown,+ ChevronRight,+ CircleAlert,+ Clock,+ ExternalLink,+ ShieldCheck,+ TriangleAlert,+} from "lucide-react";+import {+ type DeploymentWarning,+ useDeploymentHealthAccess,+ useDeploymentWarnings,+ useUpdateDeploymentWarningIgnore,+} from "@/app/(dashboard)/hooks/deploymentWarnings/useDeploymentWarnings";+import { Alert, AlertDescription, AlertTitle } from "@/components/shared/Alert";+import { Badge } from "@/components/ui/badge";+import { Button, buttonVariants } from "@/components/ui/button";+import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty";+import { cn } from "@/lib/cva.config";+import { Skeleton } from "@/components/ui/skeleton";+import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "@/components/ui/sheet";+import { SimpleTooltip } from "@/components/ui/tooltip";+import { activeWarnings, type DeploymentHealthHandle } from "./DeploymentHealth";+import { deploymentWarningContent } from "./DeploymentWarningContent";++const DAY_SECONDS = 24 * 60 * 60;++const SNOOZE_OPTIONS = [+ { label: "Snooze for 1 day", seconds: DAY_SECONDS },+ { label: "Snooze for 7 days", seconds: 7 * DAY_SECONDS },+ { label: "Snooze for 30 days", seconds: 30 * DAY_SECONDS },+] as const;++const SEVERITY_GROUPS = [+ { severity: "critical", label: "Critical" },+ { severity: "warning", label: "Warnings" },+] as const;++const LOCAL_DAY_FORMAT = new Intl.DateTimeFormat(undefined, { dateStyle: "medium" });+const LOCAL_MINUTE_FORMAT = new Intl.DateTimeFormat(undefined, { dateStyle: "medium", timeStyle: "short" });+const FULL_UTC_FORMAT = new Intl.DateTimeFormat("en-US", { dateStyle: "full", timeStyle: "long", timeZone: "UTC" });++const formatLocalMinute = (iso: string): string => LOCAL_MINUTE_FORMAT.format(new Date(iso));+const formatLocalDay = (iso: string): string => LOCAL_DAY_FORMAT.format(new Date(iso));+const formatFullUtc = (iso: string): string => FULL_UTC_FORMAT.format(new Date(iso));++interface ItemPermissions {+ canManage: boolean;+ ignoreAvailable: boolean;+}++type IgnoreState = NonNullable<DeploymentWarning["ignore"]>;++const SnoozeMenu = ({ warningId, title }: { warningId: string; title: string }) => {+ const update = useUpdateDeploymentWarningIgnore();+ const ignore = (snoozeSeconds?: number) =>+ update.mutate({ warningId, update: { ignored: true, snooze_seconds: snoozeSeconds } });+ return (+ <DropdownMenu>+ <DropdownMenuTrigger+ render={+ <Button+ variant="outline"+ size="sm"+ className="h-7 text-[13px]"+ disabled={update.isPending}+ aria-label={`Snooze ${title}`}+ />+ }+ >+ Snooze+ <ChevronDown data-icon="inline-end" aria-hidden />+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end" className="min-w-48 [&_[data-slot=dropdown-menu-item]]:whitespace-nowrap">+ {SNOOZE_OPTIONS.map(({ label, seconds }) => (+ <DropdownMenuItem key={seconds} onClick={() => ignore(seconds)}>+ <Clock aria-hidden />+ {label}+ </DropdownMenuItem>+ ))}+ <DropdownMenuSeparator />+ <DropdownMenuItem onClick={() => ignore()}>+ <BellOff aria-hidden />+ Ignore forever+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ );+};++const RestoreButton = ({ warningId, title }: { warningId: string; title: string }) => {+ const update = useUpdateDeploymentWarningIgnore();+ return (+ <Button+ variant="outline"+ size="sm"+ className="h-7 text-[13px]"+ disabled={update.isPending}+ aria-label={`Restore ${title}`}+ onClick={() => update.mutate({ warningId, update: { ignored: false } })}+ >+ Restore+ </Button>+ );+};++const ItemAction = ({+ warning,+ title,+ canManage,+ ignoreAvailable,+}: ItemPermissions & { warning: DeploymentWarning; title: string }) => {+ if (!canManage || !ignoreAvailable) return null;+ if (!warning.ignore) return <SnoozeMenu warningId={warning.id} title={title} />;+ return warning.ignore.source === "admin" ? <RestoreButton warningId={warning.id} title={title} /> : null;+};++const IgnoreMeta = ({ ignore }: { ignore: IgnoreState }) => {+ if (ignore.source === "env_var") {+ return (+ <span>+ By env var <code className="font-mono wrap-anywhere">{ignore.env_var}</code>+ </span>+ );+ }+ if (ignore.ignored_until) {+ return (+ <span>+ <SimpleTooltip content={formatFullUtc(ignore.ignored_until)}>+ <span className="underline decoration-dotted underline-offset-3">+ Until {formatLocalMinute(ignore.ignored_until)}+ </span>+ </SimpleTooltip>{" "}+ · by {ignore.ignored_by}+ </span>+ );+ }+ return (+ <span>+ Since {formatLocalDay(ignore.ignored_at)} · by {ignore.ignored_by}+ </span>+ );+};++const IgnoreStatus = ({ ignore }: { ignore: IgnoreState }) => {+ const snoozed = ignore.source === "admin" && Boolean(ignore.ignored_until);+ const Icon = snoozed ? Clock : BellOff;+ return (+ <div className="mt-2 flex flex-wrap items-center gap-1.5 text-[12px] leading-4 text-muted-foreground">+ <Badge variant="outline" className="gap-1 bg-muted text-muted-foreground">+ <Icon aria-hidden />+ {snoozed ? "Snoozed" : "Ignored"}+ </Badge>+ <IgnoreMeta ignore={ignore} />+ </div>+ );+};++const WarningItem = ({ warning, ...permissions }: ItemPermissions & { warning: DeploymentWarning }) => {+ const content = deploymentWarningContent(warning.id);+ const critical = warning.severity === "critical";+ const SeverityIcon = critical ? CircleAlert : TriangleAlert;+ return (+ <Alert+ variant={critical ? "error" : "warning"}+ role="article"+ aria-label={content.title}+ data-ignored={warning.ignore ? "" : undefined}+ className="gap-x-2 border-warning/25 *:[svg]:text-warning data-[variant=error]:*:[svg]:text-destructive bg-warning/6 p-3 text-[13px] leading-5 text-foreground *:data-[slot=alert-description]:text-muted-foreground data-[variant=error]:border-destructive/35 data-[variant=error]:bg-destructive/10 data-ignored:border-warning/20 data-ignored:bg-warning/4 data-ignored:data-[variant=error]:border-destructive/20 data-ignored:data-[variant=error]:bg-destructive/4"+ >+ <SeverityIcon aria-hidden />+ <AlertTitle>{content.title}</AlertTitle>+ <AlertDescription className="flex flex-col [&_a]:no-underline [&_a]:hover:underline [&_p:not(:last-child)]:mb-0 text-[13px] leading-5 text-pretty [&_code]:font-mono [&_code]:text-[12px] [&_code]:wrap-anywhere [&_code]:text-foreground">+ {content.fix ? <p className="mt-0.5">{content.fix}</p> : null}+ {warning.ignore ? <IgnoreStatus ignore={warning.ignore} /> : null}+ <div className="mt-2 flex items-center gap-2">+ {content.docsUrl ? (+ <a+ href={content.docsUrl}+ target="_blank"+ rel="noopener noreferrer"+ className={cn(+ buttonVariants({ variant: "link" }),+ "h-auto gap-1 p-0 text-[13px] leading-5 font-medium text-foreground no-underline hover:underline",+ )}+ >+ Read the docs+ <ExternalLink className="size-3.5 text-muted-foreground" aria-hidden />+ </a>+ ) : null}+ <span className="flex-1" />+ <ItemAction warning={warning} title={content.title} {...permissions} />+ </div>+ </AlertDescription>+ </Alert>+ );+};++const GroupTrigger = ({ label, count }: { label: string; count: number }) => (+ <CollapsibleTrigger className="flex h-8 w-fit items-center gap-1.5 rounded-sm font-semibold outline-none focus-visible:ring-3 focus-visible:ring-ring/50 data-[panel-open]:[&>svg]:rotate-90">+ <ChevronRight className="size-3.5 text-muted-foreground transition-transform" aria-hidden />+ {label} <span className="font-normal text-muted-foreground">{count}</span>+ </CollapsibleTrigger>+);++const WarningGroup = ({+ label,+ warnings,+ defaultOpen,+ permissions,+}: {+ label: string;+ warnings: readonly DeploymentWarning[];+ defaultOpen: boolean;+ permissions: ItemPermissions;+}) => (+ <Collapsible defaultOpen={defaultOpen} render={<section aria-label={label} />} className="flex flex-col gap-2">+ <GroupTrigger label={label} count={warnings.length} />+ <CollapsibleContent className="flex flex-col gap-2">+ {warnings.map((warning) => (+ <WarningItem key={warning.id} warning={warning} {...permissions} />+ ))}+ </CollapsibleContent>+ </Collapsible>+);++const PanelSkeleton = () => (+ <div className="flex flex-col gap-2" aria-hidden>+ {[0, 1].map((row) => (+ <div key={row} className="flex gap-2 rounded-lg border border-border p-3">+ <Skeleton className="size-4 rounded-full" />+ <div className="flex flex-1 flex-col gap-2">+ <Skeleton className="h-3 w-2/3" />+ <Skeleton className="h-3 w-full" />+ <Skeleton className="h-3 w-5/6" />+ </div>+ </div>+ ))}+ </div>+);++const NoActiveWarnings = ({ hasIgnored }: { hasIgnored: boolean }) => (+ <Empty className="gap-2 p-0 py-6">+ <EmptyHeader>+ <EmptyMedia+ variant="icon"+ className="border border-border bg-transparent text-muted-foreground [&_svg:not([class*='size-'])]:size-4"+ >+ <ShieldCheck aria-hidden />+ </EmptyMedia>+ <EmptyTitle className="text-[15px] leading-[22px] font-semibold tracking-normal">No active warnings</EmptyTitle>+ <EmptyDescription className="text-[13px] leading-5">+ {hasIgnored+ ? "Snoozed and ignored warnings are listed below"+ : "Deployment warnings show up here when this proxy\u2019s setup needs attention"}+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+);++const PanelBody = () => {+ const { canManage } = useDeploymentHealthAccess();+ const { data, isError } = useDeploymentWarnings({ refetchOnOpen: true });+ if (!data) {+ return (+ <div className="flex flex-col gap-2 px-4 pb-4 text-[13px] leading-5">+ {isError ? (+ <p className="text-destructive">Could not load deployment warnings</p>+ ) : (+ <>+ <span className="sr-only">Loading deployment warnings</span>+ <PanelSkeleton />+ </>+ )}+ </div>+ );+ }++ const permissions = { canManage, ignoreAvailable: data.ignore_available };+ const active = activeWarnings(data.warnings);+ const ignored = data.warnings.filter((warning) => warning.ignore);++ return (+ <div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 pb-4 text-[13px] leading-5">+ {active.length === 0 ? <NoActiveWarnings hasIgnored={ignored.length > 0} /> : null}+ {SEVERITY_GROUPS.map(({ severity, label }) => {+ const group = active.filter((warning) => warning.severity === severity);+ return group.length === 0 ? null : (+ <WarningGroup key={severity} label={label} warnings={group} defaultOpen permissions={permissions} />+ );+ })}+ {ignored.length > 0 ? (+ <WarningGroup label="Ignored and snoozed" warnings={ignored} defaultOpen={false} permissions={permissions} />+ ) : null}+ </div>+ );+};++export const DeploymentHealthPanel = ({ handle }: { handle: DeploymentHealthHandle }) => (+ <Sheet handle={handle}>+ <SheetContent side="right" className="gap-0 data-[side=right]:sm:max-w-md">+ <SheetHeader className="gap-0.5 pr-12">+ <SheetTitle className="text-[15px] leading-[22px] font-semibold">Deployment health</SheetTitle>+ <SheetDescription className="text-[13px] leading-5">Warnings about how this proxy is deployed</SheetDescription>+ </SheetHeader>+ <PanelBody />+ </SheetContent>+ </Sheet>+);diff --git a/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentWarningContent.test.tsx b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentWarningContent.test.tsxnew file mode 100644index 00000000000..20823f34c6a--- /dev/null+++ b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentWarningContent.test.tsx@@ -0,0 +1,39 @@+import { describe, expect, it } from "vitest";+import { render, screen } from "@testing-library/react";+import { deploymentWarningContent } from "./DeploymentWarningContent";++const NOW = new Date("2026-10-14T12:00:00Z");++describe("deploymentWarningContent", () => {+ it.each([+ { expiry: "2026-10-14", title: "Your LiteLLM Enterprise license expires today (Oct 14, 2026)" },+ { expiry: "2026-10-15", title: "Your LiteLLM Enterprise license expires in 1 day (Oct 15, 2026)" },+ { expiry: "2026-11-13", title: "Your LiteLLM Enterprise license expires in 30 days (Nov 13, 2026)" },+ { expiry: "2026-10-13", title: "Your LiteLLM Enterprise license expired on Oct 13, 2026" },+ ])("should title a license expiring on $expiry by its distance from today", ({ expiry, title }) => {+ expect(deploymentWarningContent(`license_expiry:${expiry}`, NOW).title).toBe(title);+ });++ it.each(["2026-10-20", "2026-10-01"])("should point a license expiring %s at sales", (expiry) => {+ render(<p>{deploymentWarningContent(`license_expiry:${expiry}`, NOW).fix}</p>);++ expect(screen.getByRole("link", { name: "[email protected]" })).toHaveAttribute("href", "mailto:[email protected]");+ });++ it("should tell admins which setting turns env credential login off", () => {+ render(<p>{deploymentWarningContent("env_credential_login", NOW).fix}</p>);++ expect(screen.getByText("general_settings.disable_env_credential_login: true")).toBeInTheDocument();+ });++ it.each(["env_credential_login", "no_redis", "detailed_debug", "license_expiry:2026-10-20"])(+ "should link %s to the LiteLLM docs",+ (warningId) => {+ expect(deploymentWarningContent(warningId, NOW).docsUrl).toMatch(/^https:\/\/docs\.litellm\.ai\/docs\//);+ },+ );++ it("should fall back to the raw id for a warning the dashboard does not know yet", () => {+ expect(deploymentWarningContent("future_warning", NOW)).toEqual({ title: "future_warning" });+ });+});diff --git a/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentWarningContent.tsx b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentWarningContent.tsxnew file mode 100644index 00000000000..05ab16af333--- /dev/null+++ b/ui/litellm-dashboard/src/components/DeploymentHealth/DeploymentWarningContent.tsx@@ -0,0 +1,76 @@+import type { ReactNode } from "react";+import { formatExpiryDate, getDaysUntilExpiration } from "@/utils/licenseUtils";++const LICENSE_EXPIRY_PREFIX = "license_expiry:";+const SALES_EMAIL = "[email protected]";++export interface DeploymentWarningContent {+ title: string;+ fix?: ReactNode;+ docsUrl?: string;+}++const STATIC_CONTENT: Readonly<Record<string, DeploymentWarningContent>> = {+ env_credential_login: {+ title: "Environment-credential login is enabled",+ fix: (+ <>+ Anyone with <code>UI_USERNAME</code>/<code>UI_PASSWORD</code> (or the master key, when <code>UI_PASSWORD</code>{" "}+ is unset) can sign in as a proxy admin with a shared static secret. Create a regular admin account with its own+ password, then set <code>general_settings.disable_env_credential_login: true</code>+ </>+ ),+ docsUrl: "https://docs.litellm.ai/docs/proxy/ui",+ },+ no_redis: {+ title: "No Redis configured",+ fix: (+ <>+ This proxy runs more than one worker (or the worker count could not be verified). Without Redis, rate limits,+ budgets, router state and cache invalidation are per worker, so limits are enforced once per worker and spend+ can overshoot+ </>+ ),+ docsUrl: "https://docs.litellm.ai/docs/proxy/redis_requirements",+ },+ detailed_debug: {+ title: "Detailed debug logging is on",+ fix: (+ <>+ <code>LITELLM_LOG=DEBUG</code> logs extensive diagnostic information and significantly slows the proxy. Use it+ only while troubleshooting and turn it off in production+ </>+ ),+ docsUrl: "https://docs.litellm.ai/docs/proxy/prod",+ },+};++const describeCountdown = (days: number): string => {+ if (days <= 0) return "expires today";+ if (days === 1) return "expires in 1 day";+ return `expires in ${days} days`;+};++const licenseExpiryContent = (expirationDate: string, now: Date): DeploymentWarningContent => {+ const days = getDaysUntilExpiration(expirationDate, now) ?? 0;+ const formattedDate = formatExpiryDate(expirationDate);+ const salesLink = <a href={`mailto:${SALES_EMAIL}`}>{SALES_EMAIL}</a>;+ return days < 0+ ? {+ title: `Your LiteLLM Enterprise license expired on ${formattedDate}`,+ fix: <>Enterprise features are now disabled. Reach out to {salesLink} to restore access</>,+ docsUrl: "https://docs.litellm.ai/docs/proxy/enterprise",+ }+ : {+ title: `Your LiteLLM Enterprise license ${describeCountdown(days)} (${formattedDate})`,+ fix: <>Renew before it lapses to keep enterprise features. Reach out to {salesLink}</>,+ docsUrl: "https://docs.litellm.ai/docs/proxy/enterprise",+ };+};++export const deploymentWarningContent = (warningId: string, now: Date = new Date()): DeploymentWarningContent => {+ if (warningId.startsWith(LICENSE_EXPIRY_PREFIX)) {+ return licenseExpiryContent(warningId.slice(LICENSE_EXPIRY_PREFIX.length), now);+ }+ return STATIC_CONTENT[warningId] ?? { title: warningId };+};diff --git a/ui/litellm-dashboard/src/components/EnvCredentialLoginWarningBanner.test.tsx b/ui/litellm-dashboard/src/components/EnvCredentialLoginWarningBanner.test.tsxdeleted file mode 100644index f4c9cc7c44c..00000000000--- a/ui/litellm-dashboard/src/components/EnvCredentialLoginWarningBanner.test.tsx+++ /dev/null@@ -1,92 +0,0 @@-import { fireEvent, renderWithProviders, screen } from "../../tests/test-utils";-import { vi } from "vitest";-import { EnvCredentialLoginWarningBanner } from "./EnvCredentialLoginWarningBanner";-import type { HealthReadinessDetailsResponse } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";-import type { UseQueryResult } from "@tanstack/react-query";--vi.mock("@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails", () => ({- useHealthReadinessDetails: vi.fn(),-}));-vi.mock("@/contexts/AuthContext", () => ({- useAuth: vi.fn(),-}));--import { useHealthReadinessDetails } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";-import { useAuth } from "@/contexts/AuthContext";--const mockDetails = (data: Partial<HealthReadinessDetailsResponse> | undefined) => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data } as UseQueryResult<HealthReadinessDetailsResponse>);-};--const mockRole = (userRole: string) => {- vi.mocked(useAuth).mockReturnValue({ userRole } as ReturnType<typeof useAuth>);-};--describe("EnvCredentialLoginWarningBanner", () => {- beforeEach(() => {- localStorage.clear();- });-- it("should hide the banner when dismissed and stay hidden on remount", () => {- mockRole("Admin");- mockDetails({ status: "healthy", show_env_credential_login_warning: true });- const first = renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- fireEvent.click(screen.getByRole("button", { name: "Dismiss banner" }));- expect(first.container).toBeEmptyDOMElement();-- first.unmount();- const second = renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- expect(second.container).toBeEmptyDOMElement();- });-- it("should warn an admin when env-credential login is enabled", () => {- mockRole("Admin");- mockDetails({ status: "healthy", show_env_credential_login_warning: true });- renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- expect(screen.getByRole("alert")).toBeInTheDocument();- expect(screen.getByText("Environment-credential login is enabled")).toBeInTheDocument();- });-- it("should tell the admin to create a regular admin account before disabling", () => {- mockRole("Admin");- mockDetails({ status: "healthy", show_env_credential_login_warning: true });- renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- expect(screen.getByText(/First create a regular admin account/i)).toBeInTheDocument();- expect(screen.getByText("general_settings.disable_env_credential_login: true")).toBeInTheDocument();- });-- it("should warn an admin viewer too", () => {- mockRole("Admin Viewer");- mockDetails({ status: "healthy", show_env_credential_login_warning: true });- renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- expect(screen.getByRole("alert")).toBeInTheDocument();- });-- it("should render nothing for a non-admin even when the proxy reports the warning", () => {- mockRole("Internal User");- mockDetails({ status: "healthy", show_env_credential_login_warning: true });- const { container } = renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- expect(container).toBeEmptyDOMElement();- });-- it("should render nothing when env-credential login is disabled", () => {- mockRole("Admin");- mockDetails({ status: "healthy", show_env_credential_login_warning: false });- const { container } = renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="token" />);- expect(container).toBeEmptyDOMElement();- });-- it("should render nothing when readiness details are unavailable", () => {- mockRole("Admin");- mockDetails(undefined);- const { container } = renderWithProviders(<EnvCredentialLoginWarningBanner accessToken={null} />);- expect(container).toBeEmptyDOMElement();- });-- it("should pass the access token to the readiness hook", () => {- mockRole("Admin");- mockDetails(undefined);- renderWithProviders(<EnvCredentialLoginWarningBanner accessToken="my-token" />);- expect(useHealthReadinessDetails).toHaveBeenCalledWith("my-token");- });-});diff --git a/ui/litellm-dashboard/src/components/EnvCredentialLoginWarningBanner.tsx b/ui/litellm-dashboard/src/components/EnvCredentialLoginWarningBanner.tsxdeleted file mode 100644index a2cd531759e..00000000000--- a/ui/litellm-dashboard/src/components/EnvCredentialLoginWarningBanner.tsx+++ /dev/null@@ -1,49 +0,0 @@-"use client";--import React, { useState } from "react";-import { TriangleAlert, X } from "lucide-react";-import { Button } from "@/components/ui/button";-import { useHealthReadinessDetails } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";-import { useAuth } from "@/contexts/AuthContext";-import { isAdminRole } from "@/utils/roles";--const DISMISS_STORAGE_KEY = "litellm:envCredentialLoginWarningDismissed";--export const EnvCredentialLoginWarningBanner: React.FC<{ accessToken: string | null }> = ({ accessToken }) => {- const { userRole } = useAuth();- const { data: healthData } = useHealthReadinessDetails(accessToken);- const [dismissed, setDismissed] = useState(- () => typeof window !== "undefined" && localStorage.getItem(DISMISS_STORAGE_KEY) === "true",- );-- if (dismissed || !isAdminRole(userRole) || !healthData?.show_env_credential_login_warning) {- return null;- }-- const handleDismiss = () => {- localStorage.setItem(DISMISS_STORAGE_KEY, "true");- setDismissed(true);- };-- return (- <div- role="alert"- className="flex items-start gap-3 border-b border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive"- >- <TriangleAlert className="mt-0.5 size-5 shrink-0" aria-hidden="true" />- <div className="min-w-0 flex-1">- <p className="font-semibold">Environment-credential login is enabled</p>- <p>- Anyone with <code className="font-mono">UI_USERNAME</code>/<code className="font-mono">UI_PASSWORD</code> (or- the master key, when <code className="font-mono">UI_PASSWORD</code> is unset) can sign in as a proxy admin- with a shared static secret. First create a regular admin account with its own password, then set{" "}- <code className="font-mono">general_settings.disable_env_credential_login: true</code> to turn this login path- off.- </p>- </div>- <Button variant="ghost" size="icon-sm" className="shrink-0" aria-label="Dismiss banner" onClick={handleDismiss}>- <X />- </Button>- </div>- );-};diff --git a/ui/litellm-dashboard/src/components/LicenseExpiryBanner.test.tsx b/ui/litellm-dashboard/src/components/LicenseExpiryBanner.test.tsxdeleted file mode 100644index 627d108e65f..00000000000--- a/ui/litellm-dashboard/src/components/LicenseExpiryBanner.test.tsx+++ /dev/null@@ -1,95 +0,0 @@-import React from "react";-import { describe, it, expect, beforeEach, afterEach } from "vitest";-import { render, screen, fireEvent } from "@testing-library/react";-import { LicenseExpiryBannerView } from "./LicenseExpiryBanner";-import { LicenseInfo } from "./networking";--const daysFromNow = (n: number): string => {- const date = new Date();- date.setUTCDate(date.getUTCDate() + n);- return date.toISOString().slice(0, 10);-};--const licenseWith = (expiration_date: string | null): LicenseInfo => ({- has_license: expiration_date !== null,- license_type: expiration_date !== null ? "enterprise" : "community",- expiration_date,- allowed_features: [],- limits: { max_users: null, max_teams: null },-});--describe("LicenseExpiryBannerView", () => {- beforeEach(() => {- sessionStorage.clear();- });-- afterEach(() => {- sessionStorage.clear();- });-- it("renders nothing when there is no license info", () => {- const { container } = render(<LicenseExpiryBannerView licenseInfo={null} />);- expect(container).toBeEmptyDOMElement();- });-- it("renders nothing when expiration_date is null (community or remote-validated)", () => {- const { container } = render(<LicenseExpiryBannerView licenseInfo={licenseWith(null)} />);- expect(container).toBeEmptyDOMElement();- });-- it("renders nothing when expiry is more than 30 days out", () => {- const { container } = render(<LicenseExpiryBannerView licenseInfo={licenseWith(daysFromNow(40))} />);- expect(container).toBeEmptyDOMElement();- });-- it("shows a dismissible warning within 30 days", () => {- const { container } = render(<LicenseExpiryBannerView licenseInfo={licenseWith(daysFromNow(20))} />);- expect(screen.getByRole("alert")).toBeInTheDocument();- expect(container.querySelector(".lucide-triangle-alert")).toBeInTheDocument();- expect(screen.getByText(/expires in 20 days/)).toBeInTheDocument();- expect(screen.getByText(/Renew before it lapses to keep enterprise features/)).toBeInTheDocument();- expect(screen.getByRole("button", { name: /close/i })).toBeInTheDocument();- expect(screen.getByRole("link", { name: "[email protected]" })).toHaveAttribute("href", "mailto:[email protected]");- });-- it("shows a non-dismissible critical alert within 7 days", () => {- const { container } = render(<LicenseExpiryBannerView licenseInfo={licenseWith(daysFromNow(5))} />);- expect(screen.getByRole("alert")).toBeInTheDocument();- expect(container.querySelector(".lucide-circle-alert")).toBeInTheDocument();- expect(screen.getByText(/expires in 5 days/)).toBeInTheDocument();- expect(screen.getByText(/Renew now to avoid losing enterprise features/)).toBeInTheDocument();- expect(screen.queryByRole("button")).not.toBeInTheDocument();- });-- it("says 'expires today' on the expiration day", () => {- render(<LicenseExpiryBannerView licenseInfo={licenseWith(daysFromNow(0))} />);- expect(screen.getByText(/expires today/)).toBeInTheDocument();- });-- it("shows a non-dismissible expired alert stating features are disabled", () => {- const { container } = render(<LicenseExpiryBannerView licenseInfo={licenseWith(daysFromNow(-3))} />);- expect(screen.getByRole("alert")).toBeInTheDocument();- expect(container.querySelector(".lucide-circle-alert")).toBeInTheDocument();- expect(screen.getByText(/expired on/)).toBeInTheDocument();- expect(screen.getByText(/features are now disabled/i)).toBeInTheDocument();- expect(screen.queryByRole("button")).not.toBeInTheDocument();- });-- it("hides the warning after dismissal and stays hidden within the session", () => {- const expiration = daysFromNow(20);- const { unmount } = render(<LicenseExpiryBannerView licenseInfo={licenseWith(expiration)} />);- fireEvent.click(screen.getByRole("button", { name: /close/i }));- expect(screen.queryByText(/expires in 20 days/)).not.toBeInTheDocument();-- unmount();- render(<LicenseExpiryBannerView licenseInfo={licenseWith(expiration)} />);- expect(screen.queryByText(/expires in 20 days/)).not.toBeInTheDocument();- });-- it("still shows a critical alert even when its date was previously dismissed", () => {- const expiration = daysFromNow(5);- sessionStorage.setItem(`litellm:licenseExpiryBannerDismissed:${expiration}`, "true");- render(<LicenseExpiryBannerView licenseInfo={licenseWith(expiration)} />);- expect(screen.getByText(/expires in 5 days/)).toBeInTheDocument();- });-});diff --git a/ui/litellm-dashboard/src/components/LicenseExpiryBanner.tsx b/ui/litellm-dashboard/src/components/LicenseExpiryBanner.tsxdeleted file mode 100644index 5867a45bc31..00000000000--- a/ui/litellm-dashboard/src/components/LicenseExpiryBanner.tsx+++ /dev/null@@ -1,103 +0,0 @@-"use client";--import React, { useState } from "react";-import { CircleAlert, TriangleAlert, X } from "lucide-react";-import { Alert, AlertAction, AlertDescription, AlertTitle } from "@/components/shared/Alert";-import { Button } from "@/components/ui/button";-import { LicenseInfo } from "@/components/networking";-import { useLicenseInfo } from "@/app/(dashboard)/hooks/license/useLicenseInfo";-import { formatExpiryDate, getDaysUntilExpiration, getLicenseExpiryTier } from "@/utils/licenseUtils";--const DISMISS_KEY_PREFIX = "litellm:licenseExpiryBannerDismissed:";-const SALES_EMAIL = "[email protected]";--const salesLink = <a href={`mailto:${SALES_EMAIL}`}>{SALES_EMAIL}</a>;--interface LicenseExpiryBannerProps {- accessToken: string | null;-}--interface LicenseExpiryBannerViewProps {- licenseInfo: LicenseInfo | null;-}--const describeCountdown = (days: number): string => {- if (days <= 0) {- return "expires today";- }- if (days === 1) {- return "expires in 1 day";- }- return `expires in ${days} days`;-};--const expiryDescription = (tier: "warning" | "critical" | "expired"): React.ReactNode => {- if (tier === "expired") {- return <>Enterprise features are now disabled. Reach out to {salesLink} to restore access</>;- }- if (tier === "critical") {- return <>Renew now to avoid losing enterprise features. Reach out to {salesLink}</>;- }- return <>Renew before it lapses to keep enterprise features. Reach out to {salesLink}</>;-};--export const LicenseExpiryBannerView: React.FC<LicenseExpiryBannerViewProps> = ({ licenseInfo }) => {- const [locallyDismissed, setLocallyDismissed] = useState(false);-- const expirationDate = licenseInfo?.expiration_date ?? null;- const tier = getLicenseExpiryTier(expirationDate);- const days = getDaysUntilExpiration(expirationDate);-- if (expirationDate === null || tier === "none" || days === null) {- return null;- }-- const isDismissible = tier === "warning";- const dismissKey = `${DISMISS_KEY_PREFIX}${expirationDate}`;- const previouslyDismissed =- isDismissible && typeof window !== "undefined" ? sessionStorage.getItem(dismissKey) === "true" : false;-- if (isDismissible && (locallyDismissed || previouslyDismissed)) {- return null;- }-- const formattedDate = formatExpiryDate(expirationDate);-- const message =- tier === "expired"- ? `Your LiteLLM Enterprise license expired on ${formattedDate}`- : `Your LiteLLM Enterprise license ${describeCountdown(days)} (${formattedDate})`;-- const description = expiryDescription(tier);-- const handleClose = () => {- if (typeof window !== "undefined") {- sessionStorage.setItem(dismissKey, "true");- }- setLocallyDismissed(true);- };-- return (- <Alert variant={tier === "warning" ? "warning" : "error"} className="rounded-none border-x-0 border-t-0">- {tier === "warning" ? (- <TriangleAlert className="size-4" aria-hidden />- ) : (- <CircleAlert className="size-4" aria-hidden />- )}- <AlertTitle>{message}</AlertTitle>- <AlertDescription>{description}</AlertDescription>- {isDismissible && (- <AlertAction>- <Button variant="ghost" size="icon-sm" aria-label="Close" onClick={handleClose}>- <X className="size-4" />- </Button>- </AlertAction>- )}- </Alert>- );-};--export const LicenseExpiryBanner: React.FC<LicenseExpiryBannerProps> = ({ accessToken }) => {- const { data } = useLicenseInfo(accessToken);- return <LicenseExpiryBannerView licenseInfo={data ?? null} />;-};diff --git a/ui/litellm-dashboard/src/components/NoRedisWarningBanner.test.tsx b/ui/litellm-dashboard/src/components/NoRedisWarningBanner.test.tsxdeleted file mode 100644index 600315e789e..00000000000--- a/ui/litellm-dashboard/src/components/NoRedisWarningBanner.test.tsx+++ /dev/null@@ -1,58 +0,0 @@-import { renderWithProviders, screen } from "../../tests/test-utils";-import { vi } from "vitest";-import { NoRedisWarningBanner } from "./NoRedisWarningBanner";-import type { HealthReadinessDetailsResponse } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";-import type { UseQueryResult } from "@tanstack/react-query";--vi.mock("@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails", () => ({- useHealthReadinessDetails: vi.fn(),-}));--import { useHealthReadinessDetails } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";--const mockDetails = (data: Partial<HealthReadinessDetailsResponse> | undefined) => {- vi.mocked(useHealthReadinessDetails).mockReturnValue({ data } as UseQueryResult<HealthReadinessDetailsResponse>);-};--describe("NoRedisWarningBanner", () => {- it("should warn that Redis is recommended when the proxy reports no Redis", () => {- mockDetails({ status: "healthy", show_no_redis_warning: true });- renderWithProviders(<NoRedisWarningBanner accessToken="token" />);- expect(screen.getByRole("alert")).toBeInTheDocument();- expect(screen.getByText(/No Redis configured\. Redis is highly recommended/i)).toBeInTheDocument();- expect(screen.getByText(/more than one worker/i)).toBeInTheDocument();- });-- it("should link to the docs page listing what breaks without Redis", () => {- mockDetails({ status: "healthy", show_no_redis_warning: true });- renderWithProviders(<NoRedisWarningBanner accessToken="token" />);- expect(screen.getByRole("link", { name: /does not work without Redis/i })).toHaveAttribute(- "href",- "https://docs.litellm.ai/docs/proxy/redis_requirements",- );- });-- it("should name the env var that suppresses it", () => {- mockDetails({ status: "healthy", show_no_redis_warning: true });- renderWithProviders(<NoRedisWarningBanner accessToken="token" />);- expect(screen.getByText("LITELLM_DISABLE_NO_REDIS_WARNING=true")).toBeInTheDocument();- });-- it("should render nothing when the proxy reports the warning is not needed", () => {- mockDetails({ status: "healthy", show_no_redis_warning: false });- const { container } = renderWithProviders(<NoRedisWarningBanner accessToken="token" />);- expect(container).toBeEmptyDOMElement();- });-- it("should render nothing when readiness details are unavailable", () => {- mockDetails(undefined);- const { container } = renderWithProviders(<NoRedisWarningBanner accessToken={null} />);- expect(container).toBeEmptyDOMElement();- });-- it("should pass the access token to the readiness hook", () => {- mockDetails(undefined);- renderWithProviders(<NoRedisWarningBanner accessToken="my-token" />);- expect(useHealthReadinessDetails).toHaveBeenCalledWith("my-token");- });-});diff --git a/ui/litellm-dashboard/src/components/NoRedisWarningBanner.tsx b/ui/litellm-dashboard/src/components/NoRedisWarningBanner.tsxdeleted file mode 100644index 02433fad521..00000000000--- a/ui/litellm-dashboard/src/components/NoRedisWarningBanner.tsx+++ /dev/null@@ -1,40 +0,0 @@-"use client";--import React from "react";-import { TriangleAlert } from "lucide-react";-import { useHealthReadinessDetails } from "@/app/(dashboard)/hooks/healthReadiness/useHealthReadinessDetails";--const REDIS_DOCS_URL = "https://docs.litellm.ai/docs/proxy/redis_requirements";--interface NoRedisWarningBannerProps {- accessToken: string | null;-}--export const NoRedisWarningBanner: React.FC<NoRedisWarningBannerProps> = ({ accessToken }) => {- const { data: healthData } = useHealthReadinessDetails(accessToken);-- if (!healthData?.show_no_redis_warning) {- return null;- }-- return (- <div- role="alert"- className="flex items-start gap-3 border-b border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive"- >- <TriangleAlert className="mt-0.5 size-5 shrink-0" aria-hidden="true" />- <div>- <p className="font-semibold">No Redis configured. Redis is highly recommended</p>- <p>- This proxy is running more than one worker (or the worker count could not be verified). Without Redis, rate- limits, budgets, router state, and cache invalidation are per worker, so limits are enforced once per worker- and spend can overshoot.{" "}- <a className="underline" href={REDIS_DOCS_URL} target="_blank" rel="noreferrer">- See everything that does not work without Redis- </a>- . Set <code className="font-mono">LITELLM_DISABLE_NO_REDIS_WARNING=true</code> to hide this banner anyway.- </p>- </div>- </div>- );-};diff --git a/ui/litellm-dashboard/src/components/navbar.tsx b/ui/litellm-dashboard/src/components/navbar.tsxindex 4e99d8e016f..85c591a9d8e 100644--- a/ui/litellm-dashboard/src/components/navbar.tsx+++ b/ui/litellm-dashboard/src/components/navbar.tsx@@ -26,6 +26,7 @@ interface NavbarProps {isPublicPage: boolean;sidebarCollapsed?: boolean;onToggleSidebar?: () => void;+ deploymentHealth?: React.ReactNode;}const NAV_LOGO_CLASS_NAME = "h-auto max-h-full w-auto max-w-full object-contain";@@ -35,6 +36,7 @@ const Navbar: React.FC<NavbarProps> = ({isPublicPage = false,sidebarCollapsed = false,onToggleSidebar,+ deploymentHealth,}) => {const baseUrl = getProxyBaseUrl();const { logoUrl } = useTheme();@@ -149,6 +151,7 @@ const Navbar: React.FC<NavbarProps> = ({<div className="flex items-center gap-0.5 rounded-lg bg-muted px-1 py-0 transition-colors hover:bg-accent"><ThemeToggle /><span className="mx-0.5 h-6 w-px shrink-0 bg-border" aria-hidden />+ {deploymentHealth}<NotificationsBell accessToken={accessToken} /><span className="mx-0.5 h-6 w-px shrink-0 bg-border" aria-hidden /><UserDropdown onLogout={handleLogout} />diff --git a/ui/litellm-dashboard/src/components/ui/empty.tsx b/ui/litellm-dashboard/src/components/ui/empty.tsxnew file mode 100644index 00000000000..25c322e953d--- /dev/null+++ b/ui/litellm-dashboard/src/components/ui/empty.tsx@@ -0,0 +1,86 @@+import { cva, type VariantProps } from "class-variance-authority";+import { cn } from "@/lib/cva.config";++function Empty({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty"+ className={cn(+ "flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border-dashed p-12 text-center text-balance",+ className,+ )}+ {...props}+ />+ );+}++function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div data-slot="empty-header" className={cn("flex max-w-sm flex-col items-center gap-2", className)} {...props} />+ );+}++const emptyMediaVariants = cva(+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",+ {+ variants: {+ variant: {+ default: "bg-transparent",+ icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6",+ },+ },+ defaultVariants: {+ variant: "default",+ },+ },+);++function EmptyMedia({+ className,+ variant = "default",+ ...props+}: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {+ return (+ <div+ data-slot="empty-icon"+ data-variant={variant}+ className={cn(emptyMediaVariants({ variant, className }))}+ {...props}+ />+ );+}++function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty-title"+ className={cn("cn-font-heading text-lg font-medium tracking-tight", className)}+ {...props}+ />+ );+}++function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {+ return (+ <div+ data-slot="empty-description"+ className={cn(+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",+ className,+ )}+ {...props}+ />+ );+}++function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty-content"+ className={cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className)}+ {...props}+ />+ );+}++export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia };diff --git a/ui/litellm-dashboard/src/utils/licenseUtils.test.ts b/ui/litellm-dashboard/src/utils/licenseUtils.test.tsindex 8a489c30c2d..58ab69c5c21 100644--- a/ui/litellm-dashboard/src/utils/licenseUtils.test.ts+++ b/ui/litellm-dashboard/src/utils/licenseUtils.test.ts@@ -1,11 +1,5 @@import { describe, it, expect } from "vitest";-import {- type LicenseExpiryTier,- formatExpirationStatus,- formatExpiryDate,- getDaysUntilExpiration,- getLicenseExpiryTier,-} from "./licenseUtils";+import { formatExpirationStatus, formatExpiryDate, getDaysUntilExpiration } from "./licenseUtils";const NOW = new Date("2026-07-08T00:00:00Z");@@ -37,25 +31,6 @@ describe("getDaysUntilExpiration", () => {});});-describe("getLicenseExpiryTier", () => {- const cases: Array<[string | null, LicenseExpiryTier]> = [- [null, "none"],- ["not-a-date", "none"],- ["2026-08-08", "none"],- ["2026-08-07", "warning"],- ["2026-07-16", "warning"],- ["2026-07-15", "critical"],- ["2026-07-09", "critical"],- ["2026-07-08", "critical"],- ["2026-07-07", "expired"],- ["2026-01-01", "expired"],- ];-- it.each(cases)("classifies %s as %s", (date, expected) => {- expect(getLicenseExpiryTier(date, NOW)).toBe(expected);- });-});-describe("formatExpiryDate", () => {it("formats an ISO date as a human-readable UTC date", () => {expect(formatExpiryDate("2026-07-31")).toBe("Jul 31, 2026");diff --git a/ui/litellm-dashboard/src/utils/licenseUtils.ts b/ui/litellm-dashboard/src/utils/licenseUtils.tsindex 4ba39dabe0b..2db5bc60f79 100644--- a/ui/litellm-dashboard/src/utils/licenseUtils.ts+++ b/ui/litellm-dashboard/src/utils/licenseUtils.ts@@ -1,8 +1,3 @@-export type LicenseExpiryTier = "none" | "warning" | "critical" | "expired";--export const LICENSE_EXPIRY_WARNING_DAYS = 30;-export const LICENSE_EXPIRY_CRITICAL_DAYS = 7;-export const getDaysUntilExpiration = (expirationDate: string | null, now: Date = new Date()): number | null => {if (!expirationDate) {return null;@@ -18,23 +13,6 @@ export const getDaysUntilExpiration = (expirationDate: string | null, now: Datereturn Math.ceil(diffMs / (1000 * 60 * 60 * 24));};-export const getLicenseExpiryTier = (expirationDate: string | null, now: Date = new Date()): LicenseExpiryTier => {- const days = getDaysUntilExpiration(expirationDate, now);- if (days === null) {- return "none";- }- if (days < 0) {- return "expired";- }- if (days <= LICENSE_EXPIRY_CRITICAL_DAYS) {- return "critical";- }- if (days <= LICENSE_EXPIRY_WARNING_DAYS) {- return "warning";- }- return "none";-};-const EXPIRY_DATE_FORMAT: Intl.DateTimeFormatOptions = {year: "numeric",month: "short",