Quickstart Guide
This page assumes you have completed the Prerequisites (NGC account, API key, NGC registry login, and client software) and installed the software listed in the Support Matrix (Docker, NVIDIA Drivers, and the NVIDIA Container Toolkit).
Start NIM
- Export
NGC_API_KEYvariable.
- NIM container automatically downloads models. To save time and bandwidth it is recommended to provide a local cache directory. This way NIM will be able to reuse already downloaded models. Execute the following command to set up the cache directory.
- Run the NIM container with the following commands.
This command will start the NIM container and expose port 8000 for the user to interact with the NIM.
- Open a new terminal, leaving the terminal open with the just launched service. In the new terminal, wait until the health check endpoint returns
{"status":"ready"}before proceeding. This can take a couple of minutes. You can use the following command to query the health check.
Python Client Example
- Save the following Python example to a file named
nim_client.py.
- Execute the example.
- The example saves results to the
output.pdbfile in PDB format. You can view the file using the following command.
Shell Client Example
- Save the following Shell example to a file named
nim_client.sh.
- Execute the example. The example displays the results to the terminal in JSON format.
Stop the Container
When you are done, press Ctrl+C in the terminal running the container, or run docker stop with the container ID shown by docker ps. Because the command does not use --rm, the stopped container remains; remove it with docker rm and the container ID shown by docker ps -a.