litellm - ✅(Solved) Fix [Bug]: Team members added before team_member_budget is configured have no budget enforcement [1 pull requests, 1 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#25506Fetched 2026-04-11 06:13:46
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2referenced ×1

PR fix notes

PR #25557: fix(proxy) - #25506 Team members added before team_member_budget is configured have no budget enforcement

Description (problem / solution / changelog)

Relevant issues

Fixes #25506

<!-- 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 -->

🐛 Bug Fix

Changes

Whenever the user now applies a (team) budget for the first time it will now automatically assign it to the pre existing team members if they did not have a budget attached yet. If they did have a budget attached this is an intentional override so we don't modify the budget of that team member.

Changed files

  • litellm/proxy/management_endpoints/team_endpoints.py (modified, +75/-0)
  • tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py (modified, +137/-0)
  • ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts (modified, +125/-10)
  • ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx (modified, +2/-1)
  • ui/litellm-dashboard/src/components/add_model/AddModelForm.tsx (modified, +2/-2)
  • ui/litellm-dashboard/src/components/add_model/litellm_model_name.tsx (modified, +1/-0)
  • ui/litellm-dashboard/src/components/add_model/model_connection_test.tsx (modified, +2/-2)

Code Example

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

---

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"}'

---

No relevant log files.
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?

When users are added to a team before team_member_budget is configured on the team, those users never receive a team_memberships entry with a linked budget. This means they have no budget enforcement — they can spend without limits even after the team budget is later configured.

Expected behavior: When team_member_budget is set or updated on a team, all existing team members (including those added before the budget was configured) should receive a team_memberships entry linked to a budget.

Actual behavior: Only members added after the budget is configured get a team_memberships entry. Pre-existing members are missing from team_memberships entirely and have no budget limits.

Steps to Reproduce

  1. Create a team and add members (user A and user B):
    curl -X POST http://localhost:4000/team/member_add \
      -H "Authorization: Bearer sk-admin" \
      -H "Content-Type: application/json" \
      -d '{"team_id": "1", "member": {"user_id": "user-A", "role": "user"}}'
  2. At this point, /team/info shows team_memberships: [] — no memberships for any user
  3. Update the team with team_member_budget and team_member_budget_duration:
    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"}'
  4. Add a new member (user C) to the team
  5. Call GET /team/info?team_id=1
  6. Observe: user C has a team_memberships entry with a budget, but user A and user B do not

Relevant log output

No relevant log files.

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

Update the team membership entries for existing members when the team_member_budget is configured or updated to include a link to the budget.

Guidance

  • Review the team update endpoint (/team/update) to ensure it triggers an update of existing team members' team_memberships entries when team_member_budget is set or updated.
  • Verify that the database or data storage is correctly updated with the new team_memberships entries for existing team members after the team_member_budget is configured.
  • Check for any conditional logic in the code that might be preventing the update of team_memberships for members added before the budget was configured.
  • Consider adding a retroactive update mechanism to apply the budget to existing team members when the team_member_budget is first configured.

Example

# Example of updating an existing team member's membership entry with a budget
curl -X POST http://localhost:4000/team/update_member \
  -H "Authorization: Bearer sk-admin" \
  -H "Content-Type: application/json" \
  -d '{"team_id": "1", "member": {"user_id": "user-A", "role": "user", "budget": 2.0}}'

Notes

The provided information suggests a logic issue in the team update endpoint or the underlying data storage. The fix should focus on ensuring that existing team members' team_memberships entries are updated when the team_member_budget is configured or updated.

Recommendation

Apply a workaround by manually updating the team_memberships entries for existing team members when the team_member_budget is configured, until a permanent fix can be implemented in the code.

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

litellm - ✅(Solved) Fix [Bug]: Team members added before team_member_budget is configured have no budget enforcement [1 pull requests, 1 participants]