From 57d1efec1b73f6cdd98206ef7fbe35a44de39c66 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 16 May 2024 16:21:21 -0700 Subject: [PATCH 1/2] fix round team spend to 2 decimals --- ui/litellm-dashboard/src/components/usage.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsx index 543833767..7bb348d1b 100644 --- a/ui/litellm-dashboard/src/components/usage.tsx +++ b/ui/litellm-dashboard/src/components/usage.tsx @@ -237,6 +237,11 @@ const UsagePage: React.FC = ({ total_spend_per_team = total_spend_per_team.map((tspt: any) => { tspt["name"] = tspt["team_id"] || ""; tspt["value"] = tspt["total_spend"] || 0; + // round the value to 2 decimal places + + tspt["value"] = tspt["value"].toFixed(2); + + return tspt; }) From 20dc9e74afa3259fbe80425d988da57f8a2211ba Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 16 May 2024 16:27:35 -0700 Subject: [PATCH 2/2] ui - show key alias on Top Keys instead of key_name --- ui/litellm-dashboard/src/components/usage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsx index 7bb348d1b..682c664c4 100644 --- a/ui/litellm-dashboard/src/components/usage.tsx +++ b/ui/litellm-dashboard/src/components/usage.tsx @@ -212,7 +212,7 @@ const UsagePage: React.FC = ({ setKeySpendData(overall_spend); const top_keys = await adminTopKeysCall(accessToken); const filtered_keys = top_keys.map((k: any) => ({ - key: (k["key_name"] || k["key_alias"] || k["api_key"]).substring( + key: (k["key_alias"] || k["key_name"] || k["api_key"]).substring( 0, 10 ),