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
Merge branch 'main' into litellm_bulk_user_delete
ryan6ea1085bc305
diff --cc litellm/proxy/auth/route_checks.pyindex 4c64d4d7e23,3990d3b0bce..166a0500cee--- a/litellm/proxy/auth/route_checks.py+++ b/litellm/proxy/auth/route_checks.py@@@ -24,8 -24,8 +24,9 @@@ _PROXY_ADMIN_VIEW_ONLY_BLOCKED_ROUTES:[# user"/user/new",+ "/management/v1/users/bulk","/user/delete",+ "/management/v1/users/bulk_delete","/user/bulk_update",# team"/team/new",@@@ -760,11 -759,10 +761,12 @@@ class RouteChecks_ADMIN_VIEWER_BLOCKED_WRITE_ROUTES = frozenset(["/user/new",+ "/management/v1/users/bulk","/user/delete",+ "/management/v1/users/bulk_delete","/user/bulk_update","/team/new",+ "/management/v1/teams/{team_id}/members/bulk_delete","/team/update","/team/delete","/model/new",diff --cc litellm/proxy/list_api/common.pyindex 7ef2827f30e,a0b0d45848f..daa6414fd94--- a/litellm/proxy/list_api/common.py+++ b/litellm/proxy/list_api/common.py@@@ -56,6 -58,31 +58,40 @@@ def escape_like(value: str) -> strreturn value.replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_")+ class ValidationErrorDetail(TypedDict):- """The two keys of a pydantic/FastAPI validation error a problem document needs."""++ """The keys of a pydantic/FastAPI validation error a problem document needs."""+++ type: ReadOnly[str]+ loc: ReadOnly[tuple[int | str, ...]]+ msg: ReadOnly[str]++-def request_validation_problem(errors: Sequence[ValidationErrorDetail]) -> ProblemDetail:++def _is_length_error_of_rejected_items(error: ValidationErrorDetail, errors: Sequence[ValidationErrorDetail]) -> bool:++ """pydantic counts only items that validated, so a bad item also trips the parent's min_length."""++ return error["type"] == "too_short" and any(++ len(other["loc"]) > len(error["loc"]) and other["loc"][: len(error["loc"])] == error["loc"] for other in errors++ )++++++def request_validation_problem(raw_errors: Sequence[ValidationErrorDetail]) -> ProblemDetail:+ """A body that fails validation (an unknown field included) is 422; a bad query parameter is 400."""++ errors: Final = tuple(error for error in raw_errors if not _is_length_error_of_rejected_items(error, raw_errors))+ detail: Final = "; ".join(f"{'.'.join(str(part) for part in error['loc'][1:])}: {error['msg']}" for error in errors)+ if any(error["loc"] and error["loc"][0] == "body" for error in errors):+ return ProblemDetail(+ type=f"{PROBLEM_TYPE_BASE}invalid-request-body",+ title="Invalid request body",+ status=422,+ detail=detail or "The request body is invalid.",+ )+ return ProblemDetail(+ type=f"{PROBLEM_TYPE_BASE}invalid-query-parameter",+ title="Invalid query parameter",+ status=400,+ detail=detail or "The request query parameters are invalid.",+ )++def unknown_query_param_problem(unknown: tuple[str, ...], allowed: tuple[str, ...]) -> ProblemDetail:return ProblemDetail(type=f"{PROBLEM_TYPE_BASE}unknown-query-parameter",diff --cc litellm/proxy/management_endpoints/management_v1/users.pyindex fa2a5cf3c3d,33a55c08513..afe4482c9da--- a/litellm/proxy/management_endpoints/management_v1/users.py+++ b/litellm/proxy/management_endpoints/management_v1/users.py@@@ -1,4 -1,4 +1,4 @@@- """`POST /management/v1/users/bulk_delete`."""-"""`POST /management/v1/users/bulk`."""++"""`POST /management/v1/users/bulk` and `POST /management/v1/users/bulk_delete`."""from typing import Annotated, Final@@@ -7,95 -7,99 +7,181 @@@ from fastapi import APIRouter, Dependsfrom litellm._logging import verbose_proxy_loggerfrom litellm.proxy._types import CommonProxyErrors, UserAPIKeyAuthfrom litellm.proxy.auth.user_api_key_auth import user_api_key_auth-from litellm.proxy.list_api.common import PROBLEM_TYPE_BASE, ManagementProblem+from litellm.proxy.list_api.common import PROBLEM_TYPE_BASE, ManagementProblem, reject_unknown_query_paramsfrom litellm.proxy.management_endpoints.management_v1.common import MANAGEMENT_V1_PREFIX+ from litellm.proxy.management_helpers.bulk_user_creation import bulk_create_users+from litellm.proxy.management_helpers.bulk_user_deletion import bulk_delete_usersfrom litellm.proxy.management_helpers.utils import (- management_endpoint_wrapper, # pyright: ignore[reportUnknownVariableType] # legacy decorator is untyped+ management_endpoint_wrapper, # pyright: ignore[reportUnknownVariableType] # legacy untyped decorator)from litellm.types.proxy.management_endpoints.internal_user_endpoints import (+ BulkDeleteUserRequest,+ BulkDeleteUsersResponse,+ BulkNewUserRequest,+ BulkNewUserResponse,)from litellm.types.proxy.management_endpoints.management_v1 import ProblemDetailrouter: Final = APIRouter(prefix=MANAGEMENT_V1_PREFIX)+ @router.post(+ "/users/bulk",+ tags=["Internal User management"], # mutable-ok: fastapi types tags as list[str | Enum]+ dependencies=(Depends(user_api_key_auth),),+ response_model=BulkNewUserResponse,+ )+ @management_endpoint_wrapper+ async def bulk_create_users_route(+ data: BulkNewUserRequest,+ user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],+ ) -> BulkNewUserResponse:+ """+ Create up to 500 internal users in one request, optionally adding each one to teams.++ Every entry in `users` takes the same fields as `/user/new`, with two differences: `auto_create_key`+ defaults to `false` (opt in per user to also get a virtual key back) and `send_invite_email` is not+ supported. Unknown fields are rejected with 422. Rows are validated together (duplicate ids or emails,+ unknown teams, roles the caller may not grant), inserted in one statement, and each referenced team is+ written once for all of its new members.++ Rows fail independently: a bad row is reported in `data` with `success: false` and an `error`, and the+ other rows still get created. A user that was created but could not be added to one of its teams is+ reported with `success: true`, `teams` listing where they did land, and `error` naming the failed team.+ The whole request is refused with a 403 problem document only if creating the valid rows would exceed+ the license seat limit.++ Example curl:+ ```+ curl -X POST "http://localhost:4000/management/v1/users/bulk" \\+ -H "Content-Type: application/json" \\+ -H "Authorization: Bearer sk-1234" \\+ -d '{+ "users": [+ {"user_email": "[email protected]", "user_role": "internal_user", "teams": ["team-1"]},+ {"user_email": "[email protected]", "user_role": "internal_user", "auto_create_key": true}+ ]+ }'+ ```++ Returns `data` (one entry per input row, in order, with `user_id`, `user_email`, `success`, `teams`,+ `key`, `error`) and `meta` with `total_requested`, `created` and `failed`.+ """+ try:+ from litellm.proxy.proxy_server import (+ _license_check, # pyright: ignore[reportPrivateUsage] # same proxy license singleton /user/new reads+ litellm_proxy_admin_name,+ prisma_client,+ user_api_key_cache,+ )++ if prisma_client is None:+ raise ManagementProblem(+ ProblemDetail(+ type=f"{PROBLEM_TYPE_BASE}database-not-connected",+ title="Database not connected",+ status=503,+ detail=CommonProxyErrors.db_not_connected_error.value,+ )+ )++ return await bulk_create_users(+ users=data.users,+ user_api_key_dict=user_api_key_dict,+ prisma_client=prisma_client,+ license_check=_license_check,+ litellm_proxy_admin_name=litellm_proxy_admin_name,+ user_api_key_cache=user_api_key_cache,+ )++ except ManagementProblem:+ raise+ except Exception: # noqa: BLE001 # a driver error answers as a problem document, not the OpenAI error shape+ verbose_proxy_logger.exception("/management/v1/users/bulk: Exception occurred")+ raise ManagementProblem(+ ProblemDetail(+ type=f"{PROBLEM_TYPE_BASE}internal-server-error",+ title="Internal server error",+ status=500,+ detail="Failed to create users.",+ )+ )+++++ "/users/bulk_delete",+ tags=["Internal User management"], # mutable-ok: FastAPI types `tags` as list[str], not Sequence+ dependencies=(Depends(user_api_key_auth), Depends(reject_unknown_query_params)),+ response_model=BulkDeleteUsersResponse,+)+@management_endpoint_wrapper+async def bulk_delete_users_action(+ data: BulkDeleteUserRequest,+ user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],+ litellm_changed_by: Annotated[+ str | None,+ Header(description="Who the caller is acting for; recorded on the audit log entries this call writes."),+ ] = None,+) -> BulkDeleteUsersResponse:+ """+ Delete up to 500 users in one call, taking each out of every team it belongs to.+ Same authorization as `/user/delete`: proxy admins may delete anyone, org admins+ only users inside organizations they administer. Unknown body fields are a 422.++ `data` holds one result per requested `user_id`, in request order. A row is+ `success: false` with an `error` when the id is unknown, repeated in the request,+ or outside the caller's scope. Rows that pass those checks are deleted together,+ in one transaction, so either all of them go or none does.++ Example curl:+ ```+ curl --location 'http://0.0.0.0:4000/management/v1/users/bulk_delete' \+ --header 'Authorization: Bearer sk-1234' \+ --header 'Content-Type: application/json' \+ --data '{"user_ids": ["user-1", "user-2"]}'+ ```+ """+ try:+ from litellm.proxy.proxy_server import (+ litellm_proxy_admin_name,+ prisma_client,+ proxy_logging_obj,+ user_api_key_cache,+ )++ if prisma_client is None:+ raise ManagementProblem(+ ProblemDetail(+ type=f"{PROBLEM_TYPE_BASE}database-not-connected",+ title="Database not connected",+ status=503,+ detail=CommonProxyErrors.db_not_connected_error.value,+ )+ )++ results: Final = await bulk_delete_users(+ data=data,+ user_api_key_dict=user_api_key_dict,+ prisma_client=prisma_client,+ user_api_key_cache=user_api_key_cache,+ proxy_logging_obj=proxy_logging_obj,+ litellm_proxy_admin_name=litellm_proxy_admin_name,+ litellm_changed_by=litellm_changed_by,+ )+ return BulkDeleteUsersResponse(data=results)++ except ManagementProblem:+ raise+ except Exception as e: # noqa: BLE001 # a driver error answers as a problem document, not the OpenAI error shape+ verbose_proxy_logger.exception(+ "litellm.proxy.management_endpoints.management_v1.users.bulk_delete_users_action(): Exception occured - %s",+ e,+ )+ raise ManagementProblem(+ ProblemDetail(+ type=f"{PROBLEM_TYPE_BASE}internal-server-error",+ title="Internal server error",+ status=500,+ detail="Failed to delete users.",+ )+ )diff --cc litellm/types/proxy/management_endpoints/internal_user_endpoints.pyindex 2b41893663d,3b4a2a417f2..43e3899d523--- a/litellm/types/proxy/management_endpoints/internal_user_endpoints.py+++ b/litellm/types/proxy/management_endpoints/internal_user_endpoints.py@@@ -9,10 -10,9 +10,12 @@@ from litellm.proxy._types importUpdateUserRequest,UpdateUserRequestNoUserIDorEmail,)+from litellm.types.proxy.management_endpoints.management_v1 import ResourceResponse++MAX_BULK_DELETE_USERS: Final = 500+ MAX_BULK_NEW_USERS: Final = 500+class InsensitiveContains(TypedDict):contains: ReadOnly[str]@@@ -88,23 -88,48 +91,70 @@@ class BulkUpdateUserResponse(BaseModel)failed_updates: int+class BulkDeleteUserRequest(BaseModel):+ """Body of `POST /management/v1/users/bulk_delete`."""++ model_config = ConfigDict(extra="forbid")++ user_ids: tuple[str, ...] = Field(min_length=1, max_length=MAX_BULK_DELETE_USERS)+++class UserDeleteResult(BaseModel):+ """Outcome for one requested user, in request order. `teams_removed` lists the teams the user left."""++ user_id: str+ user_email: str | None = None+ success: bool+ teams_removed: tuple[str, ...] = ()+ error: str | None = None+++class BulkDeleteUsersResponse(ResourceResponse[tuple[UserDeleteResult, ...]]):+ """`{data: [...]}` with one `UserDeleteResult` per requested user, in request order."""+++++ class BulkNewUserItem(NewUserRequest):+ """One row of `POST /management/v1/users/bulk`: the `/user/new` body, with keys opt-in and invite emails+ unsupported. Unknown fields are rejected, as on every `/management/v1` request body."""++ model_config = ConfigDict(extra="forbid", protected_namespaces=())++ auto_create_key: bool = False++ @field_validator("send_invite_email")+ @classmethod+ def reject_invite_email(cls, value: bool | None) -> bool | None:+ if value:+ raise ValueError("send_invite_email is not supported on /management/v1/users/bulk; invite users separately")+ return value+++ class BulkNewUserRequest(BaseModel):+ model_config = ConfigDict(extra="forbid")++ users: Sequence[BulkNewUserItem] = Field(min_length=1, max_length=MAX_BULK_NEW_USERS)+++ class UserCreateResult(BaseModel):+ """Outcome for one row of `POST /management/v1/users/bulk`. `teams` lists the teams the user was actually+ added to."""++ user_id: str | None = None+ user_email: str | None = None+ success: bool+ teams: tuple[str, ...] | None = None+ key: str | None = None+ error: str | None = None+++ class BulkNewUserMeta(BaseModel):+ total_requested: int+ created: int+ failed: int+++ class BulkNewUserResponse(BaseModel):+ """`data` holds one result per input row, in input order."""++ data: tuple[UserCreateResult, ...]+ meta: BulkNewUserMetadiff --cc ui/litellm-dashboard/src/lib/http/schema.d.tsindex b068565e697,a5b4671e45d..a8585bd3587--- a/ui/litellm-dashboard/src/lib/http/schema.d.ts+++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts@@@ -8470,71 -8499,54 +8499,119 @@@ export interface pathspatch?: never;trace?: never;};+ "/management/v1/teams/{team_id}/members/bulk_delete": {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ get?: never;+ put?: never;+ /**+ * Bulk Delete Team Members Action+ * @description Remove up to 500 members from one team in one call. Same authorization as+ * `/team/member_delete`: proxy admins, the team's admins, and admins of the team's+ * organization. Each member is named by exactly one of `user_id` or `user_email`;+ * unknown body fields are a 422 and an unknown team is a 404.+ *+ * `data` holds one result per requested member, in request order. A row is+ * `success: false` with an `error` when it names nobody on the team or repeats an+ * earlier row. The roster is rewritten once, under the team's advisory lock, so a+ * concurrent member_add is never overwritten from a stale read.+ *+ * Example curl:+ * ```+ * curl --location 'http://0.0.0.0:4000/management/v1/teams/team-1/members/bulk_delete' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{"members": [{"user_id": "user-1"}, {"user_email": "[email protected]"}]}'+ * ```+ */+ post: operations["bulk_delete_team_members_action_management_v1_teams__team_id__members_bulk_delete_post"];+ delete?: never;+ options?: never;+ head?: never;+ patch?: never;+ trace?: never;+ };+ "/management/v1/users/bulk": {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ get?: never;+ put?: never;+ /**+ * Bulk Create Users Route+ * @description Create up to 500 internal users in one request, optionally adding each one to teams.+ *+ * Every entry in `users` takes the same fields as `/user/new`, with two differences: `auto_create_key`+ * defaults to `false` (opt in per user to also get a virtual key back) and `send_invite_email` is not+ * supported. Unknown fields are rejected with 422. Rows are validated together (duplicate ids or emails,+ * unknown teams, roles the caller may not grant), inserted in one statement, and each referenced team is+ * written once for all of its new members.+ *+ * Rows fail independently: a bad row is reported in `data` with `success: false` and an `error`, and the+ * other rows still get created. A user that was created but could not be added to one of its teams is+ * reported with `success: true`, `teams` listing where they did land, and `error` naming the failed team.+ * The whole request is refused with a 403 problem document only if creating the valid rows would exceed+ * the license seat limit.+ *+ * Example curl:+ * ```+ * curl -X POST "http://localhost:4000/management/v1/users/bulk" \+ * -H "Content-Type: application/json" \+ * -H "Authorization: Bearer sk-1234" \+ * -d '{+ * "users": [+ * {"user_email": "[email protected]", "user_role": "internal_user", "teams": ["team-1"]},+ * {"user_email": "[email protected]", "user_role": "internal_user", "auto_create_key": true}+ * ]+ * }'+ * ```+ *+ * Returns `data` (one entry per input row, in order, with `user_id`, `user_email`, `success`, `teams`,+ * `key`, `error`) and `meta` with `total_requested`, `created` and `failed`.+ */+ post: operations["bulk_create_users_route_management_v1_users_bulk_post"];+ delete?: never;+ options?: never;+ head?: never;+ patch?: never;+ trace?: never;+ };+ "/management/v1/users/bulk_delete": {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ get?: never;+ put?: never;+ /**+ * Bulk Delete Users Action+ * @description Delete up to 500 users in one call, taking each out of every team it belongs to.+ * Same authorization as `/user/delete`: proxy admins may delete anyone, org admins+ * only users inside organizations they administer. Unknown body fields are a 422.+ *+ * `data` holds one result per requested `user_id`, in request order. A row is+ * `success: false` with an `error` when the id is unknown, repeated in the request,+ * or outside the caller's scope. Rows that pass those checks are deleted together,+ * in one transaction, so either all of them go or none does.+ *+ * Example curl:+ * ```+ * curl --location 'http://0.0.0.0:4000/management/v1/users/bulk_delete' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{"user_ids": ["user-1", "user-2"]}'+ * ```+ */+ post: operations["bulk_delete_users_action_management_v1_users_bulk_delete_post"];+ delete?: never;+ options?: never;+ head?: never;+ patch?: never;+ trace?: never;+ };"/mcp": {parameters: {query?: never;@@@ -24568,22 -24580,156 +24645,172 @@@ export interface components/** Budgets */budgets: string[];};+ /**+ * BulkDeleteUserRequest+ * @description Body of `POST /management/v1/users/bulk_delete`.+ */+ BulkDeleteUserRequest: {+ /** User Ids */+ user_ids: string[];+ };+ /**+ * BulkDeleteUsersResponse+ * @description `{data: [...]}` with one `UserDeleteResult` per requested user, in request order.+ */+ BulkDeleteUsersResponse: {+ /** Data */+ data: components["schemas"]["UserDeleteResult"][];+ };+ /**+ * BulkNewUserItem+ * @description One row of `POST /management/v1/users/bulk`: the `/user/new` body, with keys opt-in and invite emails+ * unsupported. Unknown fields are rejected, as on every `/management/v1` request body.+ */+ BulkNewUserItem: {+ /** Agent Id */+ agent_id?: string | null;+ /**+ * Aliases+ * @default {}+ */+ aliases: {+ [key: string]: unknown;+ } | null;+ /**+ * Allowed Cache Controls+ * @default []+ */+ allowed_cache_controls: unknown[] | null;+ /**+ * Auto Create Key+ * @default false+ */+ auto_create_key: boolean;+ /** Blocked */+ blocked?: boolean | null;+ /** Budget Duration */+ budget_duration?: string | null;+ /** Budget Fallbacks */+ budget_fallbacks?: {+ [key: string]: string[];+ } | null;+ /** Budget Limits */+ budget_limits?: components["schemas"]["BudgetLimitEntry"][] | null;+ /**+ * Config+ * @default {}+ */+ config: {+ [key: string]: unknown;+ } | null;+ /** Duration */+ duration?: string | null;+ /** Guardrails */+ guardrails?: string[] | null;+ /** Key Alias */+ key_alias?: string | null;+ /** Max Budget */+ max_budget?: number | null;+ /** Max Parallel Requests */+ max_parallel_requests?: number | null;+ /** Mcp Rpm Limit */+ mcp_rpm_limit?: {+ [key: string]: number;+ } | null;+ /**+ * Metadata+ * @default {}+ */+ metadata: {+ [key: string]: unknown;+ } | null;+ /**+ * Model Max Budget+ * @default {}+ */+ model_max_budget: {+ [key: string]: unknown;+ } | null;+ /** Model Rpm Limit */+ model_rpm_limit?: {+ [key: string]: unknown;+ } | null;+ /** Model Tpm Limit */+ model_tpm_limit?: {+ [key: string]: unknown;+ } | null;+ /**+ * Models+ * @default []+ */+ models: unknown[] | null;+ object_permission?: components["schemas"]["LiteLLM_ObjectPermissionBase"] | null;+ /** Organizations */+ organizations?: string[] | null;+ /**+ * Permissions+ * @default {}+ */+ permissions: {+ [key: string]: unknown;+ } | null;+ /** Policies */+ policies?: string[] | null;+ /** Prompts */+ prompts?: string[] | null;+ /** Rpm Limit */+ rpm_limit?: number | null;+ /** Send Invite Email */+ send_invite_email?: boolean | null;+ /**+ * Spend+ * @default 0+ */+ spend: number | null;+ /** Sso User Id */+ sso_user_id?: string | null;+ /** Tag Rpm Limit */+ tag_rpm_limit?: {+ [key: string]: number;+ } | null;+ /** Team Id */+ team_id?: string | null;+ /** Teams */+ teams?: string[] | components["schemas"]["NewUserRequestTeam"][] | null;+ /** Tpm Limit */+ tpm_limit?: number | null;+ /** User Alias */+ user_alias?: string | null;+ /** User Email */+ user_email?: string | null;+ /** User Id */+ user_id?: string | null;+ /** User Role */+ user_role?: ("proxy_admin" | "proxy_admin_viewer" | "internal_user" | "internal_user_viewer") | null;+ };+ /** BulkNewUserMeta */+ BulkNewUserMeta: {+ /** Created */+ created: number;+ /** Failed */+ failed: number;+ /** Total Requested */+ total_requested: number;+ };+ /** BulkNewUserRequest */+ BulkNewUserRequest: {+ /** Users */+ users: components["schemas"]["BulkNewUserItem"][];+ };+ /**+ * BulkNewUserResponse+ * @description `data` holds one result per input row, in input order.+ */+ BulkNewUserResponse: {+ /** Data */+ data: components["schemas"]["UserCreateResult"][];+ meta: components["schemas"]["BulkNewUserMeta"];+ };/*** BulkTeamMemberAddRequest* @description Request for bulk team member addition@@@ -35301,7 -35541,7 +35638,7 @@@default_model?: string | null;/*** Deployment Affinity-- * @description When True and a session_id is resolvable on the request, pin the deployment chosen inside each routed model group and reuse it whenever the session returns to that group, without pinning which group the session routes to. Independent of session_affinity, which pins the model group instead (and always carries this deployment pin with it): with session_affinity off, every turn is still classified on its own merits while a session that escalates to a stronger tier and comes back still lands on the deployment it used before, which is what keeps a provider prompt cache warm. Pins are held per model group, so switching tiers does not disturb the pin left behind in the previous group. On by default because re-shuffling a conversation across deployments of the same model discards that cache for no benefit; set False to keep every turn load-balanced across the group, which is what a deployment set with tight per-deployment rate limits wants. Inert when no session_id is resolvable, since there is nothing to key a pin on, and suppressed when plugins are configured, for the same reason session_affinity is.++ * @description When True and a client session_id is resolvable, reuse the session's chosen model for each classified tier and its deployment within each model group. With session_affinity off, every turn is still classified: moving to another tier leaves the previous tier's model pin intact for a later return. Pins yield to current candidate, context, modality, and availability constraints. Adaptive selection chooses the initial model from its eligible pool, then reuses that choice per tier. This reduces avoidable provider prompt-cache misses; it does not guarantee cache hits. Set False to select models and load-balance deployments on every turn, unless session_affinity or user_turn classification requires a pin. Inert without a client session_id and suppressed when plugins are configured.* @default true*/deployment_affinity: boolean;@@@ -35445,7 -35685,7 +35782,7 @@@session_affinity: boolean;/*** Session Affinity Ttl Seconds-- * @description TTL for the session affinity pin; refreshed on every cache hit. Bounds both the session_affinity model pin and the deployment_affinity deployment pin, so it measures idle time for the session's routing decisions rather than total session length++ * @description TTL for the session affinity pin; refreshed on every cache hit. Bounds both the session_affinity model pin and the deployment_affinity per-tier model and deployment pins, so it measures idle time for the session's routing decisions rather than total session length* @default 3600*/session_affinity_ttl_seconds: number;@@@ -39469,25 -39689,25 +39810,44 @@@*/severity: "info" | "warning" | "error";};+ /**+ * UserCreateResult+ * @description Outcome for one row of `POST /management/v1/users/bulk`. `teams` lists the teams the user was actually+ * added to.+ */+ UserCreateResult: {+ /** Error */+ error?: string | null;+ /** Key */+ key?: string | null;+ /** Success */+ success: boolean;+ /** Teams */+ teams?: string[] | null;+ /** User Email */+ user_email?: string | null;+ /** User Id */+ user_id?: string | null;+ };+ /**+ * UserDeleteResult+ * @description Outcome for one requested user, in request order. `teams_removed` lists the teams the user left.+ */+ UserDeleteResult: {+ /** Error */+ error?: string | null;+ /** Success */+ success: boolean;+ /**+ * Teams Removed+ * @default []+ */+ teams_removed: string[];+ /** User Email */+ user_email?: string | null;+ /** User Id */+ user_id: string;+ };/*** UserHeaderMapping* @description Map an incoming HTTP header to a LiteLLM user role.@@@ -51260,33 -51519,31 +51659,66 @@@ export interface operations};};};+ bulk_delete_team_members_action_management_v1_teams__team_id__members_bulk_delete_post: {+ parameters: {+ query?: never;+ header?: never;+ path: {+ team_id: string;+ };+ cookie?: never;+ };+ requestBody: {+ content: {+ "application/json": components["schemas"]["BulkTeamMemberDeleteRequest"];+ };+ };+ responses: {+ /** @description Successful Response */+ 200: {+ headers: {+ [name: string]: unknown;+ };+ content: {+ "application/json": components["schemas"]["BulkTeamMemberDeleteResponse"];+ };+ };+ /** @description Validation Error */+ 422: {+ headers: {++ [name: string]: unknown;++ };++ content: {++ "application/json": components["schemas"]["HTTPValidationError"];++ };++ };++ };++ };+ bulk_create_users_route_management_v1_users_bulk_post: {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ requestBody: {+ content: {+ "application/json": components["schemas"]["BulkNewUserRequest"];+ };+ };+ responses: {+ /** @description Successful Response */+ 200: {+ headers: {+ [name: string]: unknown;+ };+ content: {+ "application/json": components["schemas"]["BulkNewUserResponse"];+ };+ };+ /** @description Validation Error */+ 422: {+ headers: {[name: string]: unknown;};content: {