Multi-Tenant AI Inference: Designing Fair Queues and GPU Admission

Multi-Tenant AI Inference: Designing Fair Queues and GPU Admission
Multi-Tenant AI Inference: Designing Fair Queues and GPU Admission

A shared large-language-model serving fleet is economical only when one application's traffic cannot silently consume the capacity promised to another. That problem is harder than placing a rate limiter in front of a GPU. A request can contain a short prompt or an enormous context; it can generate a sentence or a long response; it can benefit from cached prefixes or force expensive prefill work. Ten requests are not necessarily ten comparable units of service.

Fair queuing is the set of policies that decides whose work gets admitted, whose requests wait, and how shared capacity is divided when demand exceeds supply. For multi-tenant inference, the most useful design separates tenant policy at the gateway from token execution inside the model engine. Both influence latency, but they solve different problems.

Define the unit of fairness before choosing a scheduler

The simplest fairness rule—serve requests in arrival order—has an attractive property: operators can explain it. But first-come, first-served ordering does not guarantee that organizations receive comparable GPU service. A tenant sending long-context requests can occupy substantially more computation and cache than one sending small interactive requests. A system that assigns identical priority to both may be fair by request count while unfair by resource consumption.

The OSDI 2024 paper Fairness in Serving Large Language Models develops this distinction and proposes Virtual Token Counter (VTC), which accounts for service at token granularity. That is a research result and algorithmic reference, not evidence that every production server implements VTC or provides its guarantees.

An operator should write down its own fairness contract. Common possibilities include equal shares per organization, shares weighted by paid service tier, minimum reserved capacity with opportunistic borrowing, or latency protection for a small interactive pool while batch jobs use spare compute. These are policy choices. None is automatically implied by the presence of a priority field on an API request.

There are also different notions of isolation. Throughput fairness asks whether active tenants receive comparable productive service over an interval. Latency isolation asks whether a burst from one tenant damages another's time to first token or time per output token. Budget isolation prevents one customer from creating unbounded spend. Security isolation ensures tenant identity, private data and cache policy are respected. These should be independently tested.

Follow one request through the system

A defensible architecture makes admission and accounting explicit:

authenticated client
       |
       v
tenant identity + policy lookup
       |
       v
request validation and token estimate
       |
       v
per-tenant quotas, bounded queue, fair selector
       |
       v
KV-aware model-pool router
       |
       v
inference engine (prefill + decode)
       |
       v
streamed response + actual usage reconciliation

At the ingress, authenticate the caller and map its credential to a server-controlled tenant identifier. A client-supplied tenant header is not an authorization boundary. Normalize the requested model, priority class, maximum output length, timeout and optional cancellation token. Reject unsupported combinations before they occupy scarce queue memory.

At the admission layer, reserve a bounded amount of anticipated work and establish an independent concurrency cap. The estimate may combine uncached input tokens, expected or capped output tokens, model-specific weights and a safety margin. Estimates should be reconciled against actual metered service rather than treated as perfect predictions. Prefix-cache hits and speculative decoding complicate a direct mapping from tokens to GPU seconds.

The router then selects an eligible worker, considering model compatibility, live load, memory pressure and possible KV-cache reuse. The engine is free to exploit continuous batching and local scheduling. A well-designed gateway does not assume that enqueueing a request means it started executing immediately.

The llm-d architecture documents a real design in which request queuing, routing, flow control and backend serving are distinct responsibilities. It is a useful implementation reference, not a universal template.

Separate priority from tenant fairness

Priority answers which class of work should be protected. Fairness answers how tenants within a class share the resource. Combining them into one integer usually creates a policy that is difficult to audit.

Imagine three tenants using one model pool. Two run interactive chat and one runs large asynchronous summarization jobs. The interactive traffic belongs to a higher-priority class; within that class, each active tenant should receive a defined share. The batch tenant can receive spare capacity but should not force interactive requests to wait behind its entire backlog. This is an illustrative workload, not a published performance result.

