> This page is for NVIDIA Active Speaker Detection NIM, version 1.2.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 1.2.0 (Latest) (default): https://docs.nvidia.com/nim/maxine/active-speaker-detection/1.2.0/llms.txt
> - 1.1.0: https://docs.nvidia.com/nim/maxine/active-speaker-detection/1.1.0/llms.txt
> - 1.0.0: https://docs.nvidia.com/nim/maxine/active-speaker-detection/1.0.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nim/maxine/llms.txt.

# Getting Started

Authenticate with NGC, launch the Active Speaker Detection NIM container, and set environment variables and runtime flags before you send inference requests.

## Prerequisites

To ensure that you have the supported hardware and software stack, check the [Support Matrix](/nim/maxine/active-speaker-detection/support-matrix).

### NGC Authentication

An NGC API key is required to pull the container image and download models. Complete the following steps to create the key, export it, and log in to the NVIDIA Container Registry.

#### Generate an API Key

An NGC API key is required to access NGC resources. You can generate a key at [https://org.ngc.nvidia.com/setup/api-keys](https://org.ngc.nvidia.com/setup/api-keys).

When creating an NGC API Personal key, ensure that at least **NGC Catalog** is selected from the **Services Included** dropdown. You can include more services if this key is to be reused for other purposes.

<Note>
Personal keys allow you to configure an expiration date, revoke or delete the key using an action button, and rotate the key as needed. For more information about key types, refer to [NGC API Keys](https://docs.nvidia.com/ngc/gpu-cloud/ngc-user-guide/index.html#ngc-api-keys) in the NGC User Guide.
</Note>

#### Export the NGC API Key

To download the appropriate models and resources when starting the NIM, use the `NGC_API_KEY` environment variable to pass the value of the API key to the `docker run` command in the next section.

The simplest way to create the `NGC_API_KEY` environment variable is to export it in your terminal:

```bash
export NGC_API_KEY=<value>
```

Run one of the following commands to make the key available at startup:

```bash
# If using bash
echo "export NGC_API_KEY=<value>" >> ~/.bashrc

# If using zsh
echo "export NGC_API_KEY=<value>" >> ~/.zshrc
```

<Note>
Other, more secure options include saving the value in a file, so that you can retrieve with `cat $NGC_API_KEY_FILE`, or using a [password manager](https://www.passwordstore.org/).
</Note>

#### Docker Login to NGC

To pull the NIM container image from NGC, first authenticate with the NVIDIA Container Registry with the following command:

```bash
echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin
```

Use `$oauthtoken` as the username and `NGC_API_KEY` as the password. The `$oauthtoken` username is a special name that indicates that you will authenticate with an API key and not a user name and password.

## Launching the NIM Container

The following command launches the Active Speaker Detection NIM container with the gRPC service. For a list of parameters, refer to [Runtime Parameters for the Container](#runtime-parameters-for-the-container).

```bash
docker run -it --rm --name=active-speaker-detection-nim \
  --runtime=nvidia \
  --gpus all \
  --shm-size=8GB \
  -e NGC_API_KEY=$NGC_API_KEY \
  -e NV_AI4M_MAX_CONCURRENCY_PER_GPU=1 \
  -e NIM_HTTP_API_PORT=8000 \
  -e NIM_GRPC_API_PORT=8001 \
  -p 8000:8000 \
  -p 8001:8001 \
  nvcr.io/nim/nvidia/active-speaker-detection:latest
```

<Note>
The flag `--gpus all` is used to assign all available GPUs to the NIM container.
To assign specific GPUs to the NIM container (in case of multiple GPUs available in your machine), use `--gpus '"device=0,1,2..."'`.

On bare-metal Linux systems with PCIe topology and multiple GPUs, we recommend setting IOMMU to passthrough. Refer to [PCIe Multi-GPU Systems](/nim/maxine/active-speaker-detection/advanced-usage/multi-gpu).
</Note>

If the NIM launch is successful, you get a response similar to the following.

```bash
I1027 22:31:44.952125 123 grpc_server.cc:2560] "Started GRPCInferenceService at 127.0.0.1:9001"
I1027 22:31:44.952247 123 http_server.cc:4755] "Started HTTPService at 127.0.0.1:9000"
I1027 22:31:44.993329 123 http_server.cc:358] "Started Metrics Service at 127.0.0.1:9002"
Triton server is ready
[INFO AI4M BASE LOGGER 2026-03-11 10:55:57.487 PID:195] Listening to 0.0.0.0:8001
```

<Note>
By default, the Active Speaker Detection NIM gRPC service is hosted on port `8001`. You must use this port for inferencing requests. The port is configurable through the `NIM_GRPC_API_PORT` environment variable.
</Note>

## Environment Variables

The following table describes the environment variables that can be passed into a NIM as a `-e` argument added to a `docker run` command:

| ENV                               | Required? | Default           | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------- | --------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NGC_API_KEY`                     | Yes       | None              | You must set this variable to the value of your personal NGC API key.                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `NIM_CACHE_PATH`                  | Optional  | `/opt/nim/.cache` | Location (in container) where the container caches model artifacts.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `NIM_GRPC_API_PORT`               | No        | `8001`            | Publish the NIM gRPC service to the prescribed port inside the container. Be sure to adjust the port passed to the `-p`/`--publish` flag of `docker run` accordingly (for example, `-p $NIM_GRPC_API_PORT:$NIM_GRPC_API_PORT`). The left side of the colon (`:`) is the port of your host address and does *not* need to match `$NIM_GRPC_API_PORT`. The right side of the colon (`:`) is the port inside the container, which *must* match `NIM_GRPC_API_PORT` (or `8001` if not set). |
| `NIM_HTTP_API_PORT`               | No        | `8000`            | Publish the NIM HTTP service to the prescribed port inside the container. Supported endpoints are `/v1/license` (returns the license information), `/v1/metadata` (returns metadata including asset information, license information, model information, and version), and `/v1/metrics` (exposes Prometheus metrics through an ASGI app endpoint).                                                                                                                                         |
| `NIM_MODEL_PROFILE`            | Optional  | None              | If unset, the NIM selects a profile that matches the GPU compute capability. Set this only to pin a specific profile. A profile that does not match the GPU causes a deserialization error on inference. Refer to [Model Profiles and Selection](/nim/maxine/active-speaker-detection/advanced-usage#model-profiles-and-selection) for more information.                                                                                                                                                                                                                                                                               |
| `NIM_SSL_MODE`                    | No        | disabled          | Set SSL security on the endpoints to `tls` or `mtls`. Defaults to unsecured endpoint.                                                                                                                                                                                                                                                                                                                                                                                                   |
| `NIM_SSL_CA_CERTS_PATH`           | No        | None              | Set the path to CA root certificate inside the NIM. This is required only when `NIM_SSL_MODE` is `mtls`. For example, if the SSL certificates are mounted at `/opt/nim/crt` in the NIM, `NIM_SSL_CA_CERTS_PATH` can be set to `/opt/nim/crt/ssl_ca_cert.pem`.                                                                                                                                                                                                                                 |
| `NIM_SSL_CERT_PATH`               | No        | None              | Set the path to the server's public SSL certificate inside the NIM. This is required only when an SSL mode is enabled. For example, if the SSL certificates are mounted at `/opt/nim/crt` in the NIM, `NIM_SSL_CERT_PATH` can be set to `/opt/nim/crt/ssl_cert_server.pem`.                                                                                                                                                                                                             |
| `NIM_SSL_KEY_PATH`                | No        | None              | Set the path to the server's private key inside the NIM. This is required only when an SSL mode is enabled. For example, if the SSL certificates are mounted at `/opt/nim/crt` in the NIM, `NIM_SSL_KEY_PATH` can be set to `/opt/nim/crt/ssl_key_server.pem`.                                                                                                                                                                                                                          |
| `NV_AI4M_ASD_MAX_SPEAKERS`        | No        | `5`               | Maximum number of audio speaker streams supported. Controls both the gRPC service and the Triton backend.                                                                                                                                                                                                                                                                                                                                                                               |
| `NV_AI4M_MAX_CONCURRENCY_PER_GPU`      | No        | `1`               | Number of concurrent inference requests to be supported by the NIM server per GPU. Total concurrency = `NV_AI4M_MAX_CONCURRENCY_PER_GPU` × number of GPUs. |
| `NV_AI4M_ASD_VA_SMOOTHING`             | No        | `high`            | Voice-activity smoothing level applied to diarized speaking decisions. Set to `off`, `low`, or `high`. Refer to [Voice Activity Smoothing for Diarization Workflows](/nim/maxine/active-speaker-detection/advanced-usage#voice-activity-smoothing-for-diarization-workflows). |
| `NV_AI4M_ASD_MULTIVIEW`                | No        | `false`           | Enable the multi-view model to correlate the same people across concurrent streams. Refer to [Multi-view Speaker Identification](/nim/maxine/active-speaker-detection/advanced-usage#multi-view-speaker-identification). |
| `NV_AI4M_ASD_VIDEO_TIMEOUT_S`          | No        | `30.0`            | Maximum time in seconds the NIM waits per frame for video data to arrive before proceeding. The same budget bounds the wait for the first frame. Must be greater than zero. Refer to [Per-Unit Coverage Timeouts](/nim/maxine/active-speaker-detection/advanced-usage#per-unit-coverage-timeouts). |
| `NV_AI4M_ASD_AUDIO_TIMEOUT_S`          | No        | `30.0`            | Maximum time in seconds the NIM waits per frame for audio data to arrive before proceeding. Must be greater than zero. |
| `NV_AI4M_ASD_DIARIZATION_TIMEOUT_S`    | No        | `30.0`            | Maximum time in seconds the NIM waits per frame for diarization data to arrive before proceeding. Applies only when diarization is included in the request. Behavior when exceeded is controlled by `NV_AI4M_ASD_DIARIZATION_TIMEOUT_MODE`. Must be greater than zero. |
| `NV_AI4M_ASD_DIARIZATION_TIMEOUT_MODE` | No        | `adaptive`  | Action taken when `NV_AI4M_ASD_DIARIZATION_TIMEOUT_S` is exceeded. `adaptive` (default): keep buffered diarization and apply late segments; `single_speaker`: continue with one speaker; `terminate`: fail the request. Refer to [Diarization Miss Policy](/nim/maxine/active-speaker-detection/advanced-usage#diarization-miss-policy). |

## Runtime Parameters for the Container

The following table describes Docker flags used in the launch command:

| Flags                                | Description                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-it`                                | `--interactive` + `--tty` (see [docker container run](https://docs.docker.com/reference/cli/docker/container/run/)).                                                                                                                                                                                                                                            |
| `--rm`                               | Delete the container after it stops (refer to [docker container run](https://docs.docker.com/reference/cli/docker/container/run/)).                                                                                                                                                                                                                                  |
| `--name=container-name`              | Give a name to the NIM container. Use any preferred value.                                                                                                                                                                                                                                                                                                      |
| `--runtime=nvidia`                   | Ensure NVIDIA drivers are accessible in the container.                                                                                                                                                                                                                                                                                                          |
| `--gpus all`                         | Expose NVIDIA GPUs inside the container. If you are running on a host with multiple GPUs, you need to specify which GPU to use. You can also specify multiple GPUs. For more information about mounting specific GPUs, refer to [GPU Enumeration](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#gpu-enumeration). |
| `--shm-size=8GB`                     | Allocate host memory for multi-process communication.                                                                                                                                                                                                                                                                                                           |
| `-e NV_AI4M_MAX_CONCURRENCY_PER_GPU` | Controls the number of concurrent inference requests processed simultaneously per GPU. Default: 1. Higher values enable parallel request processing but might reduce individual request performance due to resource sharing.                                                                                                                                    |
| `-e NV_AI4M_ASD_MAX_SPEAKERS`        | Maximum number of audio speaker streams. Default: 5. This setting controls both the gRPC service and the Triton backend.                                                                                                                                                                                                                                        |
| `-e NGC_API_KEY=$NGC_API_KEY`        | Provide the container with the token necessary to download adequate models and resources from NGC. Refer to [NGC Authentication](#ngc-authentication).                                                                                                                                                                                                               |
| `-p <host_port>:<container_port>`    | Ports published by the container are directly accessible on the host port.                                                                                                                                                                                                                                                                                      |

## Stopping the Container

Use the following commands to stop the container:

```bash
docker stop $CONTAINER_NAME
docker rm $CONTAINER_NAME
```