Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(proxy_setting_endpoints.py): don't block startup if team doesn't exist in default team member budget

Krrish Dholakia4cb42f81b6fd
diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
index e4d469ca9aa..8557bd2bafb 100644
--- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
+++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
@@ -257,14 +257,20 @@ async def update_default_team_member_budget(
for team in teams:
team_id = team.team_id
max_budget_in_team = team.max_budget_in_team
- await update_team(
- data=UpdateTeamRequest(
- team_id=team_id,
- team_member_budget=max_budget_in_team,
- ),
- user_api_key_dict=user_api_key_dict,
- http_request=Request(scope={"type": "http"}),
- )
+ try:
+ await update_team(
+ data=UpdateTeamRequest(
+ team_id=team_id,
+ team_member_budget=max_budget_in_team,
+ ),
+ user_api_key_dict=user_api_key_dict,
+ http_request=Request(scope={"type": "http"}),
+ )
+ except Exception as e:
+ verbose_proxy_logger.info(
+ f"Error updating team {team_id} with team member budget {max_budget_in_team} with error: {e}, skipping.."
+ )
+ continue
async def _update_litellm_setting(