One practical design is hierarchical scheduling: select an eligible service class subject to starvation controls, then select a tenant within that class using round robin, deficit round robin, or a token-accounting variant. Per-tenant limits still apply even when a priority class has unused capacity. If batch traffic must eventually make progress, provide it a capacity floor or aging rule instead of assuming lower priority alone is safe.

The llm-d flow-control write-up from August 2026 describes priority-aware admission together with separate fairness queues. Its published demonstrations are evidence of a particular stack's reported behavior under its tested conditions; they do not prove the same results for every model, deployment or burst distribution.

Implement weighted deficit accounting

A gateway can implement a first useful fairness policy without attempting to predict every GPU kernel. Maintain one FIFO of waiting requests per tenant, a weight for that tenant, and a deficit or virtual-service counter. The scheduler considers only tenants with work, sufficient quota and eligible resources.

In a weighted deficit design, each eligible tenant accumulates a configured quantum of service credit. When a request is admitted, the scheduler debits an estimated cost. After completion, actual cost updates the tenant's accounting position. Large requests may need segmentation or separate admission treatment; otherwise a single expensive request can exceed practical deficit limits and distort latency.

The following is conceptual pseudocode, not a drop-in implementation:

while worker_capacity_available:
    class = choose_eligible_service_class()
    tenant = choose_backlogged_tenant_by_weighted_deficit(class)
    request = peek(tenant.queue)
    estimated = estimate_service(request)

    if not tenant.within_limits(estimated):
        defer_or_reject(request)
        continue

    reserve(tenant, estimated)
    dequeue(request)
    dispatch(request)

on_completion(request, actual_usage):
    reconcile_reservation(request, actual_usage)
    record_latency_and_service(request)

The algorithm needs safeguards for negative credit, abandoned requests, cancellation, retransmission, stale worker state and a tenant that goes idle and later returns. In particular, allowing an idle tenant to accumulate unlimited credit creates an incentive to bank a future burst. The VTC work addresses this fairness problem with a virtual-counter approach; the design should be understood before borrowing the name or its guarantees.

For an initial deployment, deficit round robin with an explicitly documented cost estimate is often easier to reason about than a custom approximation claiming strict proportional GPU fairness. Measure whether the approximation works for the model mixes actually served.

Bounded queues are a reliability feature

A fair scheduler cannot save a system that admits unlimited waiting work. Queue growth consumes memory, amplifies timeouts, extends tail latency and can make clients retry before their original requests even begin. A gateway should define global and per-tenant maximum queued requests, outstanding estimated tokens, active generations, and queue-wait deadlines.

When those bounds are reached, return a documented overload response rather than pretending that the request has been accepted for service. Retry advice must include jitter and a bounded retry budget. For asynchronous workloads, a durable job queue and a status endpoint can be more honest than holding a synchronous HTTP connection open indefinitely.

Queue time also belongs in the user-facing service-level objective. A system might report fast engine execution while users experience long pre-engine delays. The vLLM production metrics include engine queue time, time to first token and time per output token, but a separate gateway queue requires its own measurements to obtain true end-to-end latency.

Backpressure must be applied at the earliest trustworthy boundary. Limiting only the worker's active sequence count does not stop upstream queues from becoming enormous. Conversely, lowering a gateway limit too aggressively can reduce utilization in bursty deployments. The threshold is an operational tuning decision that should be validated under realistic arrival patterns.

Continuous batching changes what fairness can mean

LLM inference is not a single indivisible job. Prefill processes the input context, while decode incrementally generates output tokens. Continuous batching allows requests to join and leave active execution over time. That improves opportunities to share hardware but means a gateway's admission order does not map neatly to a sequential list of completed requests.

The vLLM scheduler configuration documents first-come-first-served and request-priority scheduling policies. Neither option should be mistaken for an end-to-end per-tenant weighted fair-share contract. A local engine sees only the requests routed to it, and backend scheduling policy may change how requests progress after admission.

