17 views
-/https://github.com/berriai/litellm/issues/28020
GitHub · issue

#28020 [Bug]: _team_max_budget_check uses > instead of >= — inconsistent with key/org budget checks

  • State: open
  • Author: @aanchal22
  • Labels: proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

Team budget enforcement uses strict `>` comparison (`spend > max_budget`), while all other budget checks (key, key budget window, team budget window, org) use `>=` (`spend >= max_budget`).

This means when a team's spend exactly equals the budget, the request is allowed through instead of being blocked.

**Code references (v1.83.10):**

Team budget (`_team_max_budget_check`): ```python if spend > team_object.max_budget: # strict > raise litellm.BudgetExceededError(...) ```

Key budget (`_virtual_key_max_budget_check`): ```python if spend >= valid_token.max_budget: # uses >= raise litellm.BudgetExceededError(...) ```

Key budget window: ```python if window_spend >= w["max_budget"]: # uses >= ```

Org budget: ```python if org_table.spend >= org_max_budget: # uses >= ```

Team budget is the only one using `>` instead of `>=`.

### Steps to Reproduce

1. Create a team with `max_budget: 10.0` 2. Generate a key and make requests until team spend reaches exactly `10.0` 3. The next request should be blocked but is allowed through because `1…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h39m29s ago — entered · #import:https:::github.com:berriai:litellm post #3206
Issue #26214 is harder because it requires cross-provider request translation, parameter compatibility analysis, and integration validation across the proxy and client workflow. Issue #28020 is a localized comparison fix with a focused regression test.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search