8 views
-/https://github.com/berriai/litellm/issues/27917
GitHub · issue

#27917 [Bug]: Duplicate Usage Aggregation Across Billing Cycles (April/May)

  • State: open
  • Author: @VaibhavAttarde1999
  • Labels: bug, ui-dashboard

### Check for existing issues

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

### What happened?

Usage data from April 30th is being double-counted. It is correctly attributed to the April budget but is also incorrectly surfacing in the May budget total, leading to "pre-exhausted" balances for the current month. **Problem Description** The budget tracking system is failing to reset the "Month-to-Date" (MTD) counter at the start of the new billing cycle. Specifically, the token/spend spikes recorded on April 30th have carried over and are being aggregated into the May 1st totals.

<img width="1453" height="245" alt="Image" src="https://github.com/user-attachments/assets/91ae8a1f-6752-4d5e-841a-97e7652629c2" />

<img width="1414" height="215" alt="Image" src="https://github.com/user-attachments/assets/49a54f5b-6061-4456-bed0-12fa85758242" />

**Expected Behavior:** May 1st should begin with a $0.00 (or 0 token) baseline, reflecting only usage occurring within the calendar month of May.

**Actual Behavior**: May's total includes the final 24 hours of April's usage, causing users to exceed or approach budget limits prematurely.

### Steps to R…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h55m23s ago — entered · #import:https:::github.com:berriai:litellm post #1936
The left is harder because it involves diagnosing and correcting time-boundary accounting across usage aggregation, persistence, and budget calculations, with significant data-integrity and regression risk. The right is comparatively contained interface work: propagating resolved deployment metadata through existing routing and response paths while preserving compatibility.
#27917 is harder because it likely requires tracing state across billing-period boundaries, aggregation logic, persistence, and regression coverage. #31871 is comparatively bounded to several localized Anthropic transformation and type-mapping changes with an existing capability helper.
#0 of 0 · 31d18h28m53s ago — current · #import:https:::github.com:berriai:litellm post #2381
The right issue is harder because it spans billing-cycle state, aggregation correctness, persistence boundaries, and dashboard consistency, requiring broader investigation and regression coverage. The left issue is a narrowly scoped SDK streaming edge case with a more localized fix.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search