diff --git a/ui/litellm-dashboard/src/components/llm_calls/fetch_models.test.tsx b/ui/litellm-dashboard/src/components/llm_calls/fetch_models.test.tsx index bc276c95fdd..8b3c840949b 100644 --- a/ui/litellm-dashboard/src/components/llm_calls/fetch_models.test.tsx +++ b/ui/litellm-dashboard/src/components/llm_calls/fetch_models.test.tsx @@ -87,6 +87,15 @@ describe("fetchAvailableModels", () => { expect(await fetchAvailableModels("token")).toEqual([{ model_group: "gpt-4o" }]); }); + it("excludes the all-proxy-models permission sentinel from fallback options", async () => { + modelHubCallMock.mockResolvedValue({ data: [] }); + modelAvailableCallMock.mockResolvedValue({ + data: [{ id: "all-proxy-models" }, { id: "gpt-4o", mode: "chat" }], + }); + + expect(await fetchAvailableModels("token")).toEqual([{ model_group: "gpt-4o", mode: "chat" }]); + }); + it("returns an empty list when both routes come back empty", async () => { modelHubCallMock.mockResolvedValue({ data: [] }); modelAvailableCallMock.mockResolvedValue({ data: [] }); diff --git a/ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx b/ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx index 03c06e0f155..f8769c3c5b4 100644 --- a/ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx +++ b/ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx @@ -70,5 +70,14 @@ export const fetchAvailableModels = async (accessToken: string): Promise (model.model_group || model.id || model.model_name) ?? "", + ), + ), + ); + return dedupeByGroup(toModelGroups(response?.data).filter((model) => selectable.has(model.model_group))); };