feat - add remaining team budget gauge

This commit is contained in:
Ishaan Jaff 2024-06-13 14:28:25 -07:00
parent 944d95d636
commit 51157c148f
3 changed files with 104 additions and 11 deletions

View file

@ -104,6 +104,11 @@ async def add_litellm_data_to_request(
data["metadata"]["user_api_key_team_alias"] = getattr(
user_api_key_dict, "team_alias", None
)
# Team spend, budget - used by prometheus.py
data["metadata"]["user_api_key_team_max_budget"] = user_api_key_dict.team_max_budget
data["metadata"]["user_api_key_team_spend"] = user_api_key_dict.team_spend
data["metadata"]["user_api_key_metadata"] = user_api_key_dict.metadata
_headers = dict(request.headers)
_headers.pop(