Serving systems6 min read

NVIDIA Triton Inference Server: architecture and serving

Production AI applications rarely serve a single standalone language model. Most traffic passes through tokenizers, embedding models, vision encoders, rerankers, guardrails, and LLMs. NVIDIA Triton Inference Server unifies those heterogeneous runtimes behind one KServe v2 control plane, dynamic batcher, and multi-model pipeline scheduler.

Conceptual illustration of a multi-bay serving terminal uniting three distinct backend modules under one gateway.
Triton unifies TensorRT, ONNX, Python, and LLM backends behind one KServe v2 gateway, dynamic batcher, and pipeline scheduler.

What NVIDIA Triton Inference Server solves in production

Teams serving only one OpenAI-compatible text model often start directly with vLLM or SGLang. As soon as a stack adds an ONNX reranker, a TensorRT vision encoder, custom Python preprocessing, and strict per-model GPU concurrency limits, maintaining separate custom FastAPI containers creates network hops, serialization overhead, and inconsistent telemetry.

Choosing between standalone LLM engines, classic Triton backends, and Triton-hosted LLM engines.
Serving setupBest workload fitWho owns batching and scheduling
Standalone vLLM / SGLangSingle-model OpenAI-compatible chat and completion APIsEngine continuous batcher and paged KV manager
Triton (TensorRT / ONNX / Python)Embeddings, vision, audio, classifiers, and multi-stage pipelinesTriton dynamic batcher, sequence batcher, and instance groups
Triton + vLLM / TensorRT-LLM backendMixed pipelines combining LLMs with non-LLM models under KServe v2LLM backend owns continuous batching; Triton acts as decoupled gateway

Per Triton’s architecture guide, the server separates client protocol handling from model-specific execution backends. One Triton process exposes HTTP/REST, gRPC, and C API endpoints implementing the KServe v2 inference protocol while dispatching tensors to TensorRT, ONNX Runtime, PyTorch, Python, vLLM, or TensorRT-LLM workers.

Model repositories, config.pbtxt, and dynamic batching

Every deployment starts with a structured model repository directory where each model owns a folder containing config.pbtxt and numbered version subdirectories (1/, 2/). The Triton model configuration declares tensor shapes, data types, execution placement, and scheduling policy:

  • `instance_group`: Controls how many independent execution instances of a model load on each GPU (KIND_GPU) or CPU (KIND_CPU), letting multiple CUDA streams run concurrently up to VRAM and compute limits.
  • `dynamic_batching`: Collects individual stateless requests (such as embedding or classification calls) into larger GPU batches using preferred_batch_size and a bounded max_queue_delay_microseconds window.
  • `sequence_batching`: Routes stateful multi-step requests sharing a correlation ID to the same model slot so recurrent state or streaming audio chunks stay ordered.
  • `rate_limiter`: Bounds concurrent model executions across shared GPUs so high-priority models or large batches do not starve neighboring endpoints.

On the wire, Triton accepts standardized KServe v2 inference requests over HTTP or gRPC. Here is a valid minimal JSON request for a batched text-embedding model:

Minimal KServe v2 HTTP inference payload
{
  "id": "req-4091",
  "inputs": [
    {
      "name": "input_ids",
      "shape": [1, 4],
      "datatype": "INT64",
      "data": [[101, 2054, 2003, 102]]
    },
    {
      "name": "attention_mask",
      "shape": [1, 4],
      "datatype": "INT64",
      "data": [[1, 1, 1, 1]]
    }
  ]
}
Visual explanation

How a request moves through NVIDIA Triton Inference Server

  1. KServe v2 endpointAccept HTTP/gRPC tensors or binary shared-memory handles.
  2. Scheduler & batcherGroup stateless calls or route sequences and ensembles.
  3. Backend instancesRun TensorRT, ONNX, Python BLS, or decoupled vLLM/TRT-LLM.
  4. Response or streamReturn batched outputs or emit async decoupled token chunks.
Triton decouples transport and scheduling from backend execution. Stateless models use dynamic batching; LLM backends disable Triton batching and stream tokens in decoupled mode.

