Run Your First Prediction
In this tutorial, you run a complete Boltz-2 structure prediction with the installed BioNeMo Inference Runtime (BioIR) wheel. You create a protein request with an inline multiple sequence alignment (MSA), configure the serial inference pipeline, generate a CIF structure, and inspect its confidence scores.
The complete runnable script is available at
examples/quickstart/boltz2.py. The following steps
explain its inputs, configuration, and output.
Before You Begin
Complete the installation, including its system requirements. If
you do not have a repository checkout, create quickstart.py and add the
following code blocks in order.
The first run downloads the Boltz-2 checkpoint and chemical metadata from Hugging Face. Later runs reuse the local copies. Refer to Model Weights for cache locations and offline staging.
Start at the top-level import.
Understand the Input Request
The first part of quickstart.py creates the prediction request:
This block creates one prediction request:
InputRequestdescribes one biomolecular complex and gives it the identifierT1031.Polymerdefines protein chainA1and its amino-acid sequence.MSARecordprovides an inline A3M alignment containing only the query sequence. This keeps the example self-contained. Production requests should use a full MSA.rowswraps the request in the row format consumed bybuild_processor.__record_idbecomes the output filename.
Refer to Input Requests for MSAs, templates, nucleic acids, ligands, and multiple chains.
Understand the Pipeline Configuration
The next block configures the serial prediction pipeline:
The configuration controls the complete prediction pipeline:
model_source="boltz-2"selects the Boltz-2 model, tokenizer, feature generator, checkpoint, and default runtime arguments.num_sampling_steps=50shortens the diffusion stage for this example. Other Boltz-2 arguments retain their registered defaults.random_seed=42makes feature generation reproducible.WriterStageConfigwrites a CIF structure underoutput/serial.profile_inference=Trueadds the GPU model-forward time to the output row.- Omitting
executor_backendselects the serial processor. Ray replicas are intended for processing many independent requests across several GPUs.
Refer to EngineProcessorConfig,
Runtime Args, and
Ray Multi-GPU Replicas for the available
controls.
Understand Inference and Results
The final block runs inference and builds a compact score summary:
build_processor(config) assembles the parser, tokenizer, feature generator,
folding engine, and writer. Calling the processor returns one row for each
input row. The writer stores scores as JSON, so the example decodes it before
reading individual metrics.
The summary prints scalar values and array shapes instead of the full pLDDT and
PAE arrays. Refer to build_processor and
Outputs for the complete row schema.
Run the Example
From the repository root, run the maintained example:
If you copied the code blocks into a standalone file, run that file instead:
BioIR logs model and asset loading before printing the summary. A successful run resembles:
Inference time and scores can vary across GPUs and releases. The stable result
is a non-empty output/serial/T1031.cif structure and a score payload with the
keys shown in the previous example.
The summary contains:
output_path— the predicted CIF structure.model_inference_time_s— the synchronized GPU model-forward time. It does not include asset downloads, preprocessing, or output writing.ptm— the predicted TM score returned by Boltz-2.mean_plddt— the mean of the returned pLDDT confidence values.pae_shape— the dimensions of the predicted aligned error matrix.
Next Steps
- Learn how to provide MSAs, templates, nucleic acids, and ligands in Input Requests.
- Process independent requests across several GPUs in Ray Multi-GPU Inference.
- Configure models and runtime arguments with
build_processor. - Check supported models, inputs, and GPUs in the Support Matrix.