Deployment Guide
This section provides additional details for the deployment of the MolMIM NIM container.
View NIM Container Information
Container image tags can be seen with the command below, similar to other container images on NGC.
Pull the Container Image
Pull the container image using one of the following commands:
Docker
NGC
Run the Container
As in the Quickstart Guide, you can run the following command to start the MolMIM NIM.
We can break down the command into the following components. Some can be modified in a production setting to better suit the user’s desired application.
-
docker run: This is the command to run a new container from a Docker image. -
--rm: This flag tells Docker to remove the container automatically when it exits. This property is useful for one-off runs or testing, as it prevents the container from being left behind. -
-it: These flags combine to create an interactive terminal session within the container.-ikeeps the standard input open, and-tallocates a pseudo-TTY. -
--name molmim: This flag gives the container the name ‘molmim’. -
--runtime=nvidia: This flag specifies the runtime to use for the container. In this case, it is set to ‘nvidia’, which is used for GPU acceleration. -
-e CUDA_VISIBLE_DEVICES=0: This flag sets an environment variableCUDA_VISIBLE_DEVICESto the value ‘0’. This variable controls which GPU devices are visible to the container. In this case, it is set to 0, which means the container will only use the first GPU (if available). -
-e NGC_CLI_API_KEY: This flag sets an environment variableNGC_CLI_API_KEYused for authentication with NVIDIA’s NGC (NVIDIA GPU Cloud) service. -
-p 8000:8000: This flag maps port 8000 on the host machine to port 8000 in the container. This allows you to access the container’s services from the host machine. -
nvcr.io/nim/nvidia/molmim:1.0.0: This is the Docker image name and tag. The image is hosted on NVIDIA’s container registry (nvcr.io) and is namedmolmim_nim. The tag1.0.0specifies a specific version of the image.
Model Checkpoint Caching
On initial startup, the container will download the MolMIM checkpoint from NGC. You can skip this download step on future runs by caching the model weights locally using a cache directory as in the example below.
Caching the model checkpoint can save a considerable amount of time on subsequent container runs.