rfdiffusion-nim
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRFDiffusion NIM
RFDiffusion NIM
Design protein backbone PDBs for de novo proteins, motif scaffolds, and binders.
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 - : design modes, strengths, limits, and handoffs.
references/science.md - : contigs, hotspots, steps, and seeds.
references/parameters.md - : PDB, contig, and artifact sanity checks.
references/validation.md - : compact hosted/local request patterns.
references/examples.md
为从头设计的蛋白质、基序支架和结合体设计蛋白质骨架PDB文件。
使用本进行首次托管/本地使用;仅在需要时加载补充文件:
SKILL.md- :精确的端点、模式、Docker参数、响应字段。
references/api.md - :设计模式、优势、局限性及交接说明。
references/science.md - :contigs、热点残基、扩散步骤及随机种子。
references/parameters.md - :PDB文件、contigs及产物合理性检查。
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/ipd/rfdiffusion/generate - Local:
http://localhost:8000/biology/ipd/rfdiffusion/generate
Local inference paths do not include . 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.
/v1/Authorization: Bearer $NGC_API_KEYNGC_API_KEYNVIDIA_API_KEY-e NGC_API_KEY仅在上下文不明确时询问:
使用NVIDIA托管API还是本地Docker NIM?
- 托管版:
https://health.api.nvidia.com/v1/biology/ipd/rfdiffusion/generate - 本地版:
http://localhost:8000/biology/ipd/rfdiffusion/generate
本地推理路径不包含。托管请求需使用。本地Docker启动需使用(或通过预检查使用)进行镜像仓库登录、权限验证及首次运行时的模型下载;需通过将其传入容器。本地推理请求在就绪后无需认证头。无缓存密钥的预热启动方式因镜像/版本而异,不应默认依赖。
/v1/Authorization: Bearer $NGC_API_KEYNGC_API_KEYNVIDIA_API_KEY-e NGC_API_KEYLocal Docker
本地Docker部署
For local setup answers, copy the preflight below exactly before ,
, readiness, and the no-auth local request. Do not replace it with a
simple check, do not invent a cache
default, and do not drop the fallback. Default setup is single
GPU .
docker logindocker run: "${NGC_API_KEY:?Set NGC_API_KEY}"NVIDIA_API_KEYdevice=0bash
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 -it \
--runtime=nvidia \
--gpus "device=0" \
-e NGC_API_KEY \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/ipd/rfdiffusion:2Readiness:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done如需本地设置相关解答,请在、、就绪检查及无认证本地请求前,严格复制以下预检查脚本。请勿将其替换为简单的检查,请勿自行设置缓存默认值,请勿省略回退选项。默认设置为单GPU 。
docker logindocker run: "${NGC_API_KEY:?Set NGC_API_KEY}"NVIDIA_API_KEYdevice=0bash
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 -it \
--runtime=nvidia \
--gpus "device=0" \
-e NGC_API_KEY \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/ipd/rfdiffusion:2就绪检查:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; doneContigs DSL
Contigs领域特定语言(DSL)
contigsreferences/api.mdDesign modes:
- De novo: ; live hosted validation requires a non-empty
contigs="80-120"orinput_pdb, so inline requests should include the dummy PDB below.input_pdb_asset - Motif scaffolding: read , pass
target.pdb, use a contig likeinput_pdb."A25-35/0 50-80" - Binder design: pass target , contig with target and binder segment, and
input_pdbin ChainResidue string format.hotspot_res=["A50", "A51", ...]
python
DUMMY_PDB = (
"CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 1\n"
"ATOM 1 CA ALA A 1 0.000 0.000 0.000 1.00 0.00 C\n"
"END\n"
)contigsreferences/api.md设计模式:
- 从头设计:;托管版实时验证要求非空的
contigs="80-120"或input_pdb,因此在线请求需包含以下虚拟PDB文件。input_pdb_asset - 基序支架设计:读取,传入
target.pdb,使用类似input_pdb的contigs参数。"A25-35/0 50-80" - 结合体设计:传入目标,包含目标和结合体片段的contigs参数,以及ChainResidue字符串格式的
input_pdb。hotspot_res=["A50", "A51", ...]
python
DUMMY_PDB = (
"CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 1\n"
"ATOM 1 CA ALA A 1 0.000 0.000 0.000 1.00 0.00 C\n"
"END\n"
)Request Pattern
请求示例
python
import os
from pathlib import Path
import requests
HOSTED = True
url = (
"https://health.api.nvidia.com/v1/biology/ipd/rfdiffusion/generate"
if HOSTED else "http://localhost:8000/biology/ipd/rfdiffusion/generate"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"input_pdb": DUMMY_PDB,
"contigs": "80-120",
"diffusion_steps": 50,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()
Path("designed_backbone.pdb").write_text(result["output_pdb"])Motif scaffold:
python
payload = {
"input_pdb": Path("target.pdb").read_text(),
"contigs": "A25-35/0 50-80",
"diffusion_steps": 50,
}Binder design:
python
payload = {
"input_pdb": Path("target.pdb").read_text(),
"contigs": "A1-100/0 50-100",
"hotspot_res": ["A50", "A51", "A52", "A53", "A54"],
"diffusion_steps": 50,
}python
import os
from pathlib import Path
import requests
HOSTED = True
url = (
"https://health.api.nvidia.com/v1/biology/ipd/rfdiffusion/generate"
if HOSTED else "http://localhost:8000/biology/ipd/rfdiffusion/generate"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"input_pdb": DUMMY_PDB,
"contigs": "80-120",
"diffusion_steps": 50,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()
Path("designed_backbone.pdb").write_text(result["output_pdb"])基序支架设计请求:
python
payload = {
"input_pdb": Path("target.pdb").read_text(),
"contigs": "A25-35/0 50-80",
"diffusion_steps": 50,
}结合体设计请求:
python
payload = {
"input_pdb": Path("target.pdb").read_text(),
"contigs": "A1-100/0 50-100",
"hotspot_res": ["A50", "A51", "A52", "A53", "A54"],
"diffusion_steps": 50,
}Save And Interpret Output
保存与解读输出
Save as a PDB artifact and report when
present. Generated backbones are not final proteins; feed them to ProteinMPNN
for sequence design, then validate sequences/structures with Boltz2 or
OpenFold3. For PDB and contig checks, read .
result["output_pdb"]elapsed_msreferences/validation.md将保存为PDB产物,若存在则报告该值。生成的骨架并非最终蛋白质;需将其输入ProteinMPNN进行序列设计,随后使用Boltz2或OpenFold3验证序列/结构。有关PDB文件和contigs的检查,请参阅。
result["output_pdb"]elapsed_msreferences/validation.mdLimits And Troubleshooting
限制与故障排除
- : 1-50; 50 is maximum quality, fewer is faster.
diffusion_steps - Single GPU; minimum GPU VRAM is about 12 GB.
- uses strings like
hotspot_res, not tuples."A50" - usually means chain IDs in
422/contigsdo not matchhotspot_res, a malformed contig, or omittedinput_pdbfor hosted de novo.input_pdb - Local URL 404 usually means an accidental prefix.
/v1/
- :取值1-50;50为最高质量,数值越少速度越快。
diffusion_steps - 仅支持单GPU;最低GPU显存约为12 GB。
- 需使用类似
hotspot_res的字符串格式,而非元组。"A50" - 错误码通常意味着
422/contigs中的链ID与hotspot_res不匹配、contigs格式错误,或托管版从头设计时遗漏了input_pdb。input_pdb - 本地URL返回404通常是因为意外添加了前缀。
/v1/