Quickstart Guide for Evo 2 NIM
Ensure you install and set up Prerequisite Software (Docker, NGC CLI, NGC registry access) before you begin.
Start NIM
- Export the
NGC_API_KEYvariable.
- NIM container automatically downloads models. To save time and bandwidth it is recommended to provide local cache directory. This way NIM will be able to reuse already downloaded models. Execute following command to setup cache directory.
- Run the NIM container with the following commands.
You might need to adjust your GPU’s indices.
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 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.
DNA Sequence Generation Examples
The following examples use the DNA Sequence Generation (Prediction) functionality to get started with the NIM.
Both Python and Shell examples provide input DNA sequence, number of generated nucleotides (num_tokens), as well as some optional parameters. The outputs of the examples will contain JSON objects with generated DNA nucleotides: adenine (A), thymine (T), guanine (G), and cytosine (C) in the sequence field, as well as other optional fields, such as sampled probabilities per nucleotide.
For comprehensive descriptions of all available APIs and parameters, see Evo 2 NIM Endpoints. For information on assessing and ensuring model accuracy, see Benchmarking with Evo 2 NIM.
Python client example
The following is an example of how you can use a Python client to input a DNA sequence to generate its DNA nucleotides.
- Save following Python example to a file named
nim_client.py.
- Execute the example.
- The example saves results to the
output.jsonfile in JSON 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.