Quickstart for Evo 2
This Quickstart Guide walks you through starting the Evo 2 NIM and running your first DNA sequence generation request. For models, hardware, software, and NGC account requirements, refer to the Prerequisites.
Prerequisites
Confirm the following before you start the NIM.
Ensure you install and set up Prerequisite Software (Docker, NGC CLI, NGC registry access) before you begin.
Quickstart Steps
Complete the following steps to start the NIM and generate your first DNA sequences.
Start the NIM
Follow these steps to start the NIM and confirm it is ready:
-
Export the
NGC_API_KEYvariable. -
Set up a local cache directory.
The NIM container downloads models automatically; providing a cache lets it reuse models it has already downloaded, saving time and bandwidth. Run the following command to set up the cache directory.
-
Run the NIM container with the following commands.
- To use the 7B model, add
-e NIM_VARIANT=7bto the docker run command below. By default, the NIM loads the 40B model. - You might need to adjust your GPU’s indices.
This command starts the NIM container and exposes port 8000. The container defaults to the 40B model.
- To use the 7B model, add
-
Open a new terminal, leaving the terminal with the service running.
-
Wait until the health endpoint returns
{"status":"ready"}before proceeding.This can take a couple of minutes. In the new terminal, query the health endpoint with the following command.
Generate DNA Sequences
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 descriptions of the APIs and parameters, refer to Evo 2 NIM Endpoints. For information on assessing model accuracy, refer to 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 the 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
Follow these steps to generate a DNA sequence with a Shell client:
-
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.
Next Steps
Now that you have a working setup, explore the following resources in greater detail: