Merge pull request #2797 from BerriAI/ui_qa_imps

[UI] Quality Improvements - show correct team based usage, add litellm favicon
This commit is contained in:
Ishaan Jaff 2024-04-02 13:48:02 -07:00 committed by GitHub
commit 7946c68f47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 2 deletions

View file

@ -5069,7 +5069,7 @@ async def global_spend_per_tea():
SUM(s.spend) AS total_spend
FROM
"LiteLLM_SpendLogs" s
JOIN
LEFT JOIN
"LiteLLM_TeamTable" t ON s.team_id = t.team_id
WHERE
s."startTime" >= CURRENT_DATE - INTERVAL '30 days'
@ -5090,6 +5090,8 @@ async def global_spend_per_tea():
if row_date is None:
continue
team_alias = row["team_alias"]
if team_alias is None:
team_alias = "Unassigned"
team_aliases.add(team_alias)
if row_date in spend_by_date:
# get the team_id for this entry
@ -5115,6 +5117,8 @@ async def global_spend_per_tea():
# only add first 10 elements to total_spend_per_team_ui
if len(total_spend_per_team_ui) >= 10:
break
if team_id is None:
team_id = "Unassigned"
total_spend_per_team_ui.append(
{"team_id": team_id, "total_spend": total_spend_per_team[team_id]}
)

View file

@ -20,6 +20,7 @@
"next": "14.1.0",
"openai": "^4.28.0",
"react": "^18",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.5.0"
@ -6153,6 +6154,18 @@
"node": ">=0.10.0"
}
},
"node_modules/react-copy-to-clipboard": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz",
"integrity": "sha512-k61RsNgAayIJNoy9yDsYzDe/yAZAzEbEgcz3DZMhF686LEyukcE1hzurxe85JandPUG+yTfGVFzuEw3xt8WP/A==",
"dependencies": {
"copy-to-clipboard": "^3.3.1",
"prop-types": "^15.8.1"
},
"peerDependencies": {
"react": "^15.3.0 || 16 || 17 || 18"
}
},
"node_modules/react-day-picker": {
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.0.tgz",

View file

@ -21,6 +21,7 @@
"next": "14.1.0",
"openai": "^4.28.0",
"react": "^18",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.5.0"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -5,7 +5,7 @@ import "./globals.css";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "🚅 LiteLLM",
title: "LiteLLM Dashboard",
description: "LiteLLM Proxy Admin UI",
};