diff --git a/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/DeprecationModel.tsx b/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/DeprecationModel.tsx index dfb0e2b71c3..b480bd24983 100644 --- a/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/DeprecationModel.tsx +++ b/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/DeprecationModel.tsx @@ -16,8 +16,26 @@ export function DeprecationModel({ alert }: { alert: DeprecationAlert }) { ); } -export function DeprecationTiming({ alert }: { alert: DeprecationAlert }) { +export function DeprecationTiming({ + alert, + format = "sentence", +}: { + alert: DeprecationAlert; + format?: "sentence" | "duration"; +}) { const days = alert.model.days_until_deprecation; + if (format === "duration") { + if (days === 0) return Today; + return ( + + {Math.abs(days)}{" "} + + {Math.abs(days) === 1 ? "day" : "days"} + {days < 0 ? " ago" : ""} + + + ); + } let label = `Deprecates in ${days} ${days === 1 ? "day" : "days"}`; if (days === 0) label = "Deprecates today"; if (days < 0) label = `Deprecated ${Math.abs(days)} ${days === -1 ? "day" : "days"} ago`; diff --git a/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/MigrationDetail.tsx b/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/MigrationDetail.tsx index 62fee75071e..2a16a8ca380 100644 --- a/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/MigrationDetail.tsx +++ b/ui/litellm-dashboard/src/components/ModelDeprecationAlerts/MigrationDetail.tsx @@ -25,6 +25,12 @@ import { affectedTeams } from "./migrationData"; const TABLE_STATE = { sortFields: [], defaultSort: { id: "", desc: false }, defaultPageSize: 50, filterColumns: [] }; type KeyRow = components["schemas"]["KeySpendActivityRow"]; +function deprecationTimingLabel(days: number): string { + if (days < 0) return "Deprecated"; + if (days === 0) return "Deprecation"; + return "Deprecates in"; +} + function migrationHeading(alert: DeprecationAlert, status: AlertStatus): string { if (status === AlertStatus.Resolved) return "Migration marked resolved"; if (status === AlertStatus.Dismissed) return "Model deprecation dismissed"; @@ -266,9 +272,11 @@ export default function MigrationDetail({

{teamQuery.data?.length ?? "—"}

-

Deprecation

-

- +

+ {deprecationTimingLabel(selected.model.days_until_deprecation)} +

+

+