From 2e4b3929d10c718e56a8e2e28208060f1f24e33c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 09:14:20 +0000 Subject: [PATCH] feat(ui): migrate model_group_alias_settings to shadcn - @tremor Card/Title/Text/Table* + @heroicons icons \u2192 shadcn Card/ Table + lucide ChevronDown/ChevronRight/PlusCircle/Pencil/Trash2. - Replace 'bg-gray-300/text-gray-500/bg-green-600/text-blue-600/...' raw classes with semantic tokens. Add Alias button uses bg-emerald-600 (categorical 'create' color) \u2014 added to .eslintrc.json overrides. - Native input/button preserved for the inline editing UX. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- ui/litellm-dashboard/.eslintrc.json | 3 +- .../components/model_group_alias_settings.tsx | 139 ++++++++++++------ 2 files changed, 92 insertions(+), 50 deletions(-) diff --git a/ui/litellm-dashboard/.eslintrc.json b/ui/litellm-dashboard/.eslintrc.json index cc887fe13b6..a629bf4cc4a 100644 --- a/ui/litellm-dashboard/.eslintrc.json +++ b/ui/litellm-dashboard/.eslintrc.json @@ -32,7 +32,8 @@ "src/components/GuardrailSettingsView.tsx", "src/components/DebugWarningBanner.tsx", "src/components/SCIM.tsx", - "src/components/logging_settings_view.tsx" + "src/components/logging_settings_view.tsx", + "src/components/model_group_alias_settings.tsx" ], "rules": { "litellm-ui/no-banned-ui-imports": "off", diff --git a/ui/litellm-dashboard/src/components/model_group_alias_settings.tsx b/ui/litellm-dashboard/src/components/model_group_alias_settings.tsx index 505b26438b9..f1f58311f42 100644 --- a/ui/litellm-dashboard/src/components/model_group_alias_settings.tsx +++ b/ui/litellm-dashboard/src/components/model_group_alias_settings.tsx @@ -1,7 +1,21 @@ import React, { useState, useEffect } from "react"; -import { PlusCircleIcon, PencilIcon, TrashIcon, ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/outline"; +import { + ChevronDown, + ChevronRight, + PlusCircle, + Pencil, + Trash2, +} from "lucide-react"; import { setCallbacksCall } from "./networking"; -import { Card, Title, Text, Table, TableHead, TableHeaderCell, TableBody, TableRow, TableCell } from "@tremor/react"; +import { Card } from "@/components/ui/card"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; import NotificationsManager from "./molecules/notifications_manager"; type ModelGroupAliasValue = string | { model: string; hidden?: boolean }; @@ -149,20 +163,26 @@ const ModelGroupAliasSettings: React.FC = ({ ); return ( - -
setIsExpanded(!isExpanded)}> + +
setIsExpanded(!isExpanded)} + >
- Model Group Alias Settings -

- Create aliases for your model groups to simplify API calls. For example, you can create an alias - 'gpt-4o' that points to 'gpt-4o-mini-openai' model group. +

+ Model Group Alias Settings +

+

+ Create aliases for your model groups to simplify API calls. For + example, you can create an alias 'gpt-4o' that points + to 'gpt-4o-mini-openai' model group.

{isExpanded ? ( - + ) : ( - + )}
@@ -170,25 +190,28 @@ const ModelGroupAliasSettings: React.FC = ({ {isExpanded && (
- Add New Alias + + Add New Alias +
- + - setNewAlias({ - ...newAlias, - aliasName: e.target.value, - }) + setNewAlias({ ...newAlias, aliasName: e.target.value }) } placeholder="e.g., gpt-4o" - className="w-full px-3 py-2 border border-gray-300 rounded-md text-sm" + className="w-full px-3 py-2 border border-input bg-background rounded-md text-sm" />
- + = ({ }) } placeholder="e.g., gpt-4o-mini-openai" - className="w-full px-3 py-2 border border-gray-300 rounded-md text-sm" + className="w-full px-3 py-2 border border-input bg-background rounded-md text-sm" />
- Manage Existing Aliases + + Manage Existing Aliases +
- + - Alias Name - Target Model Group - Actions + Alias Name + Target Model Group + Actions - + {aliases.map((alias) => ( @@ -241,7 +272,7 @@ const ModelGroupAliasSettings: React.FC = ({ aliasName: e.target.value, }) } - className="w-full px-2 py-1 border border-gray-300 rounded-md text-sm" + className="w-full px-2 py-1 border border-input bg-background rounded-md text-sm" /> @@ -254,20 +285,20 @@ const ModelGroupAliasSettings: React.FC = ({ targetModelGroup: e.target.value, }) } - className="w-full px-2 py-1 border border-gray-300 rounded-md text-sm" + className="w-full px-2 py-1 border border-input bg-background rounded-md text-sm" />
@@ -276,21 +307,27 @@ const ModelGroupAliasSettings: React.FC = ({ ) : ( <> - {alias.aliasName} - {alias.targetModelGroup} + + {alias.aliasName} + + + {alias.targetModelGroup} +
@@ -300,7 +337,10 @@ const ModelGroupAliasSettings: React.FC = ({ ))} {aliases.length === 0 && ( - + No aliases added yet. Add a new alias above. @@ -310,19 +350,19 @@ const ModelGroupAliasSettings: React.FC = ({
- {/* Configuration Example */} - - Configuration Example - - Here's how your current aliases would look in the config.yaml: - -
-
+ +

Configuration Example

+

+ Here's how your current aliases would look in the + config.yaml: +

+
+
router_settings:
  model_group_alias: {Object.keys(aliasObject).length === 0 ? ( - +
    # No aliases configured yet
@@ -330,7 +370,8 @@ const ModelGroupAliasSettings: React.FC = ({ Object.entries(aliasObject).map(([key, value]) => (
-     "{key}": "{value}" +     "{key}": "{value} + "
)) )}