The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
added doc
shivam546ecfb0845e
diff --git a/docs/my-website/docs/proxy/team_budgets.md b/docs/my-website/docs/proxy/team_budgets.mdindex 01b07f23a33..6c38e0b1b93 100644--- a/docs/my-website/docs/proxy/team_budgets.md+++ b/docs/my-website/docs/proxy/team_budgets.md@@ -177,3 +177,7 @@ Expect to see this metric on prometheus to track the Remaining Budget for the te```shelllitellm_remaining_team_budget_metric{team_alias="QA Prod Bot",team_id="de35b29e-6ca8-4f47-b804-2b79d07aa99a"} 9.699999999999992e-06```++## See Also++- [Per-model TPM/RPM for teams](./users.md#per-team-model) - Set rate limits per model for all keys in a teamdiff --git a/docs/my-website/docs/proxy/users.md b/docs/my-website/docs/proxy/users.mdindex 58813eaf49e..88a7a0f1e07 100644--- a/docs/my-website/docs/proxy/users.md+++ b/docs/my-website/docs/proxy/users.md@@ -641,7 +641,7 @@ You can set:- tpm limits (tokens per minute)- rpm limits (requests per minute)- max parallel requests-- rpm / tpm limits per model for a given key+- rpm / tpm limits per model for a given key or team### TPM Rate Limit Type (Input/Output/Total)@@ -689,6 +689,62 @@ curl --location 'http://0.0.0.0:4000/team/new' \}```+</TabItem>+<TabItem value="per-team-model" label="Per Team Per Model">++**Set rate limits per model for a team**++Use `model_rpm_limit` and `model_tpm_limit` to set rate limits per model for all keys belonging to a team. These limits apply across all keys in the team and are inherited by keys unless overridden at the key level.++Use `/team/new` or `/team/update` with `model_rpm_limit` and `model_tpm_limit` as dictionaries mapping model names to their limits:++```shell+curl --location 'http://0.0.0.0:4000/team/new' \+--header 'Authorization: Bearer sk-1234' \+--header 'Content-Type: application/json' \+--data '{+ "team_id": "my-prod-team",+ "model_rpm_limit": {"gpt-4": 100, "gpt-3.5-turbo": 200},+ "model_tpm_limit": {"gpt-4": 10000, "gpt-3.5-turbo": 20000}+}'+```++**Update existing team with per-model limits:**++```shell+curl --location 'http://0.0.0.0:4000/team/update' \+--header 'Authorization: Bearer sk-1234' \+--header 'Content-Type: application/json' \+--data '{+ "team_id": "my-prod-team",+ "model_rpm_limit": {"gpt-4": 100, "gpt-3.5-turbo": 200},+ "model_tpm_limit": {"gpt-4": 10000, "gpt-3.5-turbo": 20000}+}'+```++**Alternative: Use metadata**++You can also pass per-model limits via the `metadata` field:++```shell+curl --location 'http://0.0.0.0:4000/team/update' \+--header 'Authorization: Bearer sk-1234' \+--header 'Content-Type: application/json' \+--data '{+ "team_id": "my-prod-team",+ "metadata": {+ "model_rpm_limit": {"gpt-4": 100, "gpt-3.5-turbo": 200},+ "model_tpm_limit": {"gpt-4": 10000, "gpt-3.5-turbo": 20000}+ }+}'+```++**Resolution order:** When a key belongs to a team, rate limits are resolved as: **Key metadata > Key model_max_budget > Team metadata**. Keys can override team-level per-model limits with their own `model_rpm_limit` or `model_tpm_limit`.++**Verify:** Make a `/chat/completions` request and check response headers `x-litellm-key-remaining-requests-{model}` and `x-litellm-key-remaining-tokens-{model}` for the model-specific limits.++[**See Swagger**](https://litellm-api.up.railway.app/#/team%20management/new_team_team_new_post)+</TabItem><TabItem value="per-user" label="Per Internal User">