Skip to main content
License: Evo2 is open source and free for academic and commercial use under an Apache-2.0 license. Please refer to the license for full terms.

Proto is not affiliated with Arc Institute. This toolkit is open source and builds on the implementation produced by this organization. Product names, logos, and trademarks are the property of their respective owners.


arcinstitute/evo2
arcinstitute/evo2
View repo
Genome modelling and design across all domains of life with Evo 2
Garyk Brixi, Matthew G Durrant, … Brian L Hie
Nature (2026)
Read paper
Genome modeling and design across all domains of life with Evo 2
G. Brixi, Matthew G. Durrant, … Brian L. Hie
bioRxiv (2025)
Read preprint
@articleBrixi2026-jn
Copy citation
ProtoProtoevo-design/proto-tools
View source
Open Notebook
Open notebook

Background

Evo2 (Brixi et al., 2026) is a DNA language model trained with an autoregressive objective: during training the model learns to predict the next nucleotide given all preceding nucleotides. Training used the OpenGenome2 dataset, which spans bacterial, archaeal, eukaryotic, and phage genomes across all domains of life, so the model is not restricted to any single clade. It is available at several scales, the largest being 40 billion parameters, and uses the StripedHyena 2 architecture, a sequence model that combines convolutional state-space layers with a smaller number of attention layers. This design lets the model process very long stretches of DNA, up to roughly one million nucleotides for the long-context checkpoints, without the memory cost a pure attention model would incur at that length. Several checkpoints are also offered with shorter context windows for lower memory use, and one variant is trained specifically on Microviridae phage genomes. The autoregressive objective yields two capabilities directly. Sampling from the predicted next-nucleotide distributions produces new candidate sequences, and reading off the probabilities the model assigns to an existing sequence gives a likelihood score that reflects how closely the sequence matches the patterns seen during training. Evo2 is the second model in the Evo family; the earlier Evo1 was trained only on prokaryotic and phage genomes, whereas Evo2 extends to eukaryotic genomes and longer context.

Learning Resources

  • The Illustrated Evo 2 (NVIDIA Research) - a visual walkthrough of the Evo 2 architecture and how the model processes and generates DNA.
  • Evo 2 Mechanistic Interpretability (Arc Institute) - an interactive look at the internal features Evo 2 learns, built with sparse autoencoders to surface interpretable genomic patterns.

Tools

Evo 2 In-context Design (evo2-icl)

In-context learning (ICL) conditions pretrained Evo 2 7B on example DNA without retraining. Supply a FASTA-derived pool of DNA or protein sequences; the tool selects examples, composes DNA prompts, and returns designs in the input alphabet for FASTA export.

API Reference

Source
enum
default:"dna"
DNA accepts A/C/G/T; protein accepts the 20 standard amino acids.Available options: dna, protein
List[string]
required
Sequences in FASTA record order, without headers. Whitespace is removed and sequences are uppercased.
Source
integer
default:"20"
Designs per composed prompt, without a library-level count cap.
integer
default:"16"
Examples selected without replacement per prompt, capped by pool size.
integer
default:"1"
Number of prompt draws, each producing num_sequences designs.
boolean
default:"False"
Use the first n_shots records in order instead of random selection.
integer
default:"42"
Seed for example selection, independent of generation.
string
default:"N"
DNA delimiter preceding each example and ending each prompt.
boolean
default:"False"
Also append the delimiter after every example.
integer
default:"1"
Minimum length required for every example in the pool.
integer
Parallel prefill length; None selects a batch-aware value.
integer
default:"42"
Seed for uniform reverse translation, independent of generation.
integer
default:"200"
New bases (DNA mode) or amino acids (protein mode) per design; the example sequences and separators are excluded from the output.
number
default:"1.0"
Sampling randomness. Lower values favor likely nucleotides; higher values explore more alternatives.
integer
default:"4"
Number of highest-probability tokens considered at each step.
number
default:"0.9"
Cumulative probability cutoff for nucleus sampling.
integer
default:"1"
Number of designs decoded together on the GPU.
integer
default:"0"
Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). True is coerced to 1 and False to 0.
string
default:"cuda"
Device to run the model on.
integer
default:"14400"
Maximum execution time in seconds.
integer
Generation seed; None draws fresh designs.
Source
enum
Alphabet of the returned designs.
List[string]
Corresponding generated DNA for protein results, in matching order.
List[CausalModelSample]
required
Requested-length DNA or protein designs. Protein translation starts at the first generated base; stops remain * and ambiguous codons become X, with warnings. No early stopping is used.

Applications

