diff --git a/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx b/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx index ae4b87a3587..18c5d52b4f7 100644 --- a/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx +++ b/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx @@ -241,9 +241,13 @@ const RouterSettingsAccordion = forwardRef ({ fetchMCPAccessGroups: vi.fn(), getTeamPermissionsCall: vi.fn(), organizationInfoCall: vi.fn(), + getRouterSettingsCall: vi.fn().mockResolvedValue({ fields: [] }), })); vi.mock("@/components/utils/dataUtils", () => ({ diff --git a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx index 3a9794b6922..65aa74b272b 100644 --- a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx +++ b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx @@ -42,6 +42,7 @@ import ObjectPermissionsView from "../object_permissions_view"; import NumericalInput from "../shared/numerical_input"; import VectorStoreSelector from "../vector_store_management/VectorStoreSelector"; import EditLoggingSettings from "./EditLoggingSettings"; +import RouterSettingsAccordion, { RouterSettingsAccordionRef } from "../common_components/RouterSettingsAccordion"; import MemberModal from "./EditMembership"; import MemberPermissions from "./member_permissions"; import { @@ -99,6 +100,7 @@ export interface TeamData { access_group_models?: string[]; access_group_mcp_server_ids?: string[]; access_group_agent_ids?: string[]; + router_settings?: Record; guardrails?: string[]; policies?: string[]; object_permission?: { @@ -189,6 +191,7 @@ const TeamInfoView: React.FC = ({ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [isDeleting, setIsDeleting] = useState(false); const [isTeamSaving, setIsTeamSaving] = useState(false); + const routerSettingsRef = React.useRef(null); const [organization, setOrganization] = useState(null); const { userRole, userId } = useAuthorized(); const { data: userOrganizations = [] } = useOrganizations(); @@ -587,6 +590,26 @@ const TeamInfoView: React.FC = ({ updateData.access_group_ids = values.access_group_ids; } + // Handle router_settings - read fresh values from DOM at save time. + const currentRouterSettings = routerSettingsRef.current?.getValue(); + if (currentRouterSettings?.router_settings) { + const isMeaningfulValue = (value: unknown) => + value !== null && + value !== undefined && + value !== "" && + value !== false && + !(Array.isArray(value) && value.length === 0); + + const hasNewValues = Object.values(currentRouterSettings.router_settings).some(isMeaningfulValue); + const hadExistingSettings = info.router_settings && + Object.values(info.router_settings).some(isMeaningfulValue); + + // Send if there are new values OR if the user is clearing existing ones + if (hasNewValues || hadExistingSettings) { + updateData.router_settings = currentRouterSettings.router_settings; + } + } + const response = await teamUpdateCall(accessToken, updateData); NotificationsManager.success("Team settings updated successfully"); @@ -1121,6 +1144,14 @@ const TeamInfoView: React.FC = ({ + + + + @@ -1441,6 +1472,44 @@ const TeamInfoView: React.FC = ({
TPM Limit: {info.team_member_budget_table?.tpm_limit || "No Limit"}
RPM Limit: {info.team_member_budget_table?.rpm_limit || "No Limit"}
+
+ Router Settings + {info.router_settings && Object.values(info.router_settings).some( + (v) => v !== null && v !== undefined && v !== "" && !(Array.isArray(v) && v.length === 0) + ) ? ( +
+ {info.router_settings.routing_strategy && ( +
+ Routing Strategy:{" "} + {info.router_settings.routing_strategy} +
+ )} + {info.router_settings.num_retries != null && ( +
Number of Retries: {info.router_settings.num_retries}
+ )} + {info.router_settings.allowed_fails != null && ( +
Allowed Failures: {info.router_settings.allowed_fails}
+ )} + {info.router_settings.cooldown_time != null && ( +
Cooldown Time: {info.router_settings.cooldown_time}s
+ )} + {info.router_settings.timeout != null && ( +
Timeout: {info.router_settings.timeout}s
+ )} + {info.router_settings.retry_after != null && ( +
Retry After: {info.router_settings.retry_after}s
+ )} + {info.router_settings.fallbacks && Array.isArray(info.router_settings.fallbacks) && info.router_settings.fallbacks.length > 0 && ( +
Fallbacks: {info.router_settings.fallbacks.length} configured
+ )} + {info.router_settings.enable_tag_filtering && ( +
Tag Filtering: Enabled
+ )} +
+ ) : ( +
No router settings configured
+ )} +
Organization ID
{info.organization_id}