{"id":17473,"plugin_id":"plugins_6a76572d8f8081918362aa7ff90947fb","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T23:14:13.747Z","digest":"659ac95b6de8f2b071de3ffb57aafb2097ce6e92363a69409228051153b65e4d","against":null,"payload":{"description":"Use Boltz2 NIM for biomolecular structure prediction and binding affinity. Invoke for Boltz2, protein structures, protein-ligand/DNA/RNA complexes, SMILES or CCD ligands, pIC50/IC50 affinity scoring, mmCIF output, hosted NVIDIA API calls, or local Docker deployment.","included_files":[{"relative_path":"references/api.md","size_in_bytes":5786},{"relative_path":"references/examples.md","size_in_bytes":2086},{"relative_path":"references/parameters.md","size_in_bytes":1707},{"relative_path":"references/science.md","size_in_bytes":1752},{"relative_path":"references/validation.md","size_in_bytes":1321}],"name":"boltz2-nim","skill_md_contents":"---\nname: boltz2-nim\ndescription: >\n  Use Boltz2 NIM for biomolecular structure prediction and binding affinity. Invoke for Boltz2, protein structures, protein-ligand/DNA/RNA complexes, SMILES or CCD ligands, pIC50/IC50 affinity scoring, mmCIF output, hosted NVIDIA API calls, or local Docker deployment.\nlicense: Apache-2.0 AND CC-BY-4.0\ncompatibility: \"requests>=2.28\"\nallowed-tools: Bash, Read, Write, AskUserQuestion\n---\n\n# Boltz2 NIM\n\nPredict biomolecular structures and optional ligand affinity. Use this\n`SKILL.md` for first-pass hosted/local usage; load supplemental files only when\nneeded:\n\n- `references/api.md`: exact endpoints, schemas, Docker flags, response fields.\n- `references/science.md`: purpose, strengths, limitations, and handoffs.\n- `references/parameters.md`: prediction, sampling, MSA, template, affinity tuning.\n- `references/validation.md`: mmCIF, confidence, affinity, and chemistry checks.\n- `references/examples.md`: compact hosted/local payload patterns.\n\n## Choose Mode\n\nAsk only when context is unclear:\n\n> Hosted NVIDIA API or local Docker NIM?\n\n- Hosted: `https://health.api.nvidia.com/v1/biology/mit/boltz2/predict`\n- Local: `http://localhost:8000/biology/mit/boltz2/predict`\n\nHosted requests use `Authorization: Bearer $NGC_API_KEY`. Supported local Docker\nstartup uses `NGC_API_KEY` (or `NVIDIA_API_KEY` via the preflight) for\nregistry login, entitlement checks, and first-run model downloads; pass it\ninto the container with `-e NGC_API_KEY`. Local inference requests use no\nauth header after readiness. Warm-cache key-free startup varies by\nimage/version and should not be assumed.\n\n## Local Docker\n\nFor local setup answers, copy the preflight below before `docker login`,\n`docker run`, readiness, and the no-auth local request. Do not invent a cache\ndefault or drop the `.env` load or `NVIDIA_API_KEY` fallback.\n\n```bash\nset -a\n[ -f .env ] && . ./.env\nset +a\n\nif [ -z \"${NGC_API_KEY:-}\" ] && [ -n \"${NVIDIA_API_KEY:-}\" ]; then\n  export NGC_API_KEY=\"$NVIDIA_API_KEY\"\nfi\n: \"${NGC_API_KEY:?Set NGC_API_KEY or NVIDIA_API_KEY}\"\n: \"${LOCAL_NIM_CACHE:?Set LOCAL_NIM_CACHE}\"\n\necho \"$NGC_API_KEY\" | docker login nvcr.io --username '$oauthtoken' --password-stdin\n\nmkdir -p \"${LOCAL_NIM_CACHE}\"\nchmod 777 \"${LOCAL_NIM_CACHE}\"\n\ndocker run --rm --name boltz2 --gpus all \\\n  --shm-size=16G \\\n  -e NGC_API_KEY \\\n  -v \"${LOCAL_NIM_CACHE}:/opt/nim/.cache\" \\\n  -p 8000:8000 \\\n  nvcr.io/nim/mit/boltz2:1.6.0\n```\n\nReadiness:\n\n```bash\nuntil curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done\n```\n\nFirst startup downloads about 30 GB of model weights.\n\n## Request Pattern\n\n```python\nimport os\nimport requests\n\nHOSTED = True\nurl = (\n    \"https://health.api.nvidia.com/v1/biology/mit/boltz2/predict\"\n    if HOSTED else \"http://localhost:8000/biology/mit/boltz2/predict\"\n)\nheaders = {\"Content-Type\": \"application/json\"}\nif HOSTED:\n    headers[\"Authorization\"] = f\"Bearer {os.environ['NGC_API_KEY']}\"\n\npayload = {\n    \"polymers\": [{\n        \"id\": \"A\",\n        \"molecule_type\": \"protein\",\n        \"sequence\": \"MTEYKLVVVGACGVGKSALTIQLIQNHFVDEYDPT\",\n    }],\n    \"recycling_steps\": 3,\n    \"sampling_steps\": 50,\n    \"diffusion_samples\": 1,\n    \"step_scale\": 1.638,\n    \"output_format\": \"mmcif\",\n}\nresponse = requests.post(url, headers=headers, json=payload, timeout=300)\nresponse.raise_for_status()\nresult = response.json()\n```\n\nPayload essentials:\n\n- Protein polymer: `{\"molecule_type\": \"protein\", \"sequence\": \"...\"}`.\n- DNA/RNA polymer: add another polymer with `molecule_type` `\"dna\"` or `\"rna\"`.\n- Ligand by SMILES: `{\"id\": \"L1\", \"smiles\": \"CC(=O)OC1=CC=CC=C1C(=O)O\"}`.\n- Ligand by CCD: `{\"id\": \"L1\", \"ccd\": \"ATP\"}`.\n- Affinity: set `\"predict_affinity\": True` on exactly one ligand; report\n  `affinity_pic50`, `affinity_pred_value`, and `affinity_probability_binary`.\n- Precomputed A3M MSA goes under the protein polymer. The A3M record uses\n  `alignment`, `format`, and `rank`; do not use a stale `data` field.\n\n```python\nprotein_with_msa = {\n    \"id\": \"A\",\n    \"molecule_type\": \"protein\",\n    \"sequence\": \"MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPT\",\n    \"msa\": {\"msa_search\": {\"a3m\": {\n        \"alignment\": \">query\\nMTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPT\",\n        \"format\": \"a3m\",\n        \"rank\": 0,\n    }}},\n}\n```\n\n## Save And Report Output\n\n```python\nfor i, structure in enumerate(result[\"structures\"], start=1):\n    with open(f\"structure_{i}.cif\", \"w\", encoding=\"utf-8\") as handle:\n        handle.write(structure[\"structure\"])\nfor i, score in enumerate(result.get(\"confidence_scores\", []), start=1):\n    print(f\"structure {i} confidence {score:.4f}\")\nif \"affinities\" in result:\n    for ligand_id, aff in result[\"affinities\"].items():\n        print(ligand_id, aff[\"affinity_pic50\"][0], aff[\"affinity_pred_value\"][0], aff[\"affinity_probability_binary\"][0])\n```\n\nSave every `.cif` artifact. Visualize in PyMOL, ChimeraX, or UCSF Chimera. For\nconfidence/affinity sanity checks, read `references/validation.md`.\n\n## Limits And Troubleshooting\n\n- Polymers/request: 12. Ligands/request: 20. Chain length: 4096 residues.\n- Affinity prediction supports one ligand per request and adds runtime.\n- `422`: invalid sequence, invalid CCD/SMILES, malformed MSA, or multiple\n  affinity ligands.\n- Local URL/auth: local path has no hosted auth header; wait on `/v1/health/ready`.\n- Local startup: use `--gpus all`, `--shm-size=16G`, and the `/opt/nim/.cache` mount.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}