{"record":{"id":"2b3e38184f2b6f92","repo":"BerriAI/litellm","slug":"project-tpm-limit-data-tpm-limit-exceeds-team","errorCode":null,"errorMessage":"Project tpm_limit ({data.tpm_limit}) exceeds team's tpm_limit ({team_object.tpm_limit})","messagePattern":"Project tpm_limit \\((.+?)\\) exceeds team's tpm_limit \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py","lineNumber":166,"sourceCode":"                        detail={\n                            \"error\": f\"Model '{m}' not in team's allowed models. Team allowed models={team_models}. Team: {team_object.team_id}\"\n                        },\n                    )\n\n    # --- Validate project max_budget <= team max_budget ---\n    # Team stores budget fields directly (max_budget, tpm_limit, rpm_limit)\n    # unlike Project which uses a separate LiteLLM_BudgetTable relation\n    if data.max_budget is not None and team_object.max_budget is not None and data.max_budget > team_object.max_budget:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Project max_budget ({data.max_budget}) exceeds team's max_budget ({team_object.max_budget}). Team: {team_object.team_id}\"\n            },\n        )\n\n    # --- Validate project tpm_limit <= team tpm_limit ---\n    if data.tpm_limit is not None and team_object.tpm_limit is not None and data.tpm_limit > team_object.tpm_limit:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Project tpm_limit ({data.tpm_limit}) exceeds team's tpm_limit ({team_object.tpm_limit}). Team: {team_object.team_id}\"\n            },\n        )\n\n    # --- Validate project rpm_limit <= team rpm_limit ---\n    if data.rpm_limit is not None and team_object.rpm_limit is not None and data.rpm_limit > team_object.rpm_limit:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Project rpm_limit ({data.rpm_limit}) exceeds team's rpm_limit ({team_object.rpm_limit}). Team: {team_object.team_id}\"\n            },\n        )\n\n\nasync def _create_budget_for_project(\n    data: NewProjectRequest,","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py#L148-L184","documentation":"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.","triggerScenarios":"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.","commonSituations":"Tuning a project's throughput upward without adjusting the team first, or onboarding a high-traffic project under a team sized for lighter workloads.","solutions":["Set the project's tpm_limit to at most the team's tpm_limit","Increase the team's tpm_limit first (PUT /team/update), then retry","Omit tpm_limit from the project payload to inherit team throttling"],"exampleFix":"// before\nteam.tpm_limit = 100000\nproject payload: {\"tpm_limit\": 250000}\n// after\nteam.tpm_limit = 500000\nproject payload: {\"tpm_limit\": 250000}","handlingStrategy":"validation","validationCode":"team = await client.get(f'/team/info?team_id={payload[\"team_id\"]}')\nteam_tpm = team.teams[0].tpm_limit\nif payload.get('tpm_limit') is not None and team_tpm is not None and payload['tpm_limit'] > team_tpm:\n    payload['tpm_limit'] = team_tpm  # cap at team limit, or raise team first","typeGuard":"const withinTeamTpm = (p, team) =>\n  p.tpm_limit == null || team.tpm_limit == null || p.tpm_limit <= team.tpm_limit;","tryCatchPattern":null,"preventionTips":["Keep a single source of truth mapping teams to their tpm/rpm caps and validate requests against it","Treat team limits as envelopes: total project throughput should be planned under them"],"tags":["litellm","rate-limit","tpm","team","validation","enterprise","http-400"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}