Controlled Small Molecule Generation (Latest)
Controlled Small Molecule Generation (Latest)

Quickstart Guide

Note

This page assumes you have installed and set up Prerequisite Software (Docker, NGC CLI, NGC registry access).

  1. Pull the NIM container with the following command.

Copy
Copied!
            

docker pull nvcr.io/nim/nvidia/molmim:1.0.0

  1. Run the NIM container with the following command.

Copy
Copied!
            

docker run --rm -it --name molmim --runtime=nvidia \ -e CUDA_VISIBLE_DEVICES=0 \ -e NGC_CLI_API_KEY \ -p 8000:8000 \ nvcr.io/nim/nvidia/molmim:1.0.0

This command will start the NIM container and expose port 8000 for the user to interact with the NIM.

  1. Open a new terminal, leaving the current terminal open with the launched service.

  2. In the new terminal, wait until the health check end point returns {"status":"ready"} before proceeding. This may take a couple of minutes. You can use the following command to query the health check.

Copy
Copied!
            

curl -X 'GET' \ 'http://localhost:8000/v1/health/ready' \ -H 'accept: application/json'

  1. Run inference to get the embeddings of a molecule from its SMILES string representation and save the output to output.json using the following command.

Copy
Copied!
            

curl -X 'POST' \ 'http://localhost:8000/embedding' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"sequences": ["CC(Cc1ccc(cc1)C(C(=O)O)C)C"]}' > output.json

  1. View the outputs. You can use the cat tool print the outputs to the command line as with the following command.

Copy
Copied!
            

cat output.json

However, we recommend installing jq, a command line tool that can format JSON for improved readability. You can use jq to visualize the output from the file:

Copy
Copied!
            

jq . output.json

or you can pipe the output directly to jq as in the following command:

Copy
Copied!
            

curl -X 'POST' \ 'http://localhost:8000/embedding' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"sequences": ["CC(Cc1ccc(cc1)C(C(=O)O)C)C"]}' > output.json

Previous Prerequisites
Next Deployment Guide
© | | | | | | |. Last updated on Jul 25, 2024.