> This page is for Evo 2, version 2.2.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 2.2.0 (Latest) (default): https://docs.nvidia.com/nim/bionemo/evo2/2.2.0/llms.txt
> - 2.1.0: https://docs.nvidia.com/nim/bionemo/evo2/2.1.0/llms.txt
> - 2.0.0: https://docs.nvidia.com/nim/bionemo/evo2/2.0.0/llms.txt
> - 1.0.2: https://docs.nvidia.com/nim/bionemo/evo2/1.0.2/llms.txt
> - 1.0.1: https://docs.nvidia.com/nim/bionemo/evo2/1.0.1/llms.txt
> - 1.0.0: https://docs.nvidia.com/nim/bionemo/evo2/1.0.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nim/bionemo/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nim/bionemo/_mcp/server.

# Evo 2 NIM Endpoints

The NIM provides endpoints that generate DNA sequences, run a model forward pass and save layer outputs, and conduct readiness checks. The input and output parameters of these endpoints correspond to the properties in a JSON object that the endpoint submits or receives.

## Generate DNA Sequences

Endpoint path: `/biology/arc/evo2/generate`

### Input Parameters

- `sequence (string)`: Required. Sequence data of the DNA.

- `num_tokens (integer, null)`: Optional (default: 100). Number of tokens to be generated.

- `temperature (number, null)`: Optional (default: 0.7). Scale of randomness in the temperature sampling process. Values lower than 1.0 generate a sharper distribution, which is less random. Values higher than 1.0 generate a uniform distribution, which is more random.

- `top_k (integer, null)`: Optional (default: 3). Specifies the number of highest probability tokens to consider for sampling. When set to 1, it selects only the token with the highest probability. The higher the value, the more diverse the sampling will be. If set to 0, all tokens are considered.

- `top_p (number, null)`: Optional (default: 0.0). This parameter specifies the top-p threshold number, between 0 and 1, that enables nucleus sampling. When cumulative probability of the smallest possible set of tokens exceeds the top_p threshold, it filters out the rest of the tokens. Setting this to 0.0 disables top-p sampling.

- `random_seed (integer, null)`: Optional. Turns the Evo 2 model into a deterministic model, where an input DNA sequence and a fixed seed always produce the same output. Use this argument only for development.

- `enable_logits (boolean)`: Optional (default: false). Enables or disables logits reporting in the output response.

- `enable_sampled_probs (boolean)`: Optional (default: false). Enables or disables the reporting of sampled token probabilities. When enabled, the response includes a list of probability values, between 0 and 1, corresponding to each token in the output sequence. These probabilities represent the model's confidence in each token selection during generation. The resulting list has the same length as the output sequence.

- `enable_elapsed_ms_per_token (boolean)`: Optional (default: false). Enables or disables the reporting of per-token timing statistics, which is used for benchmarking.

### Outputs

- `sequence (string)`: Required. This output contains the generated DNA sequence.

- `logits (array, null)`: Optional. The output is a logits report in a `[num_tokens, 512]` format when `enable_logits` is true.

  **Note:** Evo 2's vocabulary size is 512, but for DNA sequence generation,
  only 4 tokens (A, C, T, G) are meaningful in the output of the pretrained model.
  The remaining tokens are present in the vocabulary for technical reasons
  (for example, input prompts, tokenizer padding, or future fine-tuning), but are not
  expected to be generated as output nucleotides.

  The mapping from logit indices to DNA bases is as follows:
  - A: ASCII 65
  - C: ASCII 67
  - T: ASCII 84
  - G: ASCII 71

  The top_k parameter is allowed to be up to 6 for compatibility, but in practice,
  only the 4 DNA bases are relevant for sequence generation.

- `sampled_probs (array, null)`: Optional. The output is a list of probabilities that corresponds to each token in the generated output sequence. Each value ranges from 0 to 1, representing the model's confidence in selecting specific tokens during generation. The list length matches the output sequence length. To get this output, set `enable_sampled_probs` to true.

- `elapsed_ms (integer)`: Required. The output is the elapsed time in milliseconds on the server.

- `elapsed_ms_per_token (array, null)`: Optional. The output is the elapsed time in milliseconds on the server for each generated token.

## Run a Model Forward Pass and Save Layer Outputs

Endpoint path: `/biology/arc/evo2/forward`

### Input Parameters

- `sequence (string)`: Required. Sequence data of the DNA.

- `output_layers (array)`: Required. List of layer names from which to capture and save output tensors.

  The Evo 2 model architecture consists of two types of layers:
  - **HyenaLayer**: Uses Hyena mixer for efficient long-range modeling
  - **TransformerLayer**: Uses multi-head self-attention mechanism

  **Layer distribution by model size:**
  - **7B models**: 32 layers total
    - HyenaLayers: all layers except 3, 10, 17, 24, 31
    - TransformerLayers: layers 3, 10, 17, 24, 31
  - **40B models**: 50 layers total
    - HyenaLayers: all layers except 3, 10, 17, 24, 31, 35, 42, 49
    - TransformerLayers: layers 3, 10, 17, 24, 31, 35, 42, 49

  **Model-level layers:**
  - `embedding`: Input token embeddings (typically layer 0).
     **Note:** This refers to the static token embeddings before any
     model computation. This layer is rarely useful for downstream
     analysis. Instead, it is recommended to use the output of an
     intermediate layer or the final MLP layer of a layer (as listed
     below), since these actually capture context-dependent features.
  - `decoder.final_norm`: Final model layer normalization
  - `output_layer`: Final output/logits of shape [seq_len, batch_size,
    512], where 512 is the padded vocabulary size of the tokenizer.

  **HyenaLayer components (available in HyenaLayers only):**
  - `decoder.layers.[n].mixer`: Output of the Hyena mixer submodule in layer [n].
    This captures the short, medium, and long-range sequence modeling
    capabilities of the Hyena mechanism, depending on the layer index.

  **TransformerLayer components (available in TransformerLayers only):**
  - `decoder.layers.[n].self_attention`: Multi-head attention output in layer [n]
  - `decoder.layers.[n].self_attention.linear_qkv`: Query, key, and value projection weights combined
  - `decoder.layers.[n].self_attention.core_attention`: The self-attention mechanism
  - `decoder.layers.[n].self_attention.linear_proj`: Output projection layer

  **MLP components (available in both layer types):**
  - `decoder.layers.[n].mlp`: Complete MLP output in layer [n]
  - `decoder.layers.[n].mlp.linear_fc1`: First MLP layer in layer [n]
  - `decoder.layers.[n].mlp.linear_fc2`: Second MLP layer in layer [n]

  Where `[n]` is the layer index:
  - For 7B models: `0` to `31`
  - For 40B models: `0` to `49`

  For example: `["output_layer", "decoder.layers.20.mlp.linear_fc2", "decoder.layers.3.self_attention"]`

### Outputs

- `data (string)`: Required. The output is the tensors of the requested layers in NumPy Zipped (NPZ) format, Base64 encoded.

  **Note:** Evo 2's vocabulary size is 512, but for DNA sequence generation,
  only 4 tokens (A, C, T, G) are meaningful in the output of the pretrained model.
  The remaining tokens are present in the vocabulary for technical reasons
  (for example, input prompts, tokenizer padding, or future fine-tuning), but are not
  expected to be generated as output nucleotides.

  The mapping from logit indices to DNA bases is as follows:
  - A: ASCII 65
  - C: ASCII 67
  - T: ASCII 84
  - G: ASCII 71

  The top_k parameter is allowed to be up to 6 for compatibility, but in practice,
  only the 4 DNA bases are relevant for sequence generation.

- `elapsed_ms (integer)`: Required. The output is the elapsed time in milliseconds on the server.

## Readiness Check

Endpoint path: `/v1/health/ready`

### Input Parameters

None.

### Outputs

The output of the endpoint is a JSON response with a value that indicates the readiness of the microservice. When the NIM is ready, it returns the response `{"status":"ready"}`.