BerriAI/litellm · error · HTTPException

Project tpm_limit ({data.tpm_limit}) exceeds team's tpm_limi

Error message

Project tpm_limit ({data.tpm_limit}) exceeds team's tpm_limit ({team_object.tpm_limit})

What it means

A project's tpm_limit (tokens-per-minute rate limit) must not exceed its parent team's tpm_limit. When both values are set and the project's is larger, LiteLLM returns HTTP 400 from _check_team_project_limits. This keeps project-level rate limits from circumventing the team's throttling.

Source

Thrown at enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py:166

                        detail={
                            "error": f"Model '{m}' not in team's allowed models. Team allowed models={team_models}. Team: {team_object.team_id}"
                        },
                    )

    # --- Validate project max_budget <= team max_budget ---
    # Team stores budget fields directly (max_budget, tpm_limit, rpm_limit)
    # unlike Project which uses a separate LiteLLM_BudgetTable relation
    if data.max_budget is not None and team_object.max_budget is not None and data.max_budget > team_object.max_budget:
        raise HTTPException(
            status_code=400,
            detail={
                "error": f"Project max_budget ({data.max_budget}) exceeds team's max_budget ({team_object.max_budget}). Team: {team_object.team_id}"
            },
        )

    # --- Validate project tpm_limit <= team tpm_limit ---
    if data.tpm_limit is not None and team_object.tpm_limit is not None and data.tpm_limit > team_object.tpm_limit:
        raise HTTPException(
            status_code=400,
            detail={
                "error": f"Project tpm_limit ({data.tpm_limit}) exceeds team's tpm_limit ({team_object.tpm_limit}). Team: {team_object.team_id}"
            },
        )

    # --- Validate project rpm_limit <= team rpm_limit ---
    if data.rpm_limit is not None and team_object.rpm_limit is not None and data.rpm_limit > team_object.rpm_limit:
        raise HTTPException(
            status_code=400,
            detail={
                "error": f"Project rpm_limit ({data.rpm_limit}) exceeds team's rpm_limit ({team_object.rpm_limit}). Team: {team_object.team_id}"
            },
        )


async def _create_budget_for_project(
    data: NewProjectRequest,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Set the project's tpm_limit to at most the team's tpm_limit
  2. Increase the team's tpm_limit first (PUT /team/update), then retry
  3. Omit tpm_limit from the project payload to inherit team throttling

Example fix

// before
team.tpm_limit = 100000
project payload: {"tpm_limit": 250000}
// after
team.tpm_limit = 500000
project payload: {"tpm_limit": 250000}
Defensive patterns

Strategy: validation

Validate before calling

team = await client.get(f'/team/info?team_id={payload["team_id"]}')
team_tpm = team.teams[0].tpm_limit
if payload.get('tpm_limit') is not None and team_tpm is not None and payload['tpm_limit'] > team_tpm:
    payload['tpm_limit'] = team_tpm  # cap at team limit, or raise team first

Type guard

const withinTeamTpm = (p, team) =>
  p.tpm_limit == null || team.tpm_limit == null || p.tpm_limit <= team.tpm_limit;

Prevention

When it happens

Trigger: POST /project/new or PUT /project/update where data.tpm_limit > team_object.tpm_limit and both are non-null, e.g. team tpm_limit=100000 and project tpm_limit=250000. Either side being None skips the check.

Common situations: Tuning a project's throughput upward without adjusting the team first, or onboarding a high-traffic project under a team sized for lighter workloads.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/2b3e38184f2b6f92. Report an issue: GitHub.