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]

Create Team Model Dropdown fix

yuneng-jiang6e99faecede6
diff --git a/ui/litellm-dashboard/src/components/OldTeams.test.tsx b/ui/litellm-dashboard/src/components/OldTeams.test.tsx
index 7f4ec3b09ca..996f17f14c4 100644
--- a/ui/litellm-dashboard/src/components/OldTeams.test.tsx
+++ b/ui/litellm-dashboard/src/components/OldTeams.test.tsx
@@ -616,13 +616,13 @@ describe("OldTeams - Default Team Settings tab visibility", () => {
});
});
-describe("OldTeams - all-proxy-models dropdown visibility", () => {
+describe("OldTeams - models dropdown options", () => {
beforeEach(() => {
vi.clearAllMocks();
vi.mocked(fetchAvailableModelsForTeamOrKey).mockResolvedValue(["gpt-4", "gpt-3.5-turbo"]);
});
- it("should not show all-proxy-models option when user has no access to it", async () => {
+ it("should not render all-proxy-models option in models select", async () => {
vi.mocked(fetchAvailableModelsForTeamOrKey).mockResolvedValue(["gpt-4", "gpt-3.5-turbo"]);
render(
diff --git a/ui/litellm-dashboard/src/components/OldTeams.tsx b/ui/litellm-dashboard/src/components/OldTeams.tsx
index e66fe92045d..77d106c4ed9 100644
--- a/ui/litellm-dashboard/src/components/OldTeams.tsx
+++ b/ui/litellm-dashboard/src/components/OldTeams.tsx
@@ -1158,11 +1158,6 @@ const Teams: React.FC<TeamProps> = ({
name="models"
>
<Select2 mode="multiple" placeholder="Select models" style={{ width: "100%" }}>
- {(isProxyAdminRole(userRole || "") || userModels.includes("all-proxy-models")) && (
- <Select2.Option key="all-proxy-models" value="all-proxy-models">
- All Proxy Models
- </Select2.Option>
- )}
<Select2.Option key="no-default-models" value="no-default-models">
No Default Models
</Select2.Option>
diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.test.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.test.tsx
new file mode 100644
index 00000000000..1541472cc84
--- /dev/null
+++ b/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.test.tsx
@@ -0,0 +1,13 @@
+import { describe, expect, it } from "vitest";
+
+import { getModelDisplayName } from "./fetch_available_models_team_key";
+
+describe("getModelDisplayName", () => {
+ it("should return display label for all proxy models", () => {
+ expect(getModelDisplayName("all-proxy-models")).toBe("All Proxy Models");
+ });
+
+ it("should return provider-wide label for wildcard models", () => {
+ expect(getModelDisplayName("openai/*")).toBe("All openai models");
+ });
+});
diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.tsx
index 36a993ed0c8..6aa1c5b483f 100644
--- a/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.tsx
+++ b/ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.tsx
@@ -36,6 +36,9 @@ export const fetchAvailableModelsForTeamOrKey = async (
};
export const getModelDisplayName = (model: string) => {
+ if (model === "all-proxy-models") {
+ return "All Proxy Models";
+ }
if (model.endsWith("/*")) {
const provider = model.replace("/*", "");
return `All ${provider} models`;