Skip to content

Conversation

iabhi4
Copy link
Contributor

@iabhi4 iabhi4 commented Sep 12, 2025

Relevant issues

Fixes #13581

Pre-Submission checklist

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

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • 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

Type

🆕 New Feature

Changes

This PR introduces a system to automatically assign a default budget to new teams created via the JWT team_id_upsert flow.

  • New Function: Adds a new, centralized create_team_with_defaults function in litellm/proxy/auth/auth_checks.py to handle the creation of new teams and the application of default settings.
  • Budget Logic: This new function reads the max_budget value from the litellm.default_team_settings list in the proxy configuration and applies it to the new team during creation.
  • Refactoring: The existing _get_team_db_check function has been refactored to use this new function, ensuring the logic is clean and reusable.
  • Unit Tests: Includes two unit tests to verify that the default budget is applied correctly and that the system gracefully handles cases where no default budget is configured.

Usage

To enable this feature, an administrator must configure default_team_settings in their config.yaml.
Example config.yaml:

litellm_settings:
  default_team_settings:
    - team_id: "default-jwt-settings"
      max_budget: 100.0

Screenshot

image

Copy link

vercel bot commented Sep 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Sep 14, 2025 7:08pm

Copy link
Contributor

@krrishdholakia krrishdholakia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduce code duplication -> ensures fewer bugs

@krrishdholakia krrishdholakia merged commit 3f90fe9 into BerriAI:main Sep 16, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Implement Default Budget Assignment for Auto-Generated JWT Teams
2 participants