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]

feat(ui): cut admin-panel, logging-and-alerts, model-hub-table, and usage over to path routes (#30268)

ryan-crabbe-berrid258e022d18d
diff --git a/ui/litellm-dashboard/e2e_tests/fixtures/migratedPages.ts b/ui/litellm-dashboard/e2e_tests/fixtures/migratedPages.ts
index 19b90848e60..d0dde5a8155 100644
--- a/ui/litellm-dashboard/e2e_tests/fixtures/migratedPages.ts
+++ b/ui/litellm-dashboard/e2e_tests/fixtures/migratedPages.ts
@@ -9,8 +9,6 @@
* - navigation specs that assert per-page URLs (tests/navigation/sidebar.spec.ts)
*
* Keep this in lockstep with MIGRATED_PAGES in src/utils/migratedPages.ts.
- * Pending (add as each PR lands): admin-panel, logging-and-alerts,
- * model-hub-table, and usage (#30268).
*/
export const MIGRATED_E2E_PAGES: Record<string, string> = {
api_ref: "api-reference",
@@ -35,6 +33,10 @@ export const MIGRATED_E2E_PAGES: Record<string, string> = {
"transform-request": "transform-request",
"ui-theme": "ui-theme",
logs: "logs",
+ "admin-panel": "admin-panel",
+ "logging-and-alerts": "logging-and-alerts",
+ "model-hub-table": "model-hub-table",
+ new_usage: "usage",
};
export const MIGRATED_E2E_SEGMENTS: string[] = [...new Set(Object.values(MIGRATED_E2E_PAGES))];
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/admin-panel/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/admin-panel/page.tsx
new file mode 100644
index 00000000000..aac835b02fc
--- /dev/null
+++ b/ui/litellm-dashboard/src/app/(dashboard)/admin-panel/page.tsx
@@ -0,0 +1,11 @@
+"use client";
+
+import AdminPanel from "@/components/AdminPanel";
+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
+import useProxySettings from "@/app/(dashboard)/hooks/proxySettings/useProxySettings";
+
+export default function AdminPanelPage() {
+ const { accessToken } = useAuthorized();
+ const proxySettings = useProxySettings(accessToken);
+ return <AdminPanel proxySettings={proxySettings} />;
+}
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/logging-and-alerts/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/logging-and-alerts/page.tsx
new file mode 100644
index 00000000000..8232e391259
--- /dev/null
+++ b/ui/litellm-dashboard/src/app/(dashboard)/logging-and-alerts/page.tsx
@@ -0,0 +1,9 @@
+"use client";
+
+import Settings from "@/components/settings";
+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
+
+export default function LoggingAndAlerts() {
+ const { accessToken, userRole, userId, premiumUser } = useAuthorized();
+ return <Settings userID={userId} userRole={userRole} accessToken={accessToken} premiumUser={premiumUser} />;
+}
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/model-hub-table/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/model-hub-table/page.tsx
new file mode 100644
index 00000000000..7327d332fbd
--- /dev/null
+++ b/ui/litellm-dashboard/src/app/(dashboard)/model-hub-table/page.tsx
@@ -0,0 +1,14 @@
+"use client";
+
+import ModelHubTable from "@/components/AIHub/ModelHubTable";
+import PublicModelHub from "@/components/public_model_hub";
+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
+import { isAdminRole } from "@/utils/roles";
+
+export default function ModelHubTablePage() {
+ const { accessToken, userRole, premiumUser } = useAuthorized();
+ if (!isAdminRole(userRole)) {
+ return <PublicModelHub accessToken={accessToken} isEmbedded={true} />;
+ }
+ return <ModelHubTable accessToken={accessToken} publicPage={false} premiumUser={premiumUser} userRole={userRole} />;
+}
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/page.tsx
index 864007b4fe8..45ec0f62357 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/page.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/page.tsx
@@ -1,23 +1,17 @@
"use client";
import ModelsAndEndpointsView from "@/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView";
-import AdminPanel from "@/components/AdminPanel";
import AgentsPanel from "@/components/agents";
import { teamListCall as v2TeamListCall } from "@/app/(dashboard)/hooks/teams/useTeams";
import { useUISettings } from "@/app/(dashboard)/hooks/uiSettings/useUISettings";
-import useProxySettings from "@/app/(dashboard)/hooks/proxySettings/useProxySettings";
import LoadingScreen from "@/components/common_components/LoadingScreen";
import GeneralSettings from "@/components/general_settings";
import { Team } from "@/components/key_team_helpers/key_list";
-import ModelHubTable from "@/components/AIHub/ModelHubTable";
import { Organization, proxyBaseUrl, getInProductNudgesCall } from "@/components/networking";
-import NewUsagePage from "@/components/UsagePage/components/UsagePageView";
import OldTeams from "@/components/OldTeams";
import { fetchUserModels, CreateKeyPrefillData } from "@/components/organisms/create_key_button";
import Organizations, { fetchOrganizations } from "@/components/organizations";
import PassThroughSettings from "@/components/pass_through_settings";
-import PublicModelHub from "@/components/public_model_hub";
-import Settings from "@/components/settings";
import { SurveyPrompt, SurveyModal, ClaudeCodePrompt, ClaudeCodeModal } from "@/components/survey";
import Usage from "@/components/usage";
import UserDashboard from "@/components/user_dashboard";
@@ -30,7 +24,6 @@ import {
normalizeUrlForCompare,
storeReturnUrl,
} from "@/utils/returnUrlUtils";
-import { isAdminRole } from "@/utils/roles";
import { MIGRATED_PAGES, migratedHref } from "@/utils/migratedPages";
import { useRouter, useSearchParams } from "next/navigation";
import { Suspense, useEffect, useMemo, useRef, useState } from "react";
@@ -43,7 +36,6 @@ function CreateKeyPageContent() {
const [keys, setKeys] = useState<null | any[]>([]);
const [organizations, setOrganizations] = useState<Organization[]>([]);
const [userModels, setUserModels] = useState<string[]>([]);
- const proxySettings = useProxySettings(accessToken);
const router = useRouter();
const searchParams = useSearchParams()!;
@@ -363,25 +355,10 @@ function CreateKeyPageContent() {
userRole={userRole}
premiumUser={premiumUser}
/>
- ) : page == "admin-panel" ? (
- <AdminPanel proxySettings={proxySettings} />
- ) : page == "logging-and-alerts" ? (
- <Settings userID={userID} userRole={userRole} accessToken={accessToken} premiumUser={premiumUser} />
) : page == "agents" ? (
<AgentsPanel accessToken={accessToken} userRole={userRole} teams={teams} />
) : page == "router-settings" ? (
<GeneralSettings userID={userID} userRole={userRole} accessToken={accessToken} modelData={modelData} />
- ) : page == "model-hub-table" ? (
- isAdminRole(userRole) ? (
- <ModelHubTable
- accessToken={accessToken}
- publicPage={false}
- premiumUser={premiumUser}
- userRole={userRole}
- />
- ) : (
- <PublicModelHub accessToken={accessToken} isEmbedded={true} />
- )
) : page == "pass-through-settings" ? (
<PassThroughSettings
userID={userID}
@@ -390,8 +367,6 @@ function CreateKeyPageContent() {
modelData={modelData}
premiumUser={premiumUser}
/>
- ) : page == "new_usage" ? (
- <NewUsagePage teams={(teams as Team[]) ?? []} organizations={(organizations as Organization[]) ?? []} />
) : (
<Usage
userID={userID}
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx
new file mode 100644
index 00000000000..7382262cbd5
--- /dev/null
+++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/page.tsx
@@ -0,0 +1,13 @@
+"use client";
+
+import NewUsagePage from "@/components/UsagePage/components/UsagePageView";
+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
+import { useTeams } from "@/app/(dashboard)/hooks/teams/useTeams";
+import { useOrganizations } from "@/app/(dashboard)/hooks/organizations/useOrganizations";
+
+export default function UsagePage() {
+ useAuthorized();
+ const { data: teams } = useTeams();
+ const { data: organizations } = useOrganizations();
+ return <NewUsagePage teams={teams ?? []} organizations={organizations ?? []} />;
+}
diff --git a/ui/litellm-dashboard/src/utils/migratedPages.test.ts b/ui/litellm-dashboard/src/utils/migratedPages.test.ts
index 1183c81d05f..7e74fa1eec4 100644
--- a/ui/litellm-dashboard/src/utils/migratedPages.test.ts
+++ b/ui/litellm-dashboard/src/utils/migratedPages.test.ts
@@ -99,6 +99,18 @@ describe("migratedHref / legacyPageHref", () => {
expect(MIGRATED_PAGES["ui-theme"]).toBe("ui-theme");
expect(MIGRATED_PAGES.logs).toBe("logs");
});
+
+ it("maps the admin-panel, logging-and-alerts, model-hub-table, and new_usage ids to their routes", async () => {
+ vi.doMock("@/components/networking", () => ({ serverRootPath: "/" }));
+ const { MIGRATED_PAGES } = await import("./migratedPages");
+
+ expect(MIGRATED_PAGES["admin-panel"]).toBe("admin-panel");
+ expect(MIGRATED_PAGES["logging-and-alerts"]).toBe("logging-and-alerts");
+ expect(MIGRATED_PAGES["model-hub-table"]).toBe("model-hub-table");
+ // new_usage routes to /usage; the legacy ?page=usage report keeps its switch arm.
+ expect(MIGRATED_PAGES.new_usage).toBe("usage");
+ expect(MIGRATED_PAGES.usage).toBeUndefined();
+ });
});
describe("dev server (NODE_ENV=development)", () => {
diff --git a/ui/litellm-dashboard/src/utils/migratedPages.ts b/ui/litellm-dashboard/src/utils/migratedPages.ts
index c54b0473c02..46cdd0d7476 100644
--- a/ui/litellm-dashboard/src/utils/migratedPages.ts
+++ b/ui/litellm-dashboard/src/utils/migratedPages.ts
@@ -35,6 +35,11 @@ export const MIGRATED_PAGES: Record<string, string> = {
"transform-request": "transform-request",
"ui-theme": "ui-theme",
logs: "logs",
+ "admin-panel": "admin-panel",
+ "logging-and-alerts": "logging-and-alerts",
+ "model-hub-table": "model-hub-table",
+ // The modern usage dashboard; the old ?page=usage report stays on the legacy switch.
+ new_usage: "usage",
};
function uiBase(): string {