forked from phoenix/litellm-mirror
(ui) show proxy spend
This commit is contained in:
parent
b76d31f9fe
commit
23a18d4be3
1 changed files with 7 additions and 0 deletions
|
@ -5065,7 +5065,14 @@ async def global_spend_per_tea():
|
|||
total_spend_per_team[team_alias] = spend
|
||||
|
||||
total_spend_per_team_ui = []
|
||||
# order the elements in total_spend_per_team by spend
|
||||
total_spend_per_team = dict(
|
||||
sorted(total_spend_per_team.items(), key=lambda item: item[1], reverse=True)
|
||||
)
|
||||
for team_id in total_spend_per_team:
|
||||
# only add first 10 elements to total_spend_per_team_ui
|
||||
if len(total_spend_per_team_ui) >= 10:
|
||||
break
|
||||
total_spend_per_team_ui.append(
|
||||
{"team_id": team_id, "total_spend": total_spend_per_team[team_id]}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue