biology
BioNeMo Boltz2
NVIDIA NIM for Boltz-2 structure prediction and binding-affinity prediction.
Model details
View repositoryExample usage
Call BioNeMo Boltz2 on Baseten using the NIM route for structure prediction.
Note: You need to procure your own NVAIE licenses to access this NIM.
Input
1import os
2import requests
3
4MODEL_ID = os.environ["BASETEN_MODEL_ID"]
5BASETEN_API_KEY = os.environ["BASETEN_API_KEY"]
6BASETEN_URL = (
7 f"https://model-{MODEL_ID}.api.baseten.co/environments/production/sync"
8 "/biology/mit/boltz2/predict"
9)
10
11sequence = "GIVEQCCTSICSLYQLENYCN"
12
13payload = {
14 "polymers": [
15 {
16 "id": "A",
17 "molecule_type": "protein",
18 "sequence": sequence,
19 }
20 ],
21 "recycling_steps": 3,
22 "sampling_steps": 50,
23 "diffusion_samples": 1,
24 "step_scale": 1.638,
25 "output_format": "mmcif",
26}
27
28response = requests.post(
29 BASETEN_URL,
30 headers={
31 "Authorization": f"Bearer {BASETEN_API_KEY}",
32 "Content-Type": "application/json",
33 },
34 json=payload,
35 timeout=300,
36)
37response.raise_for_status()
38result = response.json()
39print(result)
40JSON output
1{
2 "structures": [
3 {
4 "structure": "<mmcif text>",
5 "format": "mmcif"
6 }
7 ],
8 "confidence_scores": [
9 0.87
10 ],
11 "metrics": {}
12}