litellm - ✅(Solved) Fix [Bug]: /team/member_update does not support setting budget_duration on individual member budgets [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25509Fetched 2026-04-11 06:13:41
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2referenced ×1

PR fix notes

PR #25560: fix(proxy) #25509 add support setting budget_duration on individual member budgets

Description (problem / solution / changelog)

Relevant issues

Fixes #25509

<!-- e.g. "Fixes #000" -->

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🆕 New Feature 🐛 Bug Fix

Changes

Currently setting a team member budget is not working following the expected behavior. Unlike a team member budget its not possible to set a budget duration and as such these budgets are lifeteam budgets and not periodic. This PR makes it possible to pass a team member budget duration. If the field is not passed we should use the value from the parent team. If it is passed we should use the value and if null is passed we keep the current behavior of a lifetime budget.

Changed files

  • litellm/proxy/_types.py (modified, +7/-0)
  • litellm/proxy/management_endpoints/common_utils.py (modified, +16/-2)
  • litellm/proxy/management_endpoints/team_endpoints.py (modified, +21/-0)
  • tests/test_litellm/proxy/common_utils/test_upsert_budget_membership.py (modified, +74/-0)
  • tests/test_litellm/proxy/prompts/test_prompt_endpoints.py (modified, +11/-3)
  • tests/test_litellm/proxy/test_team_member_update.py (modified, +209/-1)

Code Example

curl -X POST http://localhost:4000/team/update \
     -H "Authorization: Bearer sk-admin" \
     -H "Content-Type: application/json" \
     -d '{"team_id": "1", "team_member_budget": 2.0, "team_member_budget_duration": "30d"}'

---

curl -X POST http://localhost:4000/team/member_update \
     -H "Authorization: Bearer sk-admin" \
     -H "Content-Type: application/json" \
     -d '{"team_id": "1", "user_id": "user-A", "max_budget_in_team": 5}'

---

No relevant log files. Maybe a JSON representation of /team/info helps with understanding.

# Member's budget after member_update — note budget_duration is null
{
  "user_id": "user-A",
  "budget_id": "59db2fc6-96c9-40e0-94e5-c5bebb572084",
  "litellm_budget_table": {
    "budget_id": "59db2fc6-96c9-40e0-94e5-c5bebb572084",
    "soft_budget": null,
    "max_budget": 10.0,
    "max_parallel_requests": null,
    "tpm_limit": null,
    "rpm_limit": null,
    "model_max_budget": null,
    "budget_duration": null
  }
}

# Compare with member added AFTER team budget was set — has budget_duration
{
  "user_id": "user-B",
  "budget_id": "team-My-Team-budget-63e7b28a977546279d0f44cec694a300",
  "litellm_budget_table": {
    "max_budget": 2.0,
    "budget_duration": "30d"
  }
}
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

The /team/member_update endpoint does not support setting budget_duration on individual team member budgets. The underlying _upsert_budget_and_membership function only accepts max_budget, tpm_limit, and rpm_limit there is no parameter for budget_duration.

This means individual member budgets created via member_update act as lifetime caps rather than recurring allowances, even when the team's team_member_budget has a budget_duration configured.

Expected behavior: /team/member_update should support a budget_duration parameter (or inherit from the team's team_member_budget_duration) so that individual member budgets can auto-reset.

Actual behavior: Budgets created via member_update always have budget_duration: null, meaning they never reset.

Steps to Reproduce

  1. Create a team with a recurring team member budget:
    curl -X POST http://localhost:4000/team/update \
      -H "Authorization: Bearer sk-admin" \
      -H "Content-Type: application/json" \
      -d '{"team_id": "1", "team_member_budget": 2.0, "team_member_budget_duration": "30d"}'
  2. Update an existing member's budget:
    curl -X POST http://localhost:4000/team/member_update \
      -H "Authorization: Bearer sk-admin" \
      -H "Content-Type: application/json" \
      -d '{"team_id": "1", "user_id": "user-A", "max_budget_in_team": 5}'
  3. Check the member's budget via GET /team/info?team_id=1
  4. Observe: the member's litellm_budget_table has budget_duration: null

Relevant log output

No relevant log files. Maybe a JSON representation of /team/info helps with understanding.

# Member's budget after member_update — note budget_duration is null
{
  "user_id": "user-A",
  "budget_id": "59db2fc6-96c9-40e0-94e5-c5bebb572084",
  "litellm_budget_table": {
    "budget_id": "59db2fc6-96c9-40e0-94e5-c5bebb572084",
    "soft_budget": null,
    "max_budget": 10.0,
    "max_parallel_requests": null,
    "tpm_limit": null,
    "rpm_limit": null,
    "model_max_budget": null,
    "budget_duration": null
  }
}

# Compare with member added AFTER team budget was set — has budget_duration
{
  "user_id": "user-B",
  "budget_id": "team-My-Team-budget-63e7b28a977546279d0f44cec694a300",
  "litellm_budget_table": {
    "max_budget": 2.0,
    "budget_duration": "30d"
  }
}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.3.rc.1

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The /team/member_update endpoint needs to be updated to support setting budget_duration on individual team member budgets.

Guidance

  • Modify the _upsert_budget_and_membership function to accept a budget_duration parameter.
  • Update the /team/member_update endpoint to pass the budget_duration parameter to the _upsert_budget_and_membership function.
  • Consider adding a default value for budget_duration that inherits from the team's team_member_budget_duration if not provided.
  • Verify the fix by checking the budget_duration value in the member's litellm_budget_table after updating a member's budget using the /team/member_update endpoint.

Example

curl -X POST http://localhost:4000/team/member_update \
  -H "Authorization: Bearer sk-admin" \
  -H "Content-Type: application/json" \
  -d '{"team_id": "1", "user_id": "user-A", "max_budget_in_team": 5, "budget_duration": "30d"}'

Notes

The current implementation only supports max_budget, tpm_limit, and rpm_limit parameters, which means individual member budgets created via member_update act as lifetime caps rather than recurring allowances.

Recommendation

Apply a workaround by modifying the _upsert_budget_and_membership function to accept a budget_duration parameter, and update the /team/member_update endpoint to pass this parameter. This will allow individual member budgets to auto-reset based on the specified duration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING