{"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":191,"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":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py#L173-L209","documentation":"Rate-limit guard in _check_team_project_limits: a project's tpm_limit may not exceed its team's tpm_limit when the team has one set; otherwise HTTP 400 with both values. Keeps per-minute token throughput capped at the parent team's envelope.","triggerScenarios":"POST/PUT project with tpm_limit 100000 when the team's tpm_limit is 10000.","commonSituations":"Scaling a project's throughput without scaling the team's; templates assuming unlimited team limits.","solutions":["Lower the project tpm_limit to <= the team's","Raise the team's tpm_limit first, then retry","Omit the project tpm_limit to inherit the team's limit"],"exampleFix":"# before\nteam tpm_limit: 10000\nproject payload: {\"tpm_limit\": 100000}\n\n# after\nteam tpm_limit: 100000 (raised via /team/update)\nproject payload: {\"tpm_limit\": 100000}","handlingStrategy":"validation","validationCode":"team = await get(f\"/team/info?team_id={data['team_id']}\")\nteam_tpm = team[\"team_info\"].get(\"tpm_limit\")\nif team_tpm is not None and data.get(\"tpm_limit\") is not None and data[\"tpm_limit\"] > team_tpm:\n    raise ValueError(f\"project tpm_limit must be <= team tpm_limit ({team_tpm})\")","typeGuard":null,"tryCatchPattern":"try:\n    await post(\"/project/new\", json=data)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 400 and \"tpm_limit\" in e.response.text:\n        data[\"tpm_limit\"] = min(data[\"tpm_limit\"], team_tpm)\n        retry()\n    raise","preventionTips":["Cap project rate limits by the team's configured tpm_limit","Raise team limits before scaling project throughput"],"tags":["litellm","projects","teams","rate-limits","validation","http-400"],"backgroundTag":"quota-exceeds-parent-limit","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}