Quick example
Methods
.fold()
Predict the 3D structure of one or more protein sequences.
str | Sequence[str]
required
A single amino acid sequence string or a list of sequences. Use
":" to separate chains in a multimer (e.g., "CHAIN_A:CHAIN_B").dict | None
default:"None"
Per-call configuration overrides. Only dynamic config keys can be set here — static keys raise
ValueError. See Configuration.Boltz2Output (see Output below)
Output
TheBoltz2Output dataclass returned by .fold().
Always included
PredictionMetadata
Prediction metadata with timing information. See PredictionMetadata.
list[AtomArray] | None
List of Biotite
AtomArray objects (one per diffusion sample). Always generated.Confidence metrics
list[dict] | None
Comprehensive confidence metrics (one dict per sample). Each dict may contain keys like
confidence_score, ptm, iptm, ligand_iptm, protein_iptm, complex_plddt, complex_iplddt, complex_pde, complex_ipde, pair_chains_iptm, and chains_ptm.list[np.ndarray] | None
Per-residue pLDDT scores (one 1D array per sample).
list[np.ndarray] | None
Predicted aligned error matrices (one 2D square matrix per sample).
list[np.ndarray] | None
Predicted distance error matrices (one 2D square matrix per sample).
Structure representations
list[str] | None
PDB-formatted structure strings. Only generated when
include_fields contains "pdb" or "*".list[str] | None
mmCIF-formatted structure strings. Only generated when
include_fields contains "cif" or "*".Configuration
These keys can be set viaconfig={} at initialization or options={} per call (unless marked static).
Core settings
Diffusion settings
MSA settings
Output settings
MSA caching
MSA caching
Boltz-2 automatically caches MSA results to avoid redundant server queries. When you fold a sequence for the first time, the MSA is fetched from the server and stored locally. Subsequent predictions for the same sequence reuse the cached MSA. Cache files are stored in a hash-prefixed directory structure under{cache_dir}/boltz/msa_cache/. An index file (msa_index.json) tracks cached entries with metadata including creation time, last access time, and file size.
To disable caching, set config={"msa_cache_enabled": False}.
Multimer prediction
Separate chains with":" in the sequence string:
