Serve models with TensorRT-LLM
TensorRT-LLM performance depends on a tightly matched model, engine or PyTorch backend, container, CUDA stack, precision, and GPU topology. Polyaxon keeps those choices attached to the service and its benchmark operations.
Outcome
A TensorRT-LLM service component with an explicit model, backend, tensor-parallel size, GPU count, cache, and validation endpoint.
Service responsibilities
Polyaxon schedules
The service component fixes the image, model, port, accelerator request, connections, and health boundary.
The runtime serves
The inference engine loads the model and exposes its native or OpenAI-compatible API.
Clients validate
Smoke tests and evaluation operations exercise the endpoint while Polyaxon retains the deployment context.
Prerequisites
- A TensorRT-LLM container compatible with the model, GPU architecture, CUDA driver, and selected backend.
- Enough cache disk and accelerator memory for the model and KV cache.
- A separate engine-build operation when the selected deployment does not use the PyTorch backend directly.
Deploy and validate
- 1
Define the TensorRT-LLM service
Keep runtime flags and GPU topology in the Polyaxon component; treat any engine build as a versioned upstream artifact.
version: 1.1kind: componentname: tensorrt-llm-serverrun: kind: service ports: [8000] rewritePath: true connections: [hf-token, model-cache] container: image: nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc7 command: ["trtllm-serve"] args: ["TinyLlama/TinyLlama-1.1B-Chat-v1.0"] resources: limits: nvidia.com/gpu: "1"This is NVIDIA's documented quick-start model and published runtime image. Pin the image digest and choose a larger model only after checking its build and hardware requirements.
- 2
Submit the operation
Run the component through the target Polyaxon project, queue, preset, and approval path.
polyaxon run -f tensorrt-llm.yaml - 3
Validate the served model
Probe model discovery and then compare latency, throughput, memory, and quality against the exact runtime revision.
SERVICE_URL=$(polyaxon ops service --external --url)curl "$SERVICE_URL/v1/models"
Production checklist
Troubleshooting
The service never becomes ready
Inspect model download, credentials, disk space, GPU memory, runtime flags, port binding, and readiness behavior.
Requests fail through the URL
Verify the service port, rewrite-path setting, authentication header, ingress, network policy, and API path.
Latency degrades under load
Measure queueing, batch settings, context length, KV cache pressure, replica saturation, and storage or network contention.
Sources
Official platform, library, model, and Polyaxon references used by this guide.
TensorRT-LLM documentation
Current serving, backend, engine, model, and deployment guidance.
TensorRT-LLM quick start
Published NGC image, TinyLlama example, and `trtllm-serve` command used here.
Polyaxon service runtime
Service ports, replicas, connections, volumes, and external access.
Polyaxon model serving
Patterns for deploying APIs, loading models, and operating inference workloads.