Runtime Parameters for Speech NIM Containers#
When you run a Speech NIM container with docker run, the following flags and environment variables are commonly used. Service-specific examples are in the ASR, TTS, and NMT tutorials.
API Protocols and Ports#
Each Speech NIM container exposes two ports. Multiple protocols share the HTTP port. Clients pick a protocol by the path or upgrade they request, not by connecting to a different port. Use this table to point each client at the correct port before running the deploy command:
Protocol |
Default Port |
Container Environment Variable |
Used By |
|---|---|---|---|
HTTP/REST |
|
|
|
WebSocket |
|
|
Realtime TTS streaming ( |
gRPC |
|
|
The Riva Python, C++, and Go clients and any other gRPC consumer. |
Publish both ports in docker run (-p 9000:9000 -p 50051:50051). Targeting a WebSocket client at 50051, or a gRPC client at 9000, is the most common cause of connection refused on first run.
Triton’s internal ports (8000, 8001, 8002) are used by the inference stack inside the container and do not need to be published.
Common Flags and Variables#
Flag or variable |
Description |
|---|---|
|
Interactive + TTY (refer to Docker docs). |
|
Remove the container when it stops (refer to Docker docs). |
|
Name for the container. Use any value you prefer; often set using |
|
Make NVIDIA drivers available inside the container. |
|
Expose GPU 0. On multi-GPU hosts, specify the device. Refer to GPU enumeration. |
|
Shared memory for multi-GPU communication. |
|
Token for downloading models and resources from NGC. Refer to NGC Access Setup. |
|
HTTP API port inside the container. Default 9000. Avoid 8000. |
|
gRPC API port inside the container. Default 50051. |
|
Map host port (left) to container HTTP port (right). |
|
Map host port (left) to container gRPC port (right). |
|
Select a model/profile. Key-value pairs, for example, |
Optional: Realtime WebSocket Authentication#
NIMs that expose the realtime WebSocket API support two independent authentication tiers, both off by default so that existing deployments are unaffected:
Variable |
When required |
Description |
|---|---|---|
|
Optional |
Static key required on |
|
Optional |
|
Your backend holds the long-lived key and exchanges it for a short-lived, single-use token that a browser presents on the WebSocket handshake, so no long-lived secret needs to reach the client and no WebSocket proxy is required. Because the two variables are independent, you can protect the session-creation endpoint first and require tokens on the socket later, once your clients have migrated.
-e REALTIME_AUTH_REQUIRE_TOKEN=true \
-e REALTIME_AUTH_MINT_API_KEY \
Passing -e REALTIME_AUTH_MINT_API_KEY without a value makes Docker inherit it from your shell, keeping the secret out of your shell history and the host process list.
For the token flow, client code, and error handling, refer to the realtime API references for ASR and TTS.
Optional: TLS/mTLS#
Some NIMs support HTTPS using environment variables:
Variable |
When required |
Description |
|---|---|---|
|
Optional |
|
|
When SSL is enabled |
Path to the server TLS private key. |
|
When SSL is enabled |
Path to the server certificate. |
|
When |
Path to the CA certificate. |
Check the support matrix and service docs for which images support SSL.