Skip to main content

Boltz-2 Python Client

Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved.

PyPI License: MIT

Python and command-line interfaces for NVIDIA Boltz-2 NIM: protein, DNA/RNA, ligand and covalent complexes, binding affinity, MSA integration, templates, and multi-endpoint screening.

Version 0.6.0 targets NIM 1.9.0. Releases are validated on TestPyPI before production publication. Select the matching index when installing. See migration and compatibility.

The source archive (.tar.gz) under the release page's Download files includes the current guides, scripts and notebooks. Relative links in this README refer to files in that extracted archive or a matching repository checkout.

Install

Python 3.10 or newer:

# PyPI, after production publication
python -m pip install boltz2-python-client==0.6.0

# TestPyPI release and dependencies from PyPI
python -m pip install --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ boltz2-python-client==0.6.0

# From this checkout or the extracted source archive
python -m pip install -e '.[dev,notebooks]'

Optional extras: notebooks (Jupyter and visualization), sagemaker (boto3), analysis (NumPy and structure conversion), and screening (pandas for CSV and DataFrame helpers). The Python client itself needs no GPU; a running NIM server performs inference.

Quick start

Run against a ready local server. This sequence is an input-format example; confidence scores do not establish a biological interaction.

from pathlib import Path
from boltz2_client import Boltz2SyncClient

client = Boltz2SyncClient(base_url="http://localhost:8000", timeout=600)
result = client.predict_protein_structure(
    sequence="MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG",
    output_dir=Path("results/protein"),
)
print(result.confidence_scores)

For notebooks and asynchronous programs, use Boltz2Client and await:

from boltz2_client import Boltz2Client, Ligand, Polymer, PredictionRequest

client = Boltz2Client(timeout=600)
request = PredictionRequest(
    polymers=[Polymer(id="A", molecule_type="protein", sequence="MTEYKLVVVGACGVGKSALTIQLIQNHFVDEYDPT")],
    ligands=[Ligand(id="L1", smiles="CC(=O)Oc1ccccc1C(=O)O",
                    predict_affinity=True, output_affinity_embedding=True)],
    diffusion_samples=2,
    max_parallel_samples=1,  # NIM 1.9+: lower peak GPU memory
)
result = await client.predict(request, output_dir="results/complex")
print(result.affinities["L1"].affinity_pic50)
print(result.affinities["L1"].affinity_embedding)

The second example demonstrates request syntax using a short protein fragment and aspirin; it is not a validated binding pair. Use full, appropriate target sequences and assess predictions against experimental evidence.

Endpoints

Deployment Configuration Prediction path
Local/self-hosted Boltz2Client(base_url="http://localhost:8000") /biology/mit/boltz2/predict
NVIDIA hosted Boltz2Client(endpoint_type="nvidia_hosted") /v1/biology/mit/boltz2/predict
SageMaker Boltz2Client(endpoint_type="sagemaker", sagemaker_endpoint_name="my-endpoint") boto3 invoke_endpoint

For hosted inference, supply the key through NVIDIA_API_KEY or NGC_API_KEY in the process environment (or api_key in Python). The default hosted base URL is https://health.api.nvidia.com. Local inference sends no authorization header. Hosted deployments may lag the container release; enable version-specific options only when that endpoint supports them.

SageMaker requires the sagemaker extra and configured AWS credentials/region. See the SageMaker connection example. Use asynchronous clients in Jupyter; the synchronous wrapper uses asyncio.run().

CLI

boltz2 health
boltz2 protein ACDEFGHIKLMNPQRSTVWY --output-dir results/protein
boltz2 protein ACDEFGHIKLMNPQRSTVWY --diffusion-samples 2 --max-parallel-samples 1
boltz2 ligand ACDEFGHIKLMNPQRSTVWY --smiles CC --predict-affinity --output-affinity-embedding
boltz2 advanced --config-file examples/data/nim_1_9_request.json --output-dir results/advanced
boltz2 --endpoint-type nvidia_hosted protein ACDEFGHIKLMNPQRSTVWY
boltz2 --multi-endpoint --base-url http://gpu1:8000,http://gpu2:8000 protein ACDEFGHIKLMNPQRSTVWY

These short sequences/ligands illustrate syntax. boltz2 --help lists all commands, including covalent constraints, YAML, MSA conversion and screening.

Results and matrices

predict() saves every structure as structure_0.cif, structure_1.cif, etc., plus prediction_response.json (complete response), prediction_metadata.json (scores, affinities, embeddings and runtime metrics), and affinities.json when present. Use save_structures=False or CLI --no-save to suppress client output. Use separate output directories for separate predictions to avoid overwriting files.

NIM 1.9 does not return full PAE/PDE matrices in JSON. write_full_pae=True and write_full_pde=True create NPZ files on the server under $NIM_OUTPUT_PATH/prediction_*/pae/ and .../pde/. result.pae and result.pde remain None. Mount the server output directory to retrieve these artifacts. Aggregate complex_pde_scores and complex_ipde_scores remain in the response. See outputs for loading matrices and retaining results.

Deploy a local server

Follow local deployment, including GPU/driver prerequisites, NGC login, cache and output mounts. The pinned image is nvcr.io/nim/mit/boltz2:1.9.0. The deployment script checks GPU access before starting a container:

# Set NGC_API_KEY (or NVIDIA_API_KEY) in the environment first.
export LOCAL_NIM_CACHE="$HOME/.cache/nim"
export LOCAL_NIM_OUTPUT="$HOME/boltz2-output"
bash scripts/start_local_nim.sh

Guides and examples

Start with the protein prediction notebook and example index. Guides:

License

MIT. Third-party assets retain their licenses. NVIDIA NIM container and model terms are separate from the Python client license.

Metadata

Release files for boltz2-python-client 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boltz2-python-client 0.6.0
File Size Uploaded Provenance Actions
boltz2_python_client-0.6.0.tar.gz 894.9 kB Without provenance Details for boltz2_python_client-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for boltz2-python-client 0.6.0
File Interpreter ABI Platform Actions
boltz2_python_client-0.6.0-py3-none-any.whl Python 3 none any Details for boltz2_python_client-0.6.0-py3-none-any.whl

Total release size: 1.7 MB

Release files / boltz2_python_client-0.6.0.tar.gz

Download URL boltz2_python_client-0.6.0.tar.gz
Size 894.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4bf5d760a10d690cd5991c140ab1cfcf9b8e6a2616a0d855679ae991fe586bbb
BLAKE2b-256 checksum
How to use checksums
069ee2ae03b92c4a41887985f1ecebac6a1cc09431f220f8636acb85a43d3e18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / boltz2_python_client-0.6.0-py3-none-any.whl

Download URL boltz2_python_client-0.6.0-py3-none-any.whl
Size 829.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c5817c1e323cd1062d79e7d6b75d49352bfc2cd60411056f727bf0551e5a7a4
BLAKE2b-256 checksum
How to use checksums
4ba6d8c2a6a4797e755d5685f8f4a83db4c6505c46466d880065c9eceb8ca9ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for boltz2-python-client 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page