Use examples of a sequence family, such as regulatory DNA with a shared experimental activity, to condition candidate generation. The ICL study is Few-shot regulatory sequence design with a genomic language model (manuscript; paper URL coming soon). The HepG2 example pool contains 463 regulatory sequences of 200 bp each.

Usage Tips

  • Default run. Draw up to 16 examples, join them with a single N separator, and generate 20 designs of 200 bp. Generation always runs to the requested length. Sampling defaults are temperature 1.0, top K 4, and top P 0.9.
  • Choose the examples. n_shots sets examples per prompt; n_prompts sets the number of prompts, each producing num_sequences designs. Use fixed_examples=True to take the first records in FASTA order instead of sampling.
  • Protein input and output. Set sequence_type="protein" to supply the 20 standard amino acids. Examples are reverse-translated by uniformly sampling synonymous codons from the standard genetic code, using codon_seed (default 42). Length is measured in amino acids. Outputs include protein designs and matching dna_sequences; stop codons remain * and ambiguous codons become X, with warnings. No start or stop codon is added.
  • Reproduce a run. example_seed controls example selection, codon_seed controls reverse translation, and seed controls generation. Keep all three seeds and the batch size fixed to reproduce a run; change only seed to sample new designs from the same prompts.

Evo2 Sampling (evo2-sample)

Generates DNA sequences by autoregressive sampling. Given one or more prompt sequences in Evo2’s prompt format, the model extends each prompt nucleotide by nucleotide, drawing each new nucleotide from the model’s predicted distribution under the configured temperature, top_k, and top_p settings, until max_new_tokens new nucleotides have been produced or an end-of-sequence token is sampled. A key-value cache makes long generations efficient and can be carried forward to continue a generation.

API Reference

Source
List[string]
required
Prompt sequences to condition generation on. Can be provided as a single string or a list of strings.
Source
enum
default:"evo2_7b"
Evo2 weights variant.Available options: evo2_7b, evo2_20b, evo2_40b, evo2_7b_base, evo2_40b_base, evo2_1b_base, evo2_7b_262k, evo2_7b_microviridae
string
Override HuggingFace download with a local weights directory.
integer
default:"4"
Limit sampling to the top-k most probable tokens at each step.
integer
default:"32"
Maximum number of new tokens to generate per prompt (excludes prompt).
boolean
default:"True"
Use the model’s per-call KV cache during generation.
integer
Tokens to prefill in parallel before switching to autoregressive prompt forcing.
integer
Maximum sequence length the KV cache will be sized for.
boolean
default:"False"
Filter EOS/PAD bytes from the detokenized output.
boolean
default:"True"
Stop generation when an EOS (id=0) token is sampled.
Evo2KVCacheRef
Worker-local KV cache handle returned by a previous persistent-worker generation call.
boolean
default:"False"
Return worker-local KV cache handles for continued generation.
boolean
default:"False"
Include per-position logits in the output.
integer
default:"0"
Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). True is coerced to 1 and False to 0.
string
default:"cuda"
Device to run the model on.
integer
default:"1800"
Maximum execution time in seconds. None waits indefinitely.
integer
Random seed. When set, tools run reproducibly up to small GPU float noise (see BaseToolOutput.approx_equal), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
boolean
default:"True"
Include the input prompt at the start of each generated sequence; when False, only newly generated tokens are returned.
number
default:"1.0"
Sampling temperature controlling randomness.
number
default:"1.0"
Nucleus sampling threshold over per-position token probabilities.
integer
default:"4"
Number of sequences to process simultaneously.
Source
List[Evo2Sample]
required
One generated DNA sequence per prompt, with its logits and cache handle.

Applications

This tool produces candidate DNA sequences for downstream design and screening, including genes, regulatory regions, and longer multi-gene segments. Because Evo2 is trained across all domains of life, it can be prompted with eukaryotic as well as prokaryotic and phage context, unlike the prokaryote-and-phage-only Evo1. The prompt sets the biological context for what follows.

