fix(proxy): apply temp budget increase at member spend admission and reservation checks

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-09-17 17:48:33 +00:00
parent e43f19fc7c
commit 32d1dd0cde
2 changed files with 11 additions and 2 deletions

View file

@ -46,6 +46,7 @@ from litellm.proxy.auth.auth_checks import (
_can_object_call_model,
_check_end_user_budget,
_delete_cache_key_object,
_effective_team_member_budget,
_get_user_role,
_is_model_cost_zero,
_is_user_proxy_admin,
@ -2248,7 +2249,10 @@ async def _user_api_key_auth_builder(
)
if team_member_info is not None and team_member_info.litellm_budget_table is not None:
team_member_budget: Final = team_member_info.litellm_budget_table.max_budget
team_member_budget: Final = _effective_team_member_budget(
team_member_info.litellm_budget_table,
now=datetime.now(timezone.utc),
)
if team_member_budget is not None and team_member_budget > 0:
# Read from cross-pod counter (Redis-first) if available
from litellm.proxy.proxy_server import get_current_spend

View file

@ -690,7 +690,12 @@ async def _get_team_member_budget_counter(
team_member_budget: float | None = None
if team_membership is not None and team_membership.litellm_budget_table is not None:
team_member_budget = team_membership.litellm_budget_table.max_budget
from litellm.proxy.auth.auth_checks import _effective_team_member_budget
team_member_budget = _effective_team_member_budget(
team_membership.litellm_budget_table,
now=datetime.now(timezone.utc),
)
else:
default_budget_id: Final = (team_object.metadata or {}).get("team_member_budget_id")
if isinstance(default_budget_id, str):