Repository navigation
revert: "feat(proxy): add LiteLLM_DailyGlobalSpend key-free rollup for the usage dashboard (#41324)" - #43595
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
05784eb to
5aafae2
Compare
8449006 to
ceede67
Compare
|
@greptileai review |
a1b7975 to
32bc265
Compare
3a63c86 to
0b489ce
Compare
32bc265 to
b5aa93a
Compare
0b489ce to
4a71348
Compare
…_aggregate_split" (#43596) Co-authored-by: yassin <yassin@berri.ai>
…)" (#43378) * Revert "feat(usage): search keys beyond the top-N usage subset (#42827)" * revert: "feat(proxy): add LiteLLM_DailyGlobalSpend key-free rollup for the usage dashboard (#41324)" (#43595) * Revert "Merge pull request #41324 from BerriAI/litellm_daily_global_spend_table" * Revert "Merge pull request #41293 from BerriAI/litellm_usage_key_free_aggregate_split" (#43596) Co-authored-by: yassin <yassin@berri.ai> --------- Co-authored-by: yassin <yassin@berri.ai> Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…sage view (#42857)" (#43377) * Revert "feat(usage): search team keys beyond the top-N in the Team usage view (#42857)" * revert: "feat(usage): search keys beyond the top-N usage subset (#42827)" (#43378) * Revert "feat(usage): search keys beyond the top-N usage subset (#42827)" * revert: "feat(proxy): add LiteLLM_DailyGlobalSpend key-free rollup for the usage dashboard (#41324)" (#43595) * Revert "Merge pull request #41324 from BerriAI/litellm_daily_global_spend_table" * Revert "Merge pull request #41293 from BerriAI/litellm_usage_key_free_aggregate_split" (#43596) Co-authored-by: yassin <yassin@berri.ai> --------- Co-authored-by: yassin <yassin@berri.ai> Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Reverts #41324
TLDR
Problem this solves:
How it solves it:
git revert -m 1 87694c26ef, conflicts resolved by hand against today's mainLiteLLM_DailyGlobalSpendPrisma model and migration20260915000000_add_daily_global_spend, so upgraded databases need no destructive migrationThe follow-ups on the #41324 branch go with it: c8a2d8c, ad8de0e, 84c098d, 0601d2b, f25d659, abf530f, 3449ae9, 834313a. Later edits to the removed module from #42710 go too, since the file is deleted
User Flow
Before: the Usage page and the aggregated activity endpoints answer global totals partly from the rollup table for closed days
After: the same page and endpoints return the same totals, read straight from the per-key daily spend
Pre-Submission checklist
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreScreenshots / Proof of Fix
Postgres, one proxy on localhost:4000 with a single
openai/gpt-5.4-minideployment, one teamqa-topn-teamwith 105 virtual keys owned byqa-topn-user, each key sending one realPOST /v1/chat/completionsto OpenAIThe QA below ran at 5aafae2 and ceede67. The current head 4a71348 carries the same patch (identical
git patch-id), re-squashed on newer mainBefore (5aafae2)
curl -s "localhost:4000/user/daily/activity/aggregated?start_date=2026-09-28&end_date=2026-09-28&user_id=qa-topn-user" -H "Authorization: Bearer $MASTER_KEY"returnstotal_api_requests: 211,api_key_limit: 100,total_api_keys: 105and 100 entries inbreakdown.api_keyscurl -s "localhost:4000/team/daily/activity/aggregated?start_date=2026-09-28&end_date=2026-09-28&team_ids=qa-topn-team" -H "Authorization: Bearer $MASTER_KEY"returns the same numbersAfter (ceede67)
total_api_requests: 212(one more real chat request was sent right before this run),api_key_limit: 100,total_api_keys: 105and 100 entries inbreakdown.api_keys, the same shape as BeforeLiteLLM_DailyGlobalSpendtable in placeType
Refactoring
Caveats (if any)
Low
LiteLLM_DailyGlobalSpendtable stays in the schema with nothing writing to itLink to Devin session: https://app.devin.ai/sessions/7097c700d7fc4601961a6013b1adcec7
Open in Devin Desktop: https://app.devin.ai/desktop/session/7097c700d7fc4601961a6013b1adcec7?variant=devin
Requested by: @yassin-berriai