NVIDIA Triton Inference Server

Serve TensorRT, ONNX Runtime, Python, and LLM models behind one KServe v2 endpoint. Master model repositories, config.pbtxt contracts, dynamic and sequence batching, instance groups, rate limiting, ensembles, Business Logic Scripting, decoupled streaming, shared memory, Perf and Model Analyzer, and Kubernetes operations.

  • Beginner → advanced
  • 16 units · approximately 19 hours
  • v2.74.0 · Reviewed 2026-11-16

Independent educational course. Project names and marks belong to their respective owners; their use does not imply sponsorship or endorsement.

How to work through this course

Before you begin: Basic familiarity with Python, HTTP/JSON APIs, and a Linux terminal. Completing the free Foundations course helps with batching and memory concepts, though it is not locked. The Python verification scripts run on macOS, Linux, or Windows; running the Triton server container requires Linux (Windows native server builds were removed in release 26.06), and GPU backends need an NVIDIA GPU.

By the end: Design and validate a multi-model Triton repository, tune batching, instances, and rate limits against measured p99 latency and throughput targets, wire ensembles or BLS pipelines alongside LLM backends, and operate the service with Prometheus metrics and Kubernetes readiness gates.

  1. Understand the idea. Read each section in order and study its diagrams. When a pause-and-predict question appears, commit to an answer before you reveal it. Look up unfamiliar terms in the glossary below.
  2. Try it yourself. Every lesson contains diagrams, prediction checks, and a standalone Python verification script that runs on any laptop without a GPU. Running the Triton server containers requires a Linux host with Docker; GPU backends need an NVIDIA GPU and the NVIDIA Container Toolkit.
  3. Check your understanding. Answer the knowledge check at the end of each lesson and make sure you can say why the other options are wrong. Complete all units to unlock the final quiz; the passing score is 80%.

The optional project brings the lessons together. Keep notes on your choices, results, and any failures so you can explain what you learned.

Course orientation

What is NVIDIA Triton Inference Server?

NVIDIA Triton Inference Server is an open-source multi-framework model serving engine. One server process loads models from a versioned repository onto CPUs and GPUs, exposes a unified KServe v2 HTTP and gRPC API, schedules requests across dynamic or stateful sequence batches, routes multi-step ensembles or Python Business Logic Scripting pipelines, and exports per-model and per-GPU Prometheus telemetry.

The problem it solves

Production AI systems rarely serve a single standalone neural network. A retrieval pipeline might clean strings in Python, score documents with an ONNX cross-encoder, classify safety in TensorRT, and stream tokens from an LLM backend. Running each model inside its own bespoke Flask or FastAPI wrapper wastes GPU memory, fragments monitoring, duplicates batching logic, and adds extra network hops between stages. Triton consolidates all of those models behind one scheduler, one wire protocol, and one metrics surface.

From model repository to scheduled backend execution

  1. 01Repository and model manager

    Triton watches a directory tree (local disk, S3, or GCS) containing one folder per model, a config.pbtxt contract, and numbered version subdirectories, loading or unloading versions under explicit, poll, or none control mode.

  2. 02Protocol frontends

    HTTP/REST on port 8000 and gRPC on port 8001 decode KServe v2 requests, including raw binary tensor attachments and decoupled bidirectional streams, without copying tensors unnecessarily.

  3. 03Per-model schedulers and rate limiter

    Each model declares either dynamic batching, sequence batching (Direct or Oldest), or bypassed batching (max_batch_size: 0). The global rate limiter orders execution across shared GPU resources.

  4. 04Pluggable execution backends

    Stateless C++ and Python shared libraries execute batches across ONNX Runtime, TensorRT, PyTorch, OpenVINO, Python, vLLM, and TensorRT-LLM inside configured CPU or GPU instance groups.

  5. 05Telemetry, caches, and health

    Built-in response caches, warmup generators, /v2/health/live and /v2/health/ready endpoints, and Prometheus metrics on port 8002 let orchestrators autoscale and verify readiness safely.

