litellm/litellm/models
tin-berri b608fa878f
feat(budgets): support custom additional spend windows (#52976)
* feat(budgets): support custom additional spend windows

* fix(budgets): preserve window identity with shared reset helpers

* fix(budgets): normalize request timestamps before window accounting

* fix(budgets): preserve preset periods and daily reset boundaries

* fix(budgets): compare reset boundaries as UTC instants

* refactor(budgets): reuse shared duration validation, reset carry and the reset job for customer windows

Customer budget_limits now keep the submitted duration and validate through
budget_duration_error like user windows. Reset carry on edits goes through one
carry_budget_limit_resets helper shared with group_budget_patch. Customer
budget rows join the reset job's window sources, which only advance reset_at
because their counters are keyed by window start, so the anchor arithmetic in
get_next_standardized_reset_time is removed. budget_duration_error now also
rejects durations whose window start overflows.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(budgets): type the window reset check and drop the unused overflow expression

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(budgets): preserve concurrent edits during window resets

* Revert "fix(budgets): preserve concurrent edits during window resets"

This reverts commit 13fb3c3cea.

* fix(budgets): keep reset locals final and freeze reset tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): preserve custom caps during calendar budget edits

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): show and sort custom customer budget caps

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): centralize customer budget window policies

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): avoid uncapped labels for custom organization caps

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(budgets): retain custom counter identity across edits

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(budgets): keep custom daily windows stable through fall back

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Revert "fix(budgets): keep custom daily windows stable through fall back"

This reverts commit c9f6353494.

* fix(ui): remove custom budget windows edited by a form

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-20 00:54:52 -08:00
..
__init__.py feat(budgets): add per-model tpm and rpm limit maps to budgets and customers (#50797) 2026-11-09 22:15:18 -08:00
access_group.py feat(access-groups): grant vector stores through access groups (#50290) 2026-11-12 14:59:17 -08:00
alert.py feat(alerts): add email labels, bulk actions and threshold editing (#52139) 2026-11-16 15:32:19 -08:00
autorouter_session.py fix(autorouter): compare historical and new savings consistently (#43348) 2026-09-29 12:40:19 -07:00
base.py refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
budget.py feat(budgets): support custom additional spend windows (#52976) 2026-11-20 00:54:52 -08:00
config.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
credentials.py feat(github_copilot): support a GHE.com host on per-user Copilot credentials (#47610) 2026-10-20 14:16:35 -07:00
deployment_warning.py refactor(proxy): inject deployment warning ignores through repositories (#48592) 2026-10-30 22:57:55 +00:00
end_user.py fix(proxy): allow model instances in LiteLLM_EndUserTable validation (#41677) 2026-10-15 10:57:26 -07:00
fallback.py fix(fallback): preserve concurrent writes and serve saved configuration (#51245) 2026-11-11 15:26:23 -08:00
gateway_activity.py refactor(proxy): inject gateway activity through a typed repository (#49116) 2026-10-30 16:25:11 -07:00
managed_files.py refactor(types): replace Any with proven types in 50 files (#47818) 2026-10-21 11:58:31 +00:00
mcp_server.py feat(mcp): rate limit all MCP operations and add server-level rpm (#44600) 2026-10-07 16:30:52 -07:00
model.py fix(proxy): serialize model block responses 2026-08-29 21:22:17 -07:00
object_permission.py feat(proxy): app-scoped read access to Customer Management through object permissions (#52781) 2026-11-19 10:43:41 -08:00
organization.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
organization_membership.py refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
performance_alert.py feat(alerts): add email labels, bulk actions and threshold editing (#52139) 2026-11-16 15:32:19 -08:00
plugin_upload.py feat(skills): add sortable Skills Hub catalog and publication audit (#50195) 2026-11-06 00:57:33 +00:00
project.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
skill_submission.py feat(skills): let authors edit and withdraw pending submissions (#51312) 2026-11-12 08:30:10 -08:00
skills.py refactor(skills): move NewSkillRequest to litellm.models.skills (#45768) 2026-10-10 20:33:16 +00:00
spend_logs.py feat(spend-logs): add lifecycle timestamps 2026-08-18 14:16:08 -07:00
subscription_account.py feat(usage): show subscription-covered providers and account fees separately (#44772) 2026-10-30 03:58:36 -07:00
tag.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
team.py feat(access-groups): grant vector stores through access groups (#50290) 2026-11-12 14:59:17 -08:00
team_membership.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
user.py feat(proxy): support budget_limits windows on internal users (#51763) 2026-11-14 07:44:35 -05:00
user_banner.py refactor(proxy): inject database repositories through per-repository dependencies (#48507) 2026-10-30 22:57:54 +00:00
verification_token.py feat(customer portal): set budgets per customer and gateway app (#52477) 2026-11-18 17:31:03 +00:00