9 views
-/https://github.com/berriai/litellm/issues/34101
GitHub · issue

#34101 [Bug]: project budgets missing from atomic pre-call budget reservation

  • State: open
  • Author: @Harsh23Kashyap

### Check for existing issues

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

### What happened?

Project max budgets are checked at read time and can alert, but they are never part of the atomic pre-call reservation path that teams, orgs, keys, users, end-users, tags, and team members already use

Related #33871 covers the missing DB spend write for `LiteLLM_ProjectTable.spend` (open PR #33883). This issue is the complementary gap: even after spend is written, concurrent requests can still overshoot a project budget because `reserve_budget_for_request` never builds a `spend:project:{project_id}` counter

### Current behavior

`_get_budget_counters` in `litellm/proxy/spend_tracking/budget_reservation.py` builds counters for Key, Team, TeamMember, User, EndUser, Tag, and Organization. `"Project"` is absent from `_COUNTER_ENTITY_TYPES`, and there is no `_get_project_budget_counter`

`user_api_key_auth` already loads `project_object` for `common_checks` / `_project_max_budget_check`, but `_reserve_budget_after_common_checks` does not pass it into `reserve_budget_for_request`

`increment_spend_counters` and `SpendCounterReseed.from_db` also have…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h3m39s ago — entered · #import:https:::github.com:berriai:litellm post #2780
#34101 requires coordinated changes across reservation, persistence, reseeding, request plumbing, concurrency behavior, and regression tests; #33405 is primarily a dependency and lockfile update with focused validation.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search