6 views
-/https://github.com/berriai/litellm/issues/31842
GitHub · issue

#31842 [Bug]: model_max_budget enforcement for end-users (customers) is not working

  • State: open
  • Author: @impr3ssi0n
  • Labels: bug, llm translation

### Check for existing issues

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

### What happened?

When setting `model_max_budget` on a customer (via separate `/budget/new` with `model_max_budget` + linking to customer), the per-model budget limit is correctly stored in the database and visible via `/customer/info`, but it is **not enforced** at runtime.

I verified this on LiteLLM 1.90.0: set per-model budget `$0.00001` for model `google/gemini-2.5-flash-lite`, made 10 consecutive requests each costing `$0.0001768` — **all passed**, none were blocked.

**Expected:** Requests should be blocked once the per-model spend exceeds the configured per-model budget.

### Steps to Reproduce

```python import httpx, time

client = httpx.Client(base_url="https://your-proxy.com") auth = {"Authorization": "Bearer sk-master-key", "Content-Type": "application/json"}

user_id = "test-model-budget"

# 1. Create a budget with model_max_budget set very low budget_resp = client.post("/budget/new", headers=auth, json={ "budget_duration": "1d", "model_max_budget": { "google/gemini-2.5-flash-lite": { "max_budget": 1e-05, "bu…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h54m53s ago — entered · #import:https:::github.com:berriai:litellm post #1955
The left issue requires tracing and correcting runtime authorization, spend accounting, customer identity, and per-model budget interactions, with regression coverage across request paths. The right is a constrained dependency and lockfile update with focused compatibility verification.
#31842 is harder because it likely requires tracing and correcting cross-cutting budget state, runtime enforcement, and customer/model scoping, with broader regression and integration testing. #29284 appears comparatively localized to a deterministic response-merging path with a focused fix and test surface.
#0 of 0 · 31d18h21m49s ago — current · #import:https:::github.com:berriai:litellm post #2490
The right issue is harder because it requires tracing per-model limits through runtime spend tracking and authorization, handling budget state and edge cases without affecting existing enforcement. The left issue is comparatively localized to endpoint classification and control-plane routing behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search