Issue evidence · AI API · BerriAI/litellm

Budget reset never commits once LiteLLM_EndUserTable is large

GitHub issue: https://github.com/BerriAI/litellm/issues/46404

Not reproduced

With millions of end-user rows the budget reset statements run past the 30 s Prisma cutoff, so budget_reset_at never moves.

What Badgr ran

Created LiteLLM's schema in a disposable Postgres 16 (via a LiteLLM 1.104.2 proxy start), inserted 3,000,000 rows into LiteLLM_EndUserTable with random spend and no budget_id, then ran the two reset statements (budget_id IN (...) and budget_id IS NULL, each with spend > 0) in one transaction and rolled back.

What came back

  • Statements together: 20.2 s on this laptop, with the second one updating all 3,000,000 rows.
  • The table has no index on budget_id, so each statement scans every row, as the issue says.

This shows the cost scales with table size but did not reach the 30 s cutoff on this hardware, and it does not exercise Prisma's HTTP timeout. A larger table or slower disk would be needed.

Checked 2026-10-14 in Badgr’s local development environment.

← All issue evidence