Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(ui): link Virtual Keys hint through the migrated /ui route

yassin3ec3933c1f73
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx
index 6378e88c10a..4d0b1c466a4 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx
@@ -9,6 +9,7 @@ import { STATUS_COLUMN_ID, toServerSortField } from "./ModelsTableColumns";
const mockModelDeleteCall = vi.fn().mockResolvedValue({});
const mockModelPatchUpdateCall = vi.fn().mockResolvedValue({});
vi.mock("@/components/networking", () => ({
+ serverRootPath: "/",
modelDeleteCall: (...args: unknown[]) => mockModelDeleteCall(...args),
modelPatchUpdateCall: (...args: unknown[]) => mockModelPatchUpdateCall(...args),
}));
@@ -335,6 +336,23 @@ describe("AllModelsTab", () => {
expect(screen.getByText(/create a Virtual Key without selecting a team/i)).toBeInTheDocument();
});
+ it("links the Virtual Keys page through the migrated /ui route", () => {
+ render(<AllModelsTab {...defaultProps} />);
+
+ expect(screen.getByRole("link", { name: "Virtual Keys page" })).toHaveAttribute("href", "/ui/api-keys");
+ });
+
+ it("links the team hint's Virtual Keys page through the migrated /ui route", async () => {
+ const user = userEvent.setup();
+ render(<AllModelsTab {...defaultProps} />);
+
+ await user.click(screen.getByTestId("models-team-select"));
+ await user.click(await screen.findByRole("option", { name: "Engineering" }));
+
+ await screen.findByText(/select Team as "Engineering"/i);
+ expect(screen.getByRole("link", { name: "Virtual Keys page" })).toHaveAttribute("href", "/ui/api-keys");
+ });
+
it("names the selected team in the hint", async () => {
const user = userEvent.setup();
render(<AllModelsTab {...defaultProps} />);
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx
index d82e8b60c13..1a9d33a50bc 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx
@@ -7,6 +7,7 @@ import DeleteResourceModal from "@/components/common_components/DeleteResourceMo
import ModelSettingsModal from "@/components/model_dashboard/ModelSettingsModal/ModelSettingsModal";
import { ModelData } from "@/components/model_dashboard/types";
import { toast } from "@/lib/toast";
+import { migratedHref } from "@/utils/migratedPages";
import { modelDeleteCall, modelPatchUpdateCall } from "@/components/networking";
import { useQueryClient } from "@tanstack/react-query";
import { useDebouncedCallback } from "@tanstack/react-pacer/debouncer";
@@ -301,7 +302,7 @@ const AllModelsTab = ({
{selectedTeamValue === PERSONAL_TEAM_VALUE ? (
<span>
To access these models, create a Virtual Key without selecting a team on the{" "}
- <a href="/public?login=success&page=api-keys" className="font-medium text-info hover:underline">
+ <a href={migratedHref("api-keys")} className="font-medium text-info hover:underline">
Virtual Keys page
</a>
.
@@ -309,7 +310,7 @@ const AllModelsTab = ({
) : (
<span>
To access these models, create a Virtual Key and select Team as &quot;{teamAccessLabel}&quot; on the{" "}
- <a href="/public?login=success&page=api-keys" className="font-medium text-info hover:underline">
+ <a href={migratedHref("api-keys")} className="font-medium text-info hover:underline">
Virtual Keys page
</a>
.