﻿# LiteLLM adds per-model queued batch-token limits at project scope

Test mixed-model batch admission and terminal-state refunds per project; queued-token capacity is distinct from token-per-minute throughput and monetary spend.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-agent-litellm-project-model-batch-queue-cap/
Language: en

LiteLLM v1.111.0-dev.4 adds project-level model_batch_enqueued_token_limit controls. Published on November 15 as a prerelease, the feature can separate applications sharing a team while accounting for the models represented in a batch. This is a queued-work limit, so admission, terminal-state release and ordinary spend budgets should be evaluated as different controls.

## Project identity should survive changing credentials

Create two synthetic applications under one team with separate project identities. Submit queued work using the credential types the service supports, including refreshed tokens where relevant. Assert one application’s cap cannot be bypassed merely by obtaining a new caller credential. Keep team and key limits as separate observations. The feature’s purpose is a project boundary, so a test tied to one static key would miss the intended scope.

## Mixed batches need per-row attribution

Build a synthetic batch containing rows for two models and a row that relies on the batch route’s model. Compute expected queued tokens for each limited model outside the gateway. Compare admission and reported scope with those expectations. A single total can wrongly charge one model for another’s rows, so the fixture should make the two contributions deliberately different and retain each row’s selected model identity.

## Completion and cancellation must release once

Move a harmless batch to completion and another to cancellation, then verify queued capacity becomes available again. Replay a terminal-state observation and confirm it does not release the same reservation twice. These are proposed application checks around the documented refund lifecycle. Keep failed admission separate from admitted work: a rejected batch should not create a reservation that later needs manual cleanup or blocks unrelated projects indefinitely.

## Only the intended administrator changes the ceiling

Attempt to raise or remove the synthetic project limit through the roles available to application teams and through the authorized administrative path. Inspect effective metadata afterward. A cap that callers can silently lift is not a useful isolation mechanism. The prerelease adds one queue-control dimension; it does not guarantee provider scheduling fairness or replace spend budgets. Report scope, per-model counts, reservation lifetime and authorized configuration together.

## Sources

- [LiteLLM v1.111.0-dev.4 prerelease notes](https://github.com/BerriAI/litellm/releases/tag/v1.111.0-dev.4)
- [LiteLLM implementation and review #51608](https://github.com/BerriAI/litellm/pull/51608)

## Related reading

- [LiteLLM budgets: periods, shared limits and overrun tests](/journal/litellm-budget-reset/)
- [LiteLLM virtual keys: separate access for each application](/journal/litellm-virtual-key-scopes/)