Model Triton dynamic batching latency vs. GPU utilization

Dynamic batching solves a classic small-request problem: launching a GPU kernel on batch size 1 wastes most of the step on launch overhead and weight loads. Setting max_queue_delay_microseconds holds the first waiting request briefly so concurrent arrivals coalesce into one efficient batch. Run this standalone discrete-event simulator in Python 3 to see why zero delay can actually hurt both p95 latency and GPU headroom under bursty arrivals.

Run with Python 3; no GPU or packages required
import math, random

# Discrete-event simulation of Triton dynamic batching on a 4-request burst workload
rng = random.Random(7)
arrivals = []
t = 0.0
for i in range(800):
    t += 200.0 if (i % 4) else 3400.0  # 4-request burst every 4 ms (~1000 req/s)
    arrivals.append(t + rng.uniform(0.0, 50.0))
arrivals.sort()

def simulate(max_delay_us, max_batch=16):
    idx, gpu_free, busy_us = 0, 0.0, 0.0
    queue = []
    latencies, waits, batches = [], [], []
    while idx < len(arrivals) or queue:
        while idx < len(arrivals) and arrivals[idx] <= gpu_free:
            queue.append(arrivals[idx])
            idx += 1
        if not queue:
            gpu_free = arrivals[idx]
            continue
        batch_start = gpu_free
        deadline = queue[0] + max_delay_us
        while len(queue) < max_batch and idx < len(arrivals) and arrivals[idx] <= deadline:
            batch_start = max(batch_start, arrivals[idx])
            queue.append(arrivals[idx])
            idx += 1
        batch = queue[:max_batch]
        queue = queue[max_batch:]
        exec_us = 2200.0 + 300.0 * len(batch)  # fixed launch overhead + per-item compute
        busy_us += exec_us
        finish = batch_start + exec_us
        gpu_free = finish
        batches.append(len(batch))
        for arr in batch:
            waits.append((batch_start - arr) / 1000.0)
            latencies.append((finish - arr) / 1000.0)
    latencies.sort()
    p95 = latencies[math.ceil(0.95 * len(latencies)) - 1]
    util = 100.0 * busy_us / gpu_free
    return sum(batches) / len(batches), sum(waits) / len(waits), p95, util

print("Triton dynamic batching simulation (800 requests, max_batch_size=16):")
for delay_us in (0, 2000, 8000):
    avg_b, avg_w, p95_ms, util = simulate(delay_us)
    print(f"  max_queue_delay={delay_us:4d} us -> avg_batch={avg_b:4.1f} | wait={avg_w:4.2f} ms | p95={p95_ms:5.2f} ms | GPU busy={util:4.1f}%")
Calculated output
Triton dynamic batching simulation (800 requests, max_batch_size=16):
  max_queue_delay=   0 us -> avg_batch= 3.1 | wait=1.18 ms | p95= 5.57 ms | GPU busy=99.6%
  max_queue_delay=2000 us -> avg_batch= 4.0 | wait=0.30 ms | p95= 4.02 ms | GPU busy=84.6%
  max_queue_delay=8000 us -> avg_batch= 8.5 | wait=3.84 ms | p95=12.88 ms | GPU busy=55.3%

At 0 us, the server fires immediately on the first arriving item, leaving the remaining three burst items waiting behind a 2.5 ms kernel and saturating GPU busy time at 99.6%. Giving the batcher a 2,000 us (2 ms) coalescing window lets all four burst requests execute together, lowering both p95 latency (4.02 ms) and GPU occupancy (84.6%). Pushing the window to 8,000 us drops GPU occupancy to 55.3% while trading off tail latency (12.88 ms).

Ensembles, Business Logic Scripting, and decoupled LLM backends

Real inference workflows chain multiple models. Triton provides two orchestration primitives inside the server process so intermediate tensors stay in GPU or shared memory instead of round-tripping over HTTP:

  • Static ensembles (`platform: "ensemble"`): Declare a directed acyclic graph in config.pbtxt connecting step outputs to downstream inputs (for example, tokenizer -> embedding model -> classifier). See the Triton ensemble models guide.
  • Business Logic Scripting (BLS): Run arbitrary Python control flow inside a Python-backend model to issue asynchronous pb_utils.InferenceRequest calls, enabling conditional branching, guardrails, retries, and early exits.
  • Decoupled transaction mode for LLMs: Unlike single-response models, an autoregressive LLM produces zero or many streamed chunks per request. Decoupled models let a backend such as the Triton vLLM backend stream tokens asynchronously while its own internal scheduler runs continuous batching and paged KV management.

Four Triton configuration mistakes to catch before launch

  1. Enabling Triton dynamic batching in front of vLLM or TensorRT-LLM. LLM backends use iteration-level continuous batching internally. Always configure max_batch_size: 0 with model_transaction_policy { decoupled: True } on LLM backends so Triton forwards requests directly without stalling on a request-level batch window.
  2. Oversubscribing GPU `instance_group` counts. Spawning four GPU instances of a large model rarely quadruples throughput; it multiplies resident weight memory and causes SM context thrashing. Measure VRAM first in our GPU memory calculator and validate utilization versus cost in the inference cost calculator.
  3. Skipping `model_warmup` in `config.pbtxt`. TensorRT plan initialization, CUDA graph capture, and lazy kernel JIT compilation make the first live request seconds slower. Define warmup samples in config.pbtxt so Kubernetes readiness probes turn green only after kernels are warm.
  4. Sending large tensors as HTTP JSON arrays. Serializing float embeddings or image tensors as text JSON blows up CPU usage and payload size. Switch high-throughput paths to gRPC binary payloads, KServe binary HTTP extensions, or CUDA shared memory, and cross-check engine model support in the compatibility directory.

NVIDIA Triton Inference Server FAQ

Should I use Triton or standalone vLLM for a single LLM endpoint?

Standalone vLLM or SGLang is simpler when you only need an OpenAI-compatible chat API for one LLM. Choose Triton when you serve multi-model pipelines (embeddings, vision, TensorRT engines, Python logic) or require a unified KServe v2 control plane across frameworks.

Why must max_batch_size be 0 for the Triton vLLM backend?

Because vLLM schedules tokens step-by-step across sequences of varying lengths inside its own continuous batcher. Setting a non-zero Triton max_batch_size forces Triton’s request-level batcher to pad or hold requests before vLLM ever sees them.

When should I pick an Ensemble over Business Logic Scripting (BLS)?

Use an Ensemble whenever the pipeline DAG is fixed at deployment time (such as preprocessing into a TensorRT engine), because Triton executes static DAG routing in C++ without Python overhead. Use BLS when you need loops, conditional routing, or dynamic retries.

What replaces Triton dynamic batching when a model tracks conversation or audio state?

Use sequence_batching with explicit sequence start/end flags and correlation IDs so Triton pins every chunk of a session to the same stateful model instance slot.

Sources and further reading

Primary documentation and research behind this guide.

  1. NVIDIA Triton Inference Server: Architecture
  2. NVIDIA Triton Inference Server: Model Configuration (config.pbtxt)
  3. NVIDIA Triton Inference Server: Ensemble Models
  4. NVIDIA Triton Inference Server: Decoupled Models
  5. NVIDIA Triton Inference Server: vLLM Backend
  6. KServe v2 Inference Protocol Specification (Triton Server)

Keep learning

Related guide · 6 min readAI cloud infrastructure for LLM inference: a practical guideRelated guide · 6 min readContinuous batching explained: how LLM servers scaleRelated guide · 6 min readLLM inference metrics: TTFT, TPOT, ITL, and throughputRelated guide · 7 min readvLLM vs SGLang: measured comparison and benchmark planAcademy course · 13 unitsvLLMAcademy course · 13 unitsSGLangAcademy course · 12 unitsNVIDIA DynamoAcademy course · 16 unitsNVIDIA Triton Inference Server
Back to all articles