diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.test.tsx index 55597f4ce82..a9cb68ae8dd 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.test.tsx @@ -22,15 +22,7 @@ vi.mock("./detailNavigation", () => ({ })); vi.mock("@/components/molecules/DecisionModelsBanner", () => ({ - default: ({ onAddModel }: { onAddModel?: () => void }) => ( -
- {onAddModel && ( - - )} -
- ), + default: () =>
, })); vi.mock("@/components/model_info_view", () => ({ default: ({ modelId }: { modelId: string }) =>
model:{modelId}
, @@ -107,21 +99,6 @@ describe("ModelsAndEndpointsPage", () => { expect(screen.queryByTestId("panel-all-models")).not.toBeInTheDocument(); }); - it("opens the Add Model tab from the decision models banner", async () => { - const user = userEvent.setup(); - renderPage(); - await user.click(screen.getByRole("button", { name: "Add a decision model" })); - expect(screen.getByTestId("panel-add")).toBeInTheDocument(); - expect(screen.queryByTestId("panel-all-models")).not.toBeInTheDocument(); - }); - - it("does not offer the banner's Add a decision model to a session that cannot add models", () => { - mockUseAuthorized.mockReturnValue(NON_ADMIN); - renderPage(); - expect(screen.getByRole("region", { name: "Decision models" })).toBeInTheDocument(); - expect(screen.queryByRole("button", { name: "Add a decision model" })).not.toBeInTheDocument(); - }); - it("does not show a view-only session the decision models banner, whose Playground it cannot open", () => { mockUseAuthorized.mockReturnValue(VIEW_ONLY_ADMIN); renderPage(); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx index 1eae68b9d43..a54c4ee7292 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.tsx @@ -178,9 +178,7 @@ export default function ModelsAndEndpointsPage() { - {!isViewOnly && ( - setActiveKey("add") : undefined} /> - )} + {!isViewOnly && } {modelId ? ( { "href", "https://docs.litellm.ai/docs/decisions", ); - expect(within(note).getByRole("link", { name: "test it in the System One playground" })).toHaveAttribute( + expect(within(note).getByRole("link", { name: "test it in the Decisions playground" })).toHaveAttribute( "href", "/ui/playground?tab=system-one", ); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/ResponseView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/ResponseView.tsx index d440fd616d8..ac83589a2db 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/ResponseView.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/ResponseView.tsx @@ -130,7 +130,7 @@ export default function ResponseView({ response, fallbackModel, latencyMs, error if (error) { return ( - System One request failed + Decisions request failed {error} ); @@ -141,7 +141,7 @@ export default function ResponseView({ response, fallbackModel, latencyMs, error Calibrated probabilities - Send a request to see System One answers and probabilities. + Send a request to see decision answers and probabilities. ); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.integration.test.tsx index 8c0b6ef12dc..55f007372d7 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.integration.test.tsx @@ -113,7 +113,7 @@ describe("SystemOneUI integration", () => { render(); screen.getByRole("combobox", { name: "Decision endpoint" }).focus(); await user.keyboard("{ArrowDown}"); - await user.click(await screen.findByRole("option", { name: "System One · /v1/systemone" })); + await user.click(await screen.findByRole("option", { name: "Decisions · /v1/systemone" })); expect(screen.getByRole("note", { name: "Decision endpoint notice" })).toHaveTextContent( "omit model to use the proxy's configured default.", @@ -174,7 +174,7 @@ describe("SystemOneUI integration", () => { render(); screen.getByRole("combobox", { name: "Decision endpoint" }).focus(); await user.keyboard("{ArrowDown}"); - await user.click(await screen.findByRole("option", { name: "System One · /v1/systemone" })); + await user.click(await screen.findByRole("option", { name: "Decisions · /v1/systemone" })); expect(await screen.findByRole("link", { name: "Add a decision model" })).toHaveAttribute( "href", @@ -304,7 +304,7 @@ describe("SystemOneUI integration", () => { render(); screen.getByRole("combobox", { name: "Decision endpoint" }).focus(); await user.keyboard("{ArrowDown}"); - await user.click(await screen.findByRole("option", { name: "System One · /v1/systemone" })); + await user.click(await screen.findByRole("option", { name: "Decisions · /v1/systemone" })); const editor = await openJsonEditor(); const draft = JSON.stringify({ model: "my-decider", @@ -327,7 +327,7 @@ describe("SystemOneUI integration", () => { screen.getByRole("combobox", { name: "Decision endpoint" }).focus(); await user.keyboard("{ArrowDown}"); - await user.click(await screen.findByRole("option", { name: "System One · /v1/systemone" })); + await user.click(await screen.findByRole("option", { name: "Decisions · /v1/systemone" })); expect(editor).toHaveValue(draft); expect(screen.queryByText("Selected choice")).not.toBeInTheDocument(); await user.click(screen.getByRole("button", { name: "Send" })); @@ -341,7 +341,7 @@ describe("SystemOneUI integration", () => { render(); screen.getByRole("combobox", { name: "Decision endpoint" }).focus(); await user.keyboard("{ArrowDown}"); - await user.click(await screen.findByRole("option", { name: "System One · /v1/systemone" })); + await user.click(await screen.findByRole("option", { name: "Decisions · /v1/systemone" })); const payload = { state: "An outage", questions: { urgent: { type: "noul", instructions: "Is this urgent?" } } }; fireEvent.change(await openJsonEditor(), { target: { value: JSON.stringify(payload) }, @@ -369,7 +369,7 @@ describe("SystemOneUI integration", () => { await screen.findByRole("button", { name: "Cancel request" }); screen.getByRole("combobox", { name: "Decision endpoint" }).focus(); await user.keyboard("{ArrowDown}"); - await user.click(await screen.findByRole("option", { name: "System One · /v1/systemone" })); + await user.click(await screen.findByRole("option", { name: "Decisions · /v1/systemone" })); expect(mockFetch.mock.calls[0]?.[1]?.signal?.aborted).toBe(true); expect(screen.getByRole("button", { name: "Send" })).toBeEnabled(); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.tsx index d1effc9ece6..0ac39cb5ede 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/SystemOneUI.tsx @@ -142,11 +142,11 @@ export default function SystemOneUI({ accessToken, disabledPersonalKeyCreation = > - {endpoint === "/v1/systemone" ? "System One · /v1/systemone" : "TypeSafe · /typesafe/v1/systemone"} + {endpoint === "/v1/systemone" ? "Decisions · /v1/systemone" : "TypeSafe · /typesafe/v1/systemone"} - System One · /v1/systemone + Decisions · /v1/systemone TypeSafe · /typesafe/v1/systemone @@ -231,7 +231,7 @@ export default function SystemOneUI({ accessToken, disabledPersonalKeyCreation = - {endpoint === "/v1/systemone" ? "Decision models · System One" : "TypeSafe Jev · System One"} + {endpoint === "/v1/systemone" ? "Decision models · /v1/systemone" : "TypeSafe Jev · /typesafe/v1/systemone"} {endpoint === "/v1/systemone" @@ -249,7 +249,7 @@ export default function SystemOneUI({ accessToken, disabledPersonalKeyCreation =
-
+
(value === "form" || value === "json") && setView(value)} @@ -272,7 +272,7 @@ export default function SystemOneUI({ accessToken, disabledPersonalKeyCreation =
-
+
After you add it,{" "} - test it in the System One playground + test it in the Decisions playground

diff --git a/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.integration.test.tsx b/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.integration.test.tsx index b7d81a09f4e..cb62b9a34a9 100644 --- a/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.integration.test.tsx +++ b/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.integration.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, render, screen } from "@testing-library/react"; -import { beforeEach, describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it } from "vitest"; import DecisionModelsBanner from "./DecisionModelsBanner"; const STORAGE_KEY = "hideDecisionModelsBanner"; @@ -10,7 +10,7 @@ describe("DecisionModelsBanner", () => { localStorage.removeItem("hideCostOptimizationFeedbackBanner"); }); - it("links directly to the System One playground", () => { + it("links directly to the Decisions playground", () => { render(); const link = screen.getByRole("link", { name: "Try decision models" }); expect(link).toHaveAttribute("href", "/ui/playground?tab=system-one"); @@ -24,27 +24,14 @@ describe("DecisionModelsBanner", () => { ); }); - it("offers Add a decision model only when the page can add models, and calls back on click", () => { - const onAddModel = vi.fn(); - const { rerender } = render(); - expect(screen.queryByRole("button", { name: "Add a decision model" })).not.toBeInTheDocument(); - - rerender(); - fireEvent.click(screen.getByRole("button", { name: "Add a decision model" })); - - expect(onAddModel).toHaveBeenCalledTimes(1); - }); - - it("points only users who can add models at Add Model", () => { - const { rerender } = render(); + it("links Supported providers to the provider table in the docs", () => { + render(); + expect(screen.getByRole("link", { name: "Supported providers" })).toHaveAttribute( + "href", + "https://docs.litellm.ai/docs/decisions#supported-providers", + ); expect(screen.getByRole("paragraph")).not.toHaveTextContent("Add Model"); expect(screen.getByRole("paragraph")).toHaveTextContent("Call them at /v1/decisions or /v1/systemone"); - - rerender(); - - expect(screen.getByRole("paragraph")).toHaveTextContent( - "Search decision in Add Model to find them. Call them at /v1/decisions", - ); }); it("shows the announcement even if the old feedback banner was dismissed", () => { diff --git a/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.tsx b/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.tsx index 5dbf5191198..b1d81a18588 100644 --- a/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.tsx +++ b/ui/litellm-dashboard/src/components/molecules/DecisionModelsBanner.tsx @@ -1,18 +1,14 @@ import React, { useState } from "react"; import { ArrowRight, Sparkles, X } from "lucide-react"; -import { DECISIONS_DOCS_URL, SYSTEM_ONE_PLAYGROUND_ROUTE } from "@/lib/decisionModels"; +import { DECISIONS_DOCS_URL, DECISIONS_PROVIDERS_DOCS_URL, SYSTEM_ONE_PLAYGROUND_ROUTE } from "@/lib/decisionModels"; import { uiHref } from "@/utils/uiHref"; import { Button } from "@/components/ui/button"; const STORAGE_KEY = "hideDecisionModelsBanner"; -interface DecisionModelsBannerProps { - onAddModel?: () => void; -} - -const DecisionModelsBanner: React.FC = ({ onAddModel }) => { +const DecisionModelsBanner: React.FC = () => { const [dismissed, setDismissed] = useState(() => { if (typeof window !== "undefined") { return localStorage.getItem(STORAGE_KEY) === "true"; @@ -32,23 +28,22 @@ const DecisionModelsBanner: React.FC = ({ onAddModel

Decision models are now supported

- {onAddModel && ( - <> - Search decision in Add Model to find them.{" "} - - )} - Call them at /v1/decisions or /v1/systemone, or try them in the System One + Call them at /v1/decisions or /v1/systemone, or try them in the Decisions playground.{" "} How to call them

- {onAddModel && ( - - )} +