KV-cache pressure is another independent axis. A long request may keep substantial cache state alive, and preemption can impose recomputation or restore costs. A fair gateway needs feedback about worker saturation; static estimates based solely on request count cannot observe this pressure. Worker selection that ignores cache locality can also destroy reuse and increase effective work, while cache-only routing can concentrate traffic on an overloaded replica.

NVIDIA Dynamo's scheduling documentation distinguishes router-level decisions, backend priority handling and KV-cache policy. The separation is valuable because enabling one layer does not guarantee the others are configured or enforce the same priority semantics.

Coordinate fairness across replicas

A per-process fairness queue can be locally correct and globally misleading. If a heavy tenant happens to route mostly to one replica while a quieter tenant uses another, each scheduler sees an incomplete picture. Sticky sessions help preserve cache affinity but can concentrate traffic. Round-robin routing improves distribution in some cases while sacrificing locality in others.

There are three general choices. A single logical admission controller provides a coherent accounting view but needs high availability and careful scaling. Distributed controllers with shared counters trade coordination cost for a stronger fleet-wide view; stale counters and failure handling must be specified. Independent replica-local fairness is simpler but should be advertised as local, not global, proportional fairness.

A practical hybrid maintains authoritative tenant quota and outstanding-work accounting centrally, while each router makes bounded placement decisions from fresh worker telemetry. Distributed reservations need expiration and reconciliation so a crashed router does not permanently consume a tenant's budget. Use idempotent request identifiers where clients or proxies may retry.

Global rate limits are not the same as global fair scheduling. Even a perfectly consistent token bucket can allow a tenant to occupy all available concurrency for a short period. Combine consumption limits with admission control and concurrency isolation.

Bring the GPU scheduler and Kubernetes scheduler into alignment

There are two distinct scheduling timescales. Kubernetes allocates or admits workloads and devices; the inference gateway allocates requests to already-running servers. Configuring resource quotas in one does not automatically implement fairness in the other.

Kueue's fair-sharing mechanisms concern workload admission, historical resource usage and fair borrowing between queues or cohorts. They are relevant when teams compete for accelerator capacity to run different services, batch jobs or training workloads. They do not directly determine which individual prompt a vLLM replica processes next.

Where GPU pools are shared across services, choose how reserved capacity, elastic borrowing and preemption interact. Preempting a batch pod may eventually free resources, but that is not equivalent to preempting a single decode request. GPU device allocation and the user's request latency have different response times, and system design must reflect that.

Dynamic resource allocation can express more detailed device requirements where the underlying cluster and drivers support it; Kueue's DRA documentation describes related admission and quota behavior. Feature compatibility should be checked against the exact Kubernetes and Kueue versions deployed.

Account for costs without fabricating precision

Token counts are a useful billing abstraction but imperfect proxies for GPU effort. Input and output tokens differ in execution pattern; long contexts increase memory demand; cache reuse may reduce prefill work; and two model families can have different resource profiles. A fair-charge estimate should be versioned, observable and explained to platform customers.

One workable approach keeps three separate ledgers: a quota ledger for contractual allowance, a fairness ledger for scheduling service, and a cost ledger for internal GPU economics. They may share raw usage events without using identical weights. For example, a premium support tier can receive greater scheduling weight while its consumption is still billed according to explicit price units.

Track estimated and actual input tokens, output tokens, queue wait, generation time, model, worker class, cache information where supported, cancellation reason and retry identifier. Avoid high-cardinality tenant IDs in unbounded Prometheus labels; aggregate with suitable limits and use logs or traces for request-level diagnostics. Attribute gateway waiting separately from backend waiting, and document whether streaming TTFT starts at ingress or at engine admission.

There is no credible universal multiplier between tokens and GPU-seconds across models. Calibrate weights using observed service traces and revisit them after model, quantization, batching or accelerator changes.

Test adversarial workloads, not average requests

A fairness experiment should vary at least tenant count, workload class, input length, maximum output, burst shape, cache reuse and concurrency. The simplest failure case is one tenant flooding the shared queue while another sends sparse interactive requests. The second is two tenants with equal request rates but dramatically different token demand. The third is a priority tenant arriving after all workers are already busy.

Measure per-tenant admitted service, completed work, rejected and timed-out work, end-to-end latency distributions, gateway queue time, engine queue time and cache pressure. Report both idle and saturated regimes. A scheduler can appear perfectly fair when capacity exceeds demand because every request is served quickly; the relevant policy behavior emerges during contention.

The benchmark should compare a plain FIFO baseline against at least one bounded, tenant-aware queue and one weighted or priority-aware variant. Hold model, hardware, sampling settings and traffic traces constant. Examine whether better tail latency for protected users comes with lower batch throughput or starvation elsewhere. Report these as trade-offs, not universal victories.

A documented 2026 example is the Red Hat llm-d flow-control evaluation, which includes scenarios separating priority traffic from lower-priority backlog. It is useful for study and reproduction, but its graphs do not substitute for testing the local fleet.

Operational failure modes that deserve explicit policy

Tenant spoofing: Trust only authenticated tenancy established at ingress. Derive scheduling identifiers from server-side identity and policy, not arbitrary headers forwarded from the client.

Retry amplification: Enforce idempotency where appropriate, return clear admission failures, and bound retry rates. A timeout does not establish that the original request stopped running.

Priority abuse: Make priority entitlements server-controlled. If clients can elevate themselves without authorization, priority becomes an attack surface rather than an SLO mechanism.

Starvation: A strict top-priority-first scheduler can indefinitely postpone background work under sustained premium load. Capacity floors, aging and explicit lower-tier objectives are alternatives with different costs.

Reservation leakage: Reconcile usage and release work reservations on cancellation, completion, worker death and queue timeout. A reservation must have an expiry strategy.

Inconsistent caches: Reusing prefixes is an optimization, not permission to leak tenant-private content. Define cache partitioning and isolation separately from routing affinity.

Monitoring blindness: A low fleet-average TTFT can coexist with one tenant receiving poor service. Assess distributions and fairness by tenant class, and inspect detailed traces for selected complaints.

These problems become more consequential as agentic systems fan out into concurrent subrequests. An application may have a single customer-visible operation but create many independently scheduled model calls. Defining fairness around the authenticated customer or workflow, rather than raw request count, prevents fan-out from accidentally acting as an entitlement multiplier.

A rollout sequence for engineering teams

Start by measuring the current system without changing scheduling. Instrument tenant identity, admission outcome, queue stages, token volumes and cancellation. Establish realistic SLOs for interactive and asynchronous requests. Determine which existing bottlenecks are caused by GPU saturation, cache pressure, routing imbalance or a non-GPU dependency.

Next, introduce bounded per-tenant admission and concurrency ceilings. Test failure and retry semantics before enabling weighted scheduling. Add service classes only when an actual product contract distinguishes them. Then compare a simple per-tenant round robin against cost-aware deficit scheduling under recorded traffic traces.

After that, decide whether global coordination is necessary. For a single model pool, one logical gateway may be sufficient. For a multi-region or multi-model fleet, independent policies per region and model may be more tractable than pretending all accelerators provide equivalent service. Make tenant quotas and scheduler state resilient to restarts.

Finally, stage overload drills and fault injection before declaring success. Kill a router after it reserves work; disconnect a streaming client; remove a worker during decode; send a request with an unexpectedly large context; and create a sustained premium-class burst. Confirm that resources recover, queued requests expire, lower-priority work receives the promised minimum service, and no tenant can bypass policy.

Fair multi-tenant inference is not a switch on a model server. It is an enforceable contract spanning authentication, admission, routing, runtime scheduling, telemetry and economics. The right outcome is not maximal fairness in the abstract. It is predictable behavior under contention, with explicitly measured costs for the protections provided.