rfdiffusion-nim

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

RFDiffusion NIM

RFDiffusion NIM

Design protein backbone PDBs for de novo proteins, motif scaffolds, and binders. Use this
SKILL.md
for first-pass hosted/local usage; load supplemental files only when needed:
  • references/api.md
    : exact endpoints, schemas, Docker flags, response fields.
  • references/science.md
    : design modes, strengths, limits, and handoffs.
  • references/parameters.md
    : contigs, hotspots, steps, and seeds.
  • references/validation.md
    : PDB, contig, and artifact sanity checks.
  • references/examples.md
    : compact hosted/local request patterns.
为从头设计的蛋白质、基序支架和结合体设计蛋白质骨架PDB文件。 使用本
SKILL.md
进行首次托管/本地使用;仅在需要时加载补充文件:
  • references/api.md
    :精确的端点、模式、Docker参数、响应字段。
  • references/science.md
    :设计模式、优势、局限性及交接说明。
  • references/parameters.md
    :contigs、热点残基、扩散步骤及随机种子。
  • references/validation.md
    :PDB文件、contigs及产物合理性检查。
  • 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
/v1/
. Hosted requests use
Authorization: Bearer $NGC_API_KEY
. Supported local Docker startup uses
NGC_API_KEY
(or
NVIDIA_API_KEY
via the preflight) for registry login, entitlement checks, and first-run model downloads; pass it into the container with
-e NGC_API_KEY
. Local inference requests use no auth header after readiness. Warm-cache key-free startup varies by image/version and should not be assumed.
仅在上下文不明确时询问:
使用NVIDIA托管API还是本地Docker NIM?
  • 托管版:
    https://health.api.nvidia.com/v1/biology/ipd/rfdiffusion/generate
  • 本地版:
    http://localhost:8000/biology/ipd/rfdiffusion/generate
本地推理路径不包含
/v1/
。托管请求需使用
Authorization: Bearer $NGC_API_KEY
。本地Docker启动需使用
NGC_API_KEY
(或通过预检查使用
NVIDIA_API_KEY
)进行镜像仓库登录、权限验证及首次运行时的模型下载;需通过
-e NGC_API_KEY
将其传入容器。本地推理请求在就绪后无需认证头。无缓存密钥的预热启动方式因镜像/版本而异,不应默认依赖。

Local Docker

本地Docker部署

For local setup answers, copy the preflight below exactly before
docker login
,
docker run
, readiness, and the no-auth local request. Do not replace it with a simple
: "${NGC_API_KEY:?Set NGC_API_KEY}"
check, do not invent a cache default, and do not drop the
NVIDIA_API_KEY
fallback. Default setup is single GPU
device=0
.
bash
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
Readiness:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done
如需本地设置相关解答,请在
docker login
docker run
、就绪检查及无认证本地请求前,严格复制以下预检查脚本。请勿将其替换为简单的
: "${NGC_API_KEY:?Set NGC_API_KEY}"
检查,请勿自行设置缓存默认值,请勿省略
NVIDIA_API_KEY
回退选项。默认设置为单GPU
device=0
bash
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; done

Contigs DSL

Contigs领域特定语言(DSL)

contigs
defines what to keep and what to generate. For the full pattern syntax (fixed length, ranges, kept chain segments, chain breaks), see
references/api.md
under Contigs Language Reference.
Design modes:
  • De novo:
    contigs="80-120"
    ; live hosted validation requires a non-empty
    input_pdb
    or
    input_pdb_asset
    , so inline requests should include the dummy PDB below.
  • Motif scaffolding: read
    target.pdb
    , pass
    input_pdb
    , use a contig like
    "A25-35/0 50-80"
    .
  • Binder design: pass target
    input_pdb
    , contig with target and binder segment, and
    hotspot_res=["A50", "A51", ...]
    in ChainResidue string format.
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"
)
contigs
用于定义保留和生成的区域。完整的模式语法(固定长度、范围、保留链段、链断裂)请参见
references/api.md
中的Contigs语言参考部分。
设计模式:
  • 从头设计:
    contigs="80-120"
    ;托管版实时验证要求非空的
    input_pdb
    input_pdb_asset
    ,因此在线请求需包含以下虚拟PDB文件。
  • 基序支架设计:读取
    target.pdb
    ,传入
    input_pdb
    ,使用类似
    "A25-35/0 50-80"
    的contigs参数。
  • 结合体设计:传入目标
    input_pdb
    ,包含目标和结合体片段的contigs参数,以及ChainResidue字符串格式的
    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
result["output_pdb"]
as a PDB artifact and report
elapsed_ms
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
references/validation.md
.
result["output_pdb"]
保存为PDB产物,若存在
elapsed_ms
则报告该值。生成的骨架并非最终蛋白质;需将其输入ProteinMPNN进行序列设计,随后使用Boltz2或OpenFold3验证序列/结构。有关PDB文件和contigs的检查,请参阅
references/validation.md

Limits And Troubleshooting

限制与故障排除

  • diffusion_steps
    : 1-50; 50 is maximum quality, fewer is faster.
  • Single GPU; minimum GPU VRAM is about 12 GB.
  • hotspot_res
    uses strings like
    "A50"
    , not tuples.
  • 422
    usually means chain IDs in
    contigs
    /
    hotspot_res
    do not match
    input_pdb
    , a malformed contig, or omitted
    input_pdb
    for hosted de novo.
  • Local URL 404 usually means an accidental
    /v1/
    prefix.
  • diffusion_steps
    :取值1-50;50为最高质量,数值越少速度越快。
  • 仅支持单GPU;最低GPU显存约为12 GB。
  • hotspot_res
    需使用类似
    "A50"
    的字符串格式,而非元组。
  • 错误码
    422
    通常意味着
    contigs
    /
    hotspot_res
    中的链ID与
    input_pdb
    不匹配、contigs格式错误,或托管版从头设计时遗漏了
    input_pdb
  • 本地URL返回404通常是因为意外添加了
    /v1/
    前缀。