16 views
-/https://github.com/berriai/litellm/issues/27735
GitHub · issue

#27735 [BUG] Virtual key BudgetExceededError uses stale spend while /key/info shows spend below max_budget

  • State: open
  • Author: @Sunsilkk

## What happened?

We saw failed proxy requests for a team-scoped virtual key where LiteLLM rejected the request with `BudgetExceededError`, but the current key/team spend reported by management APIs was still below the configured budget.

This looks related to #27639, but this case is for a **virtual key max_budget** check rather than an end-user budget.

## Relevant LiteLLM version

`1.84.0`

From `/health/readiness`:

```json { "status": "healthy", "db": "connected", "cache": "redis", "litellm_version": "1.84.0", "use_aiohttp_transport": true, "log_level": "WARNING" } ```

Runtime from traceback: Python `3.13` in `/app/.venv/lib/python3.13/site-packages/litellm/...`.

## Setup

LiteLLM proxy with:

- Postgres DB connected - Redis cache connected - Team-scoped virtual keys - `budget_duration: 30d` - OpenRouter model group

Example sanitized virtual key config:

```json { "key_alias": "<service>-Dev", "team_id": "<team-id>", "models": [ "openrouter/qwen/qwen3.5-27b", "openrouter/qwen/qwen3.6-flash" ], "max_budget": 10.0, "budget_duration": "30d", "budget_reset_at": "2026-06-01T00:00:00Z", "blocked": null, "soft_budget_cooldown": false } ```

T…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h46m20s ago — entered · #import:https:::github.com:berriai:litellm post #2300
#27735 is harder because diagnosing and correcting stale budget enforcement likely spans spend accounting, cache consistency, concurrency, and multiple request paths, with greater regression and distributed-system risk. #31447 appears more localized to persistence/update semantics and can be addressed with focused merge behavior and regression tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search