Update enduser spend and budget reset date based on budget duration - #8460
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Thank you for this PR @laurien16 Can you share a screenshot of this passing your testing? |
|
Hi @krrishdholakia, I added a screenshot of the two created and passing tests. Do you need anything else? |
|
Is this under consideration to be merged soon? Budget reset for end users is currently not working at all and this would be immensely helpful. |
|
@krrishdholakia Does anyone have this on their radar? Without this PR, the budgets for end users won't reset, which is a major bug. Or was this fixed somewhere else? I merged the PR in my personal fork and works very well. |
|
Thanks for the bump @Simon-Stone - looking into this now |
|
@laurien16 this looks like it's failing linting + tests, can you please look into this? |
|
If @laurien16 can't deal with this soon, I would be happy to open another PR from my fork. |
|
that'd be great! @Simon-Stone |
|
Hi @krrishdholakia, hi @Simon-Stone, I can have a look at this early next week and adapt it to the new codebase if that is sufficient. |
…budget-by-duration
|
Hi @krrishdholakia, conflicts are resolved now, all checks have passed. |
|
@krrishdholakia any plans to consider this? It's a crucial fix. Last I checked, end user budgets otherwise don't reset, which makes them unusable for any recurring budgets. |
|
Thanks @laurien16 for the work and @Simon-Stone for the bump on this! Fix will be live on tomorrow's nightly. |


Title
Reset enduser spend based on budget duration
Relevant issues
Fixes #7129
Type
🐛 Bug Fix
✅ Test
Changes
budget_reset_atif it's None, but a budget_duration is given (litellm/proxy/management_endpoints/budget_management_endpoints.py).get_data-function inlitellm/proxy/utils.pyto also get data frombudgettable based on a passed reset_at date and fromendusertable based on a passed list of budget ids.update_data-function to also updatebudgettable andendusertable accordingly.reset_budget-function contains a new logic that ensures that the budgets whose reset period has expired are updated and that the corresponding end-user spend values are properly reset.Testing