Usage Tips

  • Match the checkpoint to the task. evo2_7b (the default), evo2_20b, and evo2_40b are the 1M-context models in increasing size and capability. The evo2_7b_base, evo2_40b_base, and evo2_1b_base checkpoints are 8K-context counterparts (evo2_1b_base is the smallest); evo2_7b_262k is a 262K-context variant; evo2_7b_microviridae is a 7B model adapted on Microviridae genomes for generating that bacteriophage family.
  • Prompts use Evo2’s prompt format. Prompt strings follow Evo2’s special tokenization (for example a leading +~ before DNA); see the upstream Evo2 documentation for the conventions.
  • top_k defaults to 4, the size of the DNA alphabet. It exists mainly to keep generation on the four bases rather than other byte tokens, so it is not the diversity parameter; control diversity with temperature (lower stays near the training distribution, higher explores it) and leave top_p at its default unless you specifically want nucleus sampling.
  • Output includes the prompt by default. prepend_prompt=True (the default for this toolkit) returns the prompt joined to its continuation; set it False to receive only the newly generated nucleotides.
  • Prompt length plus max_new_tokens (default 32) must fit the checkpoint’s context window. The model cannot attend beyond that window, so a long prompt directly reduces how much can be generated; pick a longer-context checkpoint when the combined length is large.
  • stop_at_eos ends generation early when the model emits an end-of-sequence token; set it to False to always produce the full max_new_tokens.
  • Generated sequences are candidates. Validate them with downstream tools (for example ORF detection, structure prediction, or homology search) before drawing biological conclusions.

Evo2 Scoring (evo2-score)

Scores existing DNA sequences under the Evo2 model. For each sequence, it computes the model’s predicted probability of every nucleotide given the preceding nucleotides and aggregates these into a log-likelihood, an average log-likelihood per nucleotide, and a perplexity. Optionally returns the per-position logits, alongside the token vocabulary giving their column order.

API Reference

Source
List[string]
required
Sequences to score. Can be provided as a single string or a list of strings.
Source
enum
default:"evo2_7b"
Evo2 weights variant.Available options: evo2_7b, evo2_20b, evo2_40b, evo2_7b_base, evo2_40b_base, evo2_1b_base, evo2_7b_262k, evo2_7b_microviridae
string
Override HuggingFace download with a local weights directory.
boolean
default:"False"
Prepend a beginning-of-sequence token before scoring.
integer
default:"0"
Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). True is coerced to 1 and False to 0.
string
default:"cuda"
Device to run the model on.
integer
default:"1800"
Maximum execution time in seconds. None waits indefinitely.
integer
Random seed. When set, tools run reproducibly up to small GPU float noise (see BaseToolOutput.approx_equal), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
integer
default:"8"
Number of sequences to process simultaneously on GPU. Larger batches improve throughput but use more GPU memory; reduce if encountering out-of-memory errors.
boolean
default:"False"
Include per-position logits in the output.
Source
List[CausalModelScoringMetrics]
required
List of scoring outputs, one per input sequence. Each entry is a Metrics subclass with scalar metrics (log_likelihood, avg_log_likelihood, perplexity) and optional per-position _pp-suffixed list extras; logits and vocab are declared fields for raw model outputs.
Metrics (one set per scores item)

Applications

This tool measures how well a DNA sequence matches the patterns the model learned during training across all domains of life. Lower perplexity means the sequence is more consistent with that distribution. Use it to rank or filter candidate sequences (including the output of evo2-sample), to compare variants of a sequence, or to assess sequences from organisms outside the prokaryotic and phage range that Evo1 covers.

Usage Tips

  • Compare length-normalized scores within one checkpoint. Total log_likelihood scales with sequence length, so use perplexity or avg_log_likelihood when comparing sequences of different lengths. Different checkpoints learn different distributions that are not calibrated to a common scale, so scores from different model_checkpoint values are hard to compare directly; a lower perplexity means the sequence is more consistent with that checkpoint’s training distribution.
  • return_logits defaults to False. Leave it off unless you need the per-position distributions, since the logits tensor is large (sequence length by a 512-token vocabulary).
  • prepend_bos adds a beginning-of-sequence token before scoring; leave it False unless matching a specific upstream convention.

Toolkit Notes

These apply to every Evo2 tool in this toolkit (evo2-icl, evo2-sample, evo2-score).
  • Requires a high-memory GPU; memory scales with model size and context length. The 7B checkpoint needs a high-memory NVIDIA GPU; the 20B and 40B models and the 1M-context checkpoints need substantially more. CPU execution is not practical.
  • batch_size trades memory for throughput. It sets how many designs (evo2-icl), prompts (evo2-sample), or sequences (evo2-score) are processed per GPU forward pass. Raise it for higher throughput on many short sequences; lower it if generation or scoring runs out of GPU memory.
  • Trained across all domains of life. Evo2 covers prokaryotic, eukaryotic, archaeal, and phage genomes. For prokaryote-and-phage-only generation with a smaller model, Evo1 is an alternative.
Example notebook: See the full working example for a copy-paste-ready walkthrough.

Infrastructure Guides

The following guides cover how to run tools efficiently and at scale.

Tool Persistence

Keep a tool’s model warm across calls instead of reloading it every invocation.

Device Management

How GPUs are allocated to tools and how to target specific devices.

Parallel Execution

Fan a batch of inputs out across multiple GPUs.