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
chore(router): resolve merge conflict with main
Tin Chi Lo71465fc2f721
diff --cc ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsxindex 578b455d2b8,5cf8c14f2cd..7fb2f306fe4--- a/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx+++ b/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx@@@ -669,7 -669,82 +669,82 @@@ describe("AddAutoRouterTab", () =>});});+ it("blocks invalid success thresholds and creates a heuristic v2 router with explicit zero", async () => {+ const user = userEvent.setup();+ vi.mocked(getMissingTiersError).mockReturnValue(null);+ renderWithProviders(<Harness />);+ fireEvent.change(screen.getByLabelText("Auto Router Name"), { target: { value: "threshold-router" } });+ expandDetailedConfiguration();+ await user.click(screen.getByText("Advanced: Classification Method"));+ await user.click(screen.getByRole("radio", { name: /^Heuristic v2/ }));++ const threshold = screen.getByRole("textbox", { name: "Success threshold" });+ expect(threshold).toHaveValue("");+ fireEvent.change(threshold, { target: { value: "invalid" } });+ fireEvent.blur(threshold);+ expect(threshold).toHaveValue("invalid");+ expect(threshold).toHaveAttribute("aria-invalid", "true");+ expect(screen.getByRole("button", { name: "Add Auto Router" })).toBeDisabled();+ expect(screen.getByTestId("auto-router-test-routing-btn")).toBeDisabled();++ await user.click(screen.getByRole("radio", { name: /^Heuristic \(default\)/ }));+ expect(screen.getByRole("button", { name: "Add Auto Router" })).toBeDisabled();+ await user.click(screen.getByRole("radio", { name: /^Heuristic v2/ }));+ fireEvent.change(screen.getByRole("textbox", { name: "Success threshold" }), { target: { value: "1.01" } });+ expect(screen.getByRole("button", { name: "Add Auto Router" })).toBeDisabled();+ fireEvent.change(screen.getByRole("textbox", { name: "Success threshold" }), { target: { value: "0" } });+ await user.click(screen.getByRole("button", { name: "Add Auto Router" }));++ await waitFor(() => expect(handleAddAutoRouterSubmit).toHaveBeenCalledOnce());+ expect(vi.mocked(handleAddAutoRouterSubmit).mock.calls.at(-1)?.[0].complexity_router_config).toMatchObject({+ classifier_type: "heuristic_v2",+ heuristic_v2_success_threshold: 0,+ });+ });++ it("clears an invalid threshold draft when automatic setup replaces the configuration", async () => {+ const user = userEvent.setup();+ mockFetchAvailableModels.mockResolvedValue(ALL_FAMILY_MODELS);+ renderWithProviders(<Harness />);+ const automaticSetup = await screen.findByRole("button", { name: "Configure automatically" });+ await waitFor(() => expect(automaticSetup).toBeEnabled());+ await user.click(automaticSetup);+ fireEvent.change(screen.getByLabelText("Auto Router Name"), { target: { value: "reset-threshold-router" } });+ await user.click(screen.getByText("Advanced: Classification Method"));+ fireEvent.change(screen.getByRole("textbox", { name: "Success threshold" }), { target: { value: "1.1" } });+ expect(screen.getByRole("button", { name: "Add Auto Router" })).toBeDisabled();++ await user.click(automaticSetup);+ expect(screen.getByRole("textbox", { name: "Success threshold" })).toHaveValue("");+ expect(screen.getByRole("textbox", { name: "Success threshold" })).toHaveAttribute("aria-invalid", "false");+ await user.click(screen.getByRole("button", { name: "Add Auto Router" }));+ await waitFor(() => expect(handleAddAutoRouterSubmit).toHaveBeenCalledOnce());+ expect(vi.mocked(handleAddAutoRouterSubmit).mock.calls.at(-1)?.[0].complexity_router_config).not.toHaveProperty(+ "heuristic_v2_success_threshold",+ );+ });++ it("clears an invalid inactive threshold before creating the router", async () => {+ const user = userEvent.setup();+ vi.mocked(getMissingTiersError).mockReturnValue(null);+ renderWithProviders(<Harness />);+ fireEvent.change(screen.getByLabelText("Auto Router Name"), { target: { value: "clear-threshold-router" } });+ expandDetailedConfiguration();+ await user.click(screen.getByText("Advanced: Classification Method"));+ await user.click(screen.getByRole("radio", { name: /^Heuristic v2/ }));+ fireEvent.change(screen.getByRole("textbox", { name: "Success threshold" }), { target: { value: "invalid" } });+ await user.click(screen.getByRole("radio", { name: /^Heuristic \(default\)/ }));+ expect(screen.getByRole("button", { name: "Add Auto Router" })).toBeDisabled();+ await user.click(screen.getByRole("button", { name: "Clear Heuristic v2 threshold" }));+ expect(screen.queryByRole("region", { name: "Inactive Heuristic v2 threshold" })).not.toBeInTheDocument();+ await user.click(screen.getByRole("button", { name: "Add Auto Router" }));+ await waitFor(() => expect(handleAddAutoRouterSubmit).toHaveBeenCalledOnce());+ expect(vi.mocked(handleAddAutoRouterSubmit).mock.calls.at(-1)?.[0].complexity_router_config).not.toHaveProperty(+ "heuristic_v2_success_threshold",+ );+ });+- it("carries a context-window escalation opt-out through to the create payload", async () => {+ it("starts context-window escalation disabled and carries an explicit opt-in to the create payload", async () => {const user = userEvent.setup();vi.mocked(getMissingTiersError).mockReturnValue(null);diff --cc ui/litellm-dashboard/src/components/add_model/build_complexity_router_config.test.tsindex 0d70b18cd94,63fed7c7175..094517f76aa--- a/ui/litellm-dashboard/src/components/add_model/build_complexity_router_config.test.ts+++ b/ui/litellm-dashboard/src/components/add_model/build_complexity_router_config.test.ts@@@ -48,8 -49,25 +49,25 @@@ const baseParams: BuildComplexityRouter};describe("buildComplexityRouterConfig", () => {+ it("forwards preset references and explicit overrides without materializing absent text on create", () => {+ const settings = {+ efficient_profile_preset: "efficient-v1",+ capable_profile_preset: "capable-v1",+ harness_preset: "runtime-v1",+ efficient_profile: "Explicit efficient override",+ capable_profile: "Explicit capable override",+ harness: "Explicit harness override",+ max_quality_gap: 0.05,+ };+ const config = buildComplexityRouterConfig({ ...baseParams, classifierType: "llm_v2", llmV2Config: settings });+ expect(config.llm_v2_config).toEqual(settings);+ const { efficient_profile: _efficient, capable_profile: _capable, harness: _harness, ...refs } = settings;+ const refConfig = buildComplexityRouterConfig({ ...baseParams, classifierType: "llm_v2", llmV2Config: refs });+ expect(JSON.parse(JSON.stringify(refConfig)).llm_v2_config).toEqual(refs);+ });+it.each(["capability", "llm_v2", "heuristic"] as const)(- "disables the removed overrides only for forecast creates: %s",+ "preserves explicit context-window opt-in beside forecast restrictions: %s",(classifierType) => {const forecast = classifierType !== "heuristic";const params = {