What it covers

  • Unified KServe v2 HTTP, gRPC, and C API endpoints with binary tensor framing and decoupled streaming.
  • Model repository layout, version policies, explicit load/unload APIs, and strict config.pbtxt shape validation.
  • Dynamic batching, priority queues, queue timeout policies, sequence batching slots, instance groups, and cross-model rate limiting.
  • Multi-stage DAG ensembles, custom Python backends, Business Logic Scripting (BLS), and LLM backends (vLLM and TensorRT-LLM).
  • Zero-copy system/CUDA shared memory registration, startup warmup, response caching, Prometheus metrics, and Perf/Model Analyzer tuning.

Outside its scope

  • Training or offline weight quantization. Triton loads existing ONNX, TensorRT plan, PyTorch, or Hugging Face checkpoints.
  • Multi-node fleet routing and KV-cache-aware prefill/decode disaggregation across separate pods; orchestrators such as Kubernetes or NVIDIA Dynamo sit above Triton instances.
  • User authentication, TLS termination, and per-tenant rate quotas. Place an API gateway or ingress controller in front of Triton ports 8000 and 8001.
  • Automatic model accuracy guarantees across precision changes. Engineers must validate TensorRT FP16 or INT8 outputs against a trusted reference.
Key terms in this course
Model repository
The filesystem or object-store tree holding named model folders, config.pbtxt files, and numbered version directories.
config.pbtxt
The Protobuf text schema declaring a model's backend, max_batch_size, input/output shapes and dtypes, scheduler, and instance groups.
KServe v2 protocol
The standardized HTTP/REST and gRPC inference, health, metadata, and model-control API implemented by Triton.
Dynamic batcher
Triton's stateless scheduler that groups concurrent requests up to max_batch_size within preferred_batch_size and max_queue_delay_microseconds bounds.
Sequence batcher
Triton's stateful scheduler that routes multi-step sequences with matching correlation IDs to persistent execution slots via Direct or Oldest policies.
Instance group
A declaration specifying how many parallel execution instances of a model run on CPUs or specific GPUs.
Rate limiter
The global arbiter that paces execution across models sharing resources using priority levels and resource weights.
Model ensemble
A static directed acyclic graph (DAG) inside config.pbtxt that passes intermediate tensors between models inside Triton without client round-trips.
Business Logic Scripting (BLS)
Python backend code that invokes other Triton models imperatively via pb_utils.InferenceRequest, enabling loops and branches.
Decoupled transaction policy
A mode allowing a model to emit zero, one, or many asynchronous responses per request, required for token streaming and vLLM.
Shared memory region
A registered POSIX or CUDA IPC buffer allowing zero-copy tensor exchange when --allow-client-shm=true is enabled.
Perf Analyzer and Model Analyzer
Triton SDK tools that sweep client concurrency (Perf Analyzer) and search config combinations for Pareto-optimal latency and throughput (Model Analyzer).

Syllabus

  1. 02Model repositories, versioning, and lifecycle control65 minProOpenStructure local and object-store Triton model repositories with valid positive integer version directories and config placement.
  2. 03Write and verify config.pbtxt contracts70 minProOpenAuthor valid `config.pbtxt` files declaring model identity, `max_batch_size`, tensor shapes, data types, and `reshape` mappings.
  3. 04Speak KServe v2 over HTTP, gRPC, and binary framing70 minProOpenUse the core KServe v2 HTTP/REST and gRPC endpoints for server health, model metadata, inference, and model lifecycle checks.
  4. 05Dynamic batching, queues, and priority scheduling75 minProOpenConfigure Triton's dynamic_batching scheduler with preferred_batch_size rungs and bounded max_queue_delay_microseconds.
  5. 06Sequence batching for stateful and streaming models65 minProOpenExplain why stateful models fail under stateless dynamic batching and how correlation IDs preserve state across steps.
  6. 07Instance groups, concurrent execution, and rate limiting65 minProOpenConfigure instance_group placement and concurrency across KIND_GPU, KIND_CPU, KIND_MODEL, and passive instances.
  7. 08Serve ONNX Runtime and TensorRT engines75 minProOpenChoose between Triton's onnxruntime backend (CPU, CUDA EP, TensorRT EP) and pre-compiled tensorrt plan engines.
  8. 09Custom logic and preprocessing with the Python backend75 minProOpenExplain how Triton isolates Python Global Interpreter Locks across stub processes and moves tensors through POSIX shared memory.
  9. 10Multi-stage pipelines: model ensembles and Business Logic Scripting75 minProOpenChoose between a static `platform: "ensemble"` DAG and imperative Python Business Logic Scripting (BLS) from workload control-flow needs.
  10. 11Decoupled models and bidirectional token streaming65 minProOpenExplain why Triton's default 1-to-1 request-response model blocks streaming and how `model_transaction_policy { decoupled: true }` removes that rule.
  11. 12Serve LLMs with the vLLM and TensorRT-LLM backends80 minProOpenExplain why LLM serving requires `max_batch_size: 0`, `decoupled: true`, and `KIND_MODEL` instead of Triton's request-level dynamic batcher.
  12. 13Zero-copy shared memory, warmup, and response caching70 minProOpenRegister and reference POSIX system shared memory or CUDA IPC shared memory while honoring the `--allow-client-shm=true` trust gate introduced in Triton 26.04.
  13. 14Benchmark and tune with Perf Analyzer and Model Analyzer75 minProOpenSeparate the benchmarking roles of `perf_analyzer` (sweeping load against one fixed config) and `model-analyzer` (sweeping `config.pbtxt` variants across a search space).
  14. 15Observability, Prometheus metrics, and Kubernetes operations75 minProOpenRoute Kubernetes `startupProbe`, `livenessProbe`, and `readinessProbe` checks to `/v2/health/live` and `/v2/health/ready` so pods never receive traffic before weights and warmup finish.
  15. 16Capstone: architect, benchmark, and harden a multi-model Triton service80 minProOpenCompose a multi-model Triton `26.10` architecture uniting Python preprocessing, ONNX/TensorRT scoring, BLS/ensembles, and decoupled vLLM streaming on shared GPUs.
Full unit-by-unit learning objectives (68 outcomes)

01 · What is NVIDIA Triton Inference Server?

  • Explain which serving tasks NVIDIA Triton Inference Server consolidates across frameworks and which tasks stay in cluster orchestrators.
  • Trace one inference request through Triton's network frontends, per-model schedulers, rate limiter, backend instances, and telemetry surface.
  • Calculate both the GPU memory savings and the M/M/1 queueing latency penalty when packing multiple models onto one GPU.
  • Verify a pinned Triton 2.74.0 (NGC 26.10) container deployment using health, metadata, and Prometheus metrics endpoints.

02 · Model repositories, versioning, and lifecycle control

  • Structure local and object-store Triton model repositories with valid positive integer version directories and config placement.
  • Choose between latest, all, and specific version policies for canary tests, rollbacks, and multi-version serving.
  • Distinguish none, poll, and explicit model-control modes and operate the HTTP/gRPC repository load and unload endpoints.
  • Size GPU memory budgets for zero-downtime explicit model reloads so overlapping versions never cause out-of-memory failures.

03 · Write and verify config.pbtxt contracts

  • Author valid `config.pbtxt` files declaring model identity, `max_batch_size`, tensor shapes, data types, and `reshape` mappings.
  • Predict exact wire tensor shapes and backend tensor shapes when `max_batch_size` is positive versus zero.
  • Validate element-count preservation across `reshape` declarations and distinguish Triton `TYPE_*` names from KServe v2 wire types.
  • Understand when Triton auto-complete can fill basic I/O metadata and when `--disable-auto-complete-config` or non-introspectable backends require full explicit files.

04 · Speak KServe v2 over HTTP, gRPC, and binary framing

  • Use the core KServe v2 HTTP/REST and gRPC endpoints for server health, model metadata, inference, and model lifecycle checks.
  • Encode and decode Triton's HTTP Binary Tensor Data extension using `Inference-Header-Content-Length` and `binary_data_size`.
  • Serialize variable-length `BYTES` (`TYPE_STRING`) tensors with 4-byte little-endian unsigned length prefixes.
  • Quantify wire payload savings of binary HTTP framing and gRPC `raw_input_contents` over plain JSON float arrays.

05 · Dynamic batching, queues, and priority scheduling

  • Configure Triton's dynamic_batching scheduler with preferred_batch_size rungs and bounded max_queue_delay_microseconds.
  • Trace how arrivals, timers, and server busy periods interact to assemble batches and compute per-request wait times.
  • Isolate interactive traffic from background jobs using priority_levels, priority_queue_policy, and REJECT timeouts.
  • Measure realized average batch size and queue delay from Triton Prometheus metrics before and after tuning.

06 · Sequence batching for stateful and streaming models

  • Explain why stateful models fail under stateless dynamic batching and how correlation IDs preserve state across steps.
  • Choose between Triton's Direct and Oldest sequence batching strategies based on how the model indexes its hidden state.
  • Configure control_input tensors (START, END, READY, CORRID) and max_sequence_idle_microseconds in config.pbtxt.
  • Size direct batch slots and oldest candidate pools to prevent stream backlogs and premature idle evictions.

07 · Instance groups, concurrent execution, and rate limiting

  • Configure instance_group placement and concurrency across KIND_GPU, KIND_CPU, KIND_MODEL, and passive instances.
  • Budget total GPU VRAM across shared weights, per-instance scratch workspaces, and Triton runtime overhead.
  • Enable cross-model pacing with --rate-limit=execution_count and --rate-limit-resource pools on tritonserver.
  • Protect interactive SLOs and prevent activation spikes when heavy batch models share one GPU.

08 · Serve ONNX Runtime and TensorRT engines

  • Choose between Triton's onnxruntime backend (CPU, CUDA EP, TensorRT EP) and pre-compiled tensorrt plan engines.
  • Configure execution_accelerators, engine cache paths, and CPU intra/inter-op threads inside config.pbtxt.
  • Design multi-profile (min, opt, max) optimization bounds so dynamic shapes cover live traffic without runtime errors.
  • Verify FP16 precision tolerances against FP32 reference tensors and compute HBM/PCIe tensor bandwidth savings.

09 · Custom logic and preprocessing with the Python backend

  • Explain how Triton isolates Python Global Interpreter Locks across stub processes and moves tensors through POSIX shared memory.
  • Implement the `TritonPythonModel` lifecycle contract (`initialize`, batched `execute`, and `finalize`) with matching input and response counts.
  • Isolate malformed items inside a dynamic batch using per-request `try`/`except` and `TritonError` instead of crashing healthy neighbors.
  • Size container `/dev/shm` and `--backend-config=python` memory flags for multiple Python stub processes and large batched tensors.
  • Diagnose string byte-encoding mismatches, conda-pack `EXECUTION_ENV_PATH` failures, and shared-memory exhaustion.

10 · Multi-stage pipelines: model ensembles and Business Logic Scripting

  • Choose between a static `platform: "ensemble"` DAG and imperative Python Business Logic Scripting (BLS) from workload control-flow needs.
  • Wire `ensemble_scheduling` tensor `input_map` and `output_map` fields across models without introducing cycles, shape mismatches, or missing version directories.
  • Invoke co-loaded Triton models from Python using `pb_utils.InferenceRequest` with synchronous `exec()` and concurrent `async_exec()`.
  • Prevent synchronous BLS deadlocks, unbounded memory growth in decoupled ensembles (`max_inflight_requests`), and explicit model-load ordering failures.

11 · Decoupled models and bidirectional token streaming

  • Explain why Triton's default 1-to-1 request-response model blocks streaming and how `model_transaction_policy { decoupled: true }` removes that rule.
  • Manage `InferenceResponseSender` lifetimes in Python, emitting `TRITONSERVER_RESPONSE_COMPLETE_FINAL` exactly once and returning `None` from `execute()`.
  • Distinguish why `/v2/models/<name>/infer` rejects decoupled models while gRPC `ModelStreamInfer` and HTTP `/generate_stream` deliver incremental chunks.
  • Check `is_cancelled()` during generation loops so client disconnects release GPU slots immediately while closing the transaction cleanly.

12 · Serve LLMs with the vLLM and TensorRT-LLM backends

  • Explain why LLM serving requires `max_batch_size: 0`, `decoupled: true`, and `KIND_MODEL` instead of Triton's request-level dynamic batcher.
  • Configure Triton's `vllm` backend (`config.pbtxt` + `1/model.json`) in NGC `26.10-vllm-python-py3` (vLLM `0.31.0`).
  • Contrast vLLM's in-process tokenizer and `gpu_memory_utilization` against TensorRT-LLM's compiled engines, `inflight_fused_batching`, and `kv_cache_free_gpu_mem_fraction`.
  • Calculate exact paged KV-cache token capacity and concurrent sequence limits from model architecture and GPU VRAM budgets.

13 · Zero-copy shared memory, warmup, and response caching

  • Register and reference POSIX system shared memory or CUDA IPC shared memory while honoring the `--allow-client-shm=true` trust gate introduced in Triton 26.04.
  • Configure `model_warmup` batches in `config.pbtxt` so TensorRT, ONNX Runtime, and CUDA graphs initialize before `/v2/health/ready` reports ready.
  • Size a bounded local response cache with `--cache-config` and `response_cache` while excluding stochastic or stateful models.
  • Calculate wire transfer bandwidth savings and response cache entry capacity from tensor byte sizes and hit rates.
  • Diagnose shared-memory permission errors, `/dev/shm` exhaustion, cold-start latency spikes, and stale cache hits.

14 · Benchmark and tune with Perf Analyzer and Model Analyzer

  • Separate the benchmarking roles of `perf_analyzer` (sweeping load against one fixed config) and `model-analyzer` (sweeping `config.pbtxt` variants across a search space).
  • Decompose `perf_analyzer` latency reports into client transport, server queue, input copy, compute inference, and output copy stages.
  • Verify benchmark health using Little's Law (`concurrency = throughput × mean_latency`) to catch client bottlenecks or dropped requests.
  • Apply Pareto frontier dominance under `p99` latency and GPU memory constraints to choose optimal instance counts and batch sizes.
  • Diagnose client-side saturation, unstable measurement windows, and open-loop versus closed-loop test bias.

15 · Observability, Prometheus metrics, and Kubernetes operations

  • Route Kubernetes `startupProbe`, `livenessProbe`, and `readinessProbe` checks to `/v2/health/live` and `/v2/health/ready` so pods never receive traffic before weights and warmup finish.
  • Configure pod `/dev/shm` memory mounts, `--exit-timeout-secs`, and `terminationGracePeriodSeconds` so rolling updates drain active batches without dropping streams.
  • Compute realized batch size, queue duration per request, backend execution latency, queue share, and cache hit ratio from Prometheus `/metrics` rate windows.
  • Select autoscaling signals (`nv_inference_pending_request_count` and queue duration rate) over lagging CPU or raw GPU percentages.
  • Diagnose `CrashLoopBackOff` startup loops, `503` rollout blips, Python backend `SIGBUS` crashes, and cumulative counter dilution.

16 · Capstone: architect, benchmark, and harden a multi-model Triton service

  • Compose a multi-model Triton `26.10` architecture uniting Python preprocessing, ONNX/TensorRT scoring, BLS/ensembles, and decoupled vLLM streaming on shared GPUs.
  • Budget combined GPU VRAM across weights, instance workspaces, paged KV caches, and a mandatory 10% safety margin.
  • Enforce release `26.10` (`v2.74.0`) security and lifecycle contracts covering `--allow-client-shm`, `/dev/shm` sizing, `model_warmup`, and `/v2/health/ready`.
  • Design pre-release Perf/Model Analyzer acceptance gates, chaos failure drills, and rollback triggers backed by pinned container tags.

Optional field project

Build, tune, and harden a multi-model Triton service

  1. 01Build and validate the repository, contracts, and wire format
  2. 02Tune batching, instance concurrency, and execution backends
  3. 03Wire Python backends, BLS pipelines, and decoupled LLM streaming
  4. 04Optimize latency, instrument metrics, and harden for production
View optional project brief

Sign in to read the project brief.

Free guides and tools