boltz2-nim
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBoltz2 NIM
Boltz2 NIM
Predict biomolecular structures and optional ligand affinity. Use this
for first-pass hosted/local usage; load supplemental files only when
needed:
SKILL.md- : exact endpoints, schemas, Docker flags, response fields.
references/api.md - : purpose, strengths, limitations, and handoffs.
references/science.md - : prediction, sampling, MSA, template, affinity tuning.
references/parameters.md - : mmCIF, confidence, affinity, and chemistry checks.
references/validation.md - : compact hosted/local payload patterns.
references/examples.md
预测生物分子结构及可选的配体亲和力。首次使用托管/本地版本时可参考此;仅在需要时加载补充文件:
SKILL.md- : 详细端点、数据结构、Docker参数、响应字段说明。
references/api.md - : 工具用途、优势、局限性及交接说明。
references/science.md - : 预测、采样、MSA、模板、亲和力调参说明。
references/parameters.md - : mmCIF格式、置信度、亲和力及化学性质校验说明。
references/validation.md - : 托管/本地版本的简洁请求示例。
references/examples.md
Choose Mode
选择运行模式
Ask only when context is unclear:
Hosted NVIDIA API or local Docker NIM?
- Hosted:
https://health.api.nvidia.com/v1/biology/mit/boltz2/predict - Local:
http://localhost:8000/biology/mit/boltz2/predict
Hosted requests use . Supported local Docker
startup uses (or via the preflight) for
registry login, entitlement checks, and first-run model downloads; pass it
into the container with . Local inference requests use no
auth header after readiness. Warm-cache key-free startup varies by
image/version and should not be assumed.
Authorization: Bearer $NGC_API_KEYNGC_API_KEYNVIDIA_API_KEY-e NGC_API_KEY仅当上下文不明确时询问:
使用NVIDIA托管API还是本地Docker NIM?
- 托管版:
https://health.api.nvidia.com/v1/biology/mit/boltz2/predict - 本地版:
http://localhost:8000/biology/mit/boltz2/predict
托管版请求需使用认证。本地Docker启动时,需使用(或通过预检查使用)进行镜像仓库登录、权限校验及首次运行时的模型下载;通过将其传入容器。本地推理服务就绪后,请求无需携带认证头。免密钥的热缓存启动方式因镜像/版本而异,请勿默认依赖此方式。
Authorization: Bearer $NGC_API_KEYNGC_API_KEYNVIDIA_API_KEY-e NGC_API_KEYLocal Docker
本地Docker部署
For local setup answers, copy the preflight below before ,
, readiness, and the no-auth local request. Do not invent a cache
default or drop the load or fallback.
docker logindocker run.envNVIDIA_API_KEYbash
set -a
[ -f .env ] && . ./.env
set +a
if [ -z "${NGC_API_KEY:-}" ] && [ -n "${NVIDIA_API_KEY:-}" ]; then
export NGC_API_KEY="$NVIDIA_API_KEY"
fi
: "${NGC_API_KEY:?Set NGC_API_KEY or NVIDIA_API_KEY}"
: "${LOCAL_NIM_CACHE:?Set LOCAL_NIM_CACHE}"
echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin
mkdir -p "${LOCAL_NIM_CACHE}"
chmod 755 "${LOCAL_NIM_CACHE}"
docker run --rm --name boltz2 --gpus all \
--shm-size=16G \
-e NGC_API_KEY \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/mit/boltz2:1.6.0Readiness:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; doneFirst startup downloads about 30 GB of model weights.
如需本地部署指导,请在执行、、就绪检查及无认证本地请求前,复制以下预检查脚本。请勿自行设置缓存默认值,也不要省略文件加载或 fallback逻辑。
docker logindocker run.envNVIDIA_API_KEYbash
set -a
[ -f .env ] && . ./.env
set +a
if [ -z "${NGC_API_KEY:-}" ] && [ -n "${NVIDIA_API_KEY:-}" ]; then
export NGC_API_KEY="$NVIDIA_API_KEY"
fi
: "${NGC_API_KEY:?Set NGC_API_KEY or NVIDIA_API_KEY}"
: "${LOCAL_NIM_CACHE:?Set LOCAL_NIM_CACHE}"
echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin
mkdir -p "${LOCAL_NIM_CACHE}"
chmod 755 "${LOCAL_NIM_CACHE}"
docker run --rm --name boltz2 --gpus all \
--shm-size=16G \
-e NGC_API_KEY \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/mit/boltz2:1.6.0就绪检查:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done首次启动时将下载约30GB的模型权重。
Request Pattern
请求示例
python
import os
import requests
HOSTED = True
url = (
"https://health.api.nvidia.com/v1/biology/mit/boltz2/predict"
if HOSTED else "http://localhost:8000/biology/mit/boltz2/predict"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"polymers": [{
"id": "A",
"molecule_type": "protein",
"sequence": "MTEYKLVVVGACGVGKSALTIQLIQNHFVDEYDPT",
}],
"recycling_steps": 3,
"sampling_steps": 50,
"diffusion_samples": 1,
"step_scale": 1.638,
"output_format": "mmcif",
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()Payload essentials:
- Protein polymer: .
{"molecule_type": "protein", "sequence": "..."} - DNA/RNA polymer: add another polymer with
molecule_typeor"dna"."rna" - Ligand by SMILES: .
{"id": "L1", "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"} - Ligand by CCD: .
{"id": "L1", "ccd": "ATP"} - Affinity: set on exactly one ligand; report
"predict_affinity": True,affinity_pic50, andaffinity_pred_value.affinity_probability_binary - Precomputed A3M MSA goes under the protein polymer. The A3M record uses
,
alignment, andformat; do not use a stalerankfield.data
python
protein_with_msa = {
"id": "A",
"molecule_type": "protein",
"sequence": "MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPT",
"msa": {"msa_search": {"a3m": {
"alignment": ">query\nMTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPT",
"format": "a3m",
"rank": 0,
}}},
}python
import os
import requests
HOSTED = True
url = (
"https://health.api.nvidia.com/v1/biology/mit/boltz2/predict"
if HOSTED else "http://localhost:8000/biology/mit/boltz2/predict"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"polymers": [{
"id": "A",
"molecule_type": "protein",
"sequence": "MTEYKLVVVGACGVGKSALTIQLIQNHFVDEYDPT",
}],
"recycling_steps": 3,
"sampling_steps": 50,
"diffusion_samples": 1,
"step_scale": 1.638,
"output_format": "mmcif",
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()请求体要点:
- 蛋白质聚合物:。
{"molecule_type": "protein", "sequence": "..."} - DNA/RNA聚合物:添加另一个为
molecule_type或"dna"的聚合物。"rna" - 通过SMILES指定配体:。
{"id": "L1", "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"} - 通过CCD指定配体:。
{"id": "L1", "ccd": "ATP"} - 亲和力预测:仅对一个配体设置;结果将返回
"predict_affinity": True、affinity_pic50及affinity_pred_value字段。affinity_probability_binary - 预计算的A3M MSA需添加到蛋白质聚合物中。A3M记录需使用、
alignment和format字段;请勿使用过时的rank字段。data
python
protein_with_msa = {
"id": "A",
"molecule_type": "protein",
"sequence": "MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPT",
"msa": {"msa_search": {"a3m": {
"alignment": ">query\nMTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPT",
"format": "a3m",
"rank": 0,
}}},
}Save And Report Output
保存并报告结果
Save every artifact and read the confidence/affinity fields using the
snippet in under Save
Structures And Affinity. Visualize in PyMOL, ChimeraX, or UCSF Chimera. For
confidence/affinity sanity checks, read .
.cifreferences/examples.mdreferences/validation.md保存所有结果文件,并使用中Save Structures And Affinity部分的代码片段读取置信度/亲和力字段。可使用PyMOL、ChimeraX或UCSF Chimera进行可视化。如需对置信度/亲和力进行合理性校验,请参考。
.cifreferences/examples.mdreferences/validation.mdLimits And Troubleshooting
限制与故障排查
- Polymers/request: 12. Ligands/request: 20. Chain length: 4096 residues.
- Affinity prediction supports one ligand per request and adds runtime.
- : invalid sequence, invalid CCD/SMILES, malformed MSA, or multiple affinity ligands.
422 - Local URL/auth: local path has no hosted auth header; wait on .
/v1/health/ready - Local startup: use ,
--gpus all, and the--shm-size=16Gmount./opt/nim/.cache
- 每个请求最多支持12个聚合物、20个配体。链长上限为4096个残基。
- 亲和力预测每个请求仅支持一个配体,且会增加运行时间。
- 错误码:序列无效、CCD/SMILES无效、MSA格式错误,或指定了多个亲和力预测配体。
422 - 本地URL/认证:本地请求无需携带托管版的认证头;需等待接口返回就绪状态。
/v1/health/ready - 本地启动:需使用、
--gpus all参数,并挂载--shm-size=16G目录。/opt/nim/.cache