molmim-nim
NVIDIA/skills/skills/bionemo-molmim-nim/SKILL.md
Use this skill for MolMIM, NVIDIA's BioNeMo NIM microservice for small-molecule latent-space generation and optimization. Invoke for MolMIM, molecular embeddings, hidden states, latent decoding, sampling around a seed SMILES, CMA-ES guided molecule generation, QED or plogP optimization, hosted NVIDIA API calls, or local Docker deployment.
- Reads credentials
What's in it
- MolMIM NIM
- Choose Mode
- Local Docker
- Hosted Generation Pattern
- Local Latent Workflow
- Save And Validate Output
- Troubleshooting
Tools it asks for
- Bash
- Read
- Write
- AskUserQuestion
---
name: molmim-nim
description: >
Use this skill for MolMIM, NVIDIA's BioNeMo NIM microservice for small-molecule latent-space generation and optimization. Invoke for MolMIM, molecular embeddings, hidden states, latent decoding, sampling around a seed SMILES, CMA-ES guided molecule generation, QED or plogP optimization, hosted NVIDIA API calls, or local Docker deployment.
license: Apache-2.0 AND CC-BY-4.0
compatibility: "requests>=2.28; rdkit"
allowed-tools: Bash, Read, Write, AskUserQuestion
---
# MolMIM NIM
Generate, sample, embed, and decode small molecules with MolMIM. Use this
guide for first-pass hosted/local usage; load supplemental files only when
needed:
- `references/api.md`: endpoints, schema, Docker flags, response fields.
- `references/science.md`: use cases, strengths, limits, and handoffs.
- `references/parameters.md`: generation, sampling, and optimization effects.
- `references/validation.md`: SMILES/property/artifact checks.
- `references/examples.md`: compact hosted/local request patterns.
## Choose Mode
Ask only when context is unclear:
> Hosted NVIDIA API or local Docker NIM?
See [`references/api.md`](references/api.md) under **Endpoints** for the full
hosted/local endpoint list.
Mode difference: the hosted API reference exposes `/generate`; the local
container exposes the broader latent-space workflow (`/embedding`, `/hidden`,
`/decode`, `/sampling`, `/generate`). Do not invent hosted latent endpoints.
Hosted requests use `Authorization: Bearer $NGC_API_KEY`. Local inference uses
no auth header after readiness.
## Local Docker
Use shell env first; source repo-root `.env` only if present. Do not print keys.
MolMIM docs use `NGC_CLI_API_KEY` for the local container; this repo accepts
`NGC_API_KEY` or `NVIDIA_API_KEY` and maps to `NGC_CLI_API_KEY` for startup.
Mount `LOCAL_NIM_CACHE` at `/home/nvs/.cache/nim`.
For the exact startup preflight (the `NGC_API_KEY`/`NVIDIA_API_KEY` →
`NGC_CLI_API_KEY` mapping, `docker login`, and the `docker run` for
`nvcr.io/nim/nvidia/molmim:1.0.0`), copy the command block in
[`references/api.md`](references/api.md) under **Local Docker** verbatim.
Readiness check:
```bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done
```
Local embedding smoke test after readiness. Local inference uses no
`Authorization` header:
```python
import requests
seed = "CN1C=NC2=C1C(=O)N(C(=O)N2C)C"
response = requests.post(
"http://localhost:8000/embedding",
headers={"Content-Type": "application/json"},
json={"sequences": [seed]},
timeout=60,
)
response.raise_for_status()
embedding_data = response.json()
embeddings = embedding_data["embeddings"]
print(f"received {len(embeddings)} embedding vector(s)")
```
## Hosted Generation Pattern
Use hosted `/generate` for seed-SMILES generation or optimization. Use
`algorithm: "CMA-ES"` for guided property optimization and `algorithm: "none"`
for unguided sampling around the seed.
```python
import os
import requests
hosted = True
url = (
"https://health.api.nvidia.com/v1/biology/nvidia/molmim/generate"
if hosted else "http://localhost:8000/generate"
)
headers = {"Content-Type": "application/json"}
if hosted:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"smi": "CN1C=NC2=C1C(=O)N(C(=O)N2C)C",
"algorithm": "CMA-ES",
"num_molecules": 10,
"property_name": "QED",
"minimize": False,
"min_similarity": 0.4,
"particles": 8,
"iterations": 3,
}
response = requests.post(url, headers=headers, json=payload, timeout=180)
response.raise_for_status()
result = response.json()
```
Generation gotchas:
- Field name is `smi`, not `smiles`.
- `algorithm` is `"CMA-ES"` or `"none"`.
- `property_name` is `"QED"` or `"plogP"`.
- `num_molecules` is 1-100. `iterations` is 1-1000. `particles` is 2-1000.
- `min_similarity` is 0-1 in the hosted API reference; local docs emphasize
common values up to 0.7 for constrained optimization.
- `scaled_radius` is 0-2 and is mainly used with `algorithm: "none"` or local
`/sampling`.
## Local Latent Workflow
Use local-only endpoints for embedding, hidden-state manipulation, and decode.
This is also the surface used by the guided optimization example package.
For local latent workflows, state explicitly that the hosted API reference
exposes `/generate`; `/embedding`, `/hidden`, `/decode`, and `/sampling` are
local-only in the current docs.
```python
seed = "CC(Cc1ccc(cc1)C(C(=O)O)C)C"
base = "http://localhost:8000"
headers = {"Content-Type": "application/json"}
embedding = requests.post(
f"{base}/embedding",
headers=headers,
json={"sequences": [seed]},
timeout=60,
)
embedding.raise_for_status()
embedding_data = embedding.json()
embeddings = embedding_data["embeddings"]
print(f"received {len(embeddings)} embedding vector(s)")
hidden = requests.post(
f"{base}/hidden",
headers=headers,
json={"sequences": [seed]},
timeout=60,
)
hidden.raise_for_status()
hidden_data = hidden.json()
hiddens = hidden_data["hiddens"]
mask = hidden_data["mask"]
decoded = requests.post(
f"{base}/decode",
headers=headers,
json={"hiddens": hiddens, "mask": mask},
timeout=60,
)
decoded.raise_for_status()
sampled = requests.post(
f"{base}/sampling",
headers=headers,
json={"sequences": [seed], "num_molecules": 10, "scaled_radius": 0.7},
timeout=60,
)
sampled.raise_for_status()
```
## Save And Validate Output
Save generated SMILES and validate before using them downstream.
```python
from pathlib import Path
import json
def molmim_smiles(result):
values = []
if isinstance(result.get("generated"), list):
for item in result["generated"]:
if isinstance(item, str):
values.append(item)
elif isinstance(item, list):
values.extend(x for x in item if isinstance(x, str))
molecules = result.get("molecules")
if isinstance(molecules, str):
molecules = json.loads(molecules)
if isinstance(molecules, list):
for item in molecules:
if isinstance(item, dict) and isinstance(item.get("sample"), str):
values.append(item["sample"])
return values
generated = molmim_smiles(result)
if not generated:
raise RuntimeError(f"MolMIM returned no generated molecules: {result}")
Path("molmim_response.json").write_text(json.dumps(result, indent=2))
Path("molmim_generated.smi").write_text("\n".join(generated) + "\n")
for i, smiles in enumerate(generated, start=1):
print(i, smiles)
```
Use RDKit when available to check parseability, uniqueness, simple property
ranges, and whether seed similarity constraints are plausible. Generated
molecules are candidates, not validated hits; use downstream property, docking,
affinity, toxicity, and synthetic-feasibility checks before prioritization.
## Troubleshooting
- Hosted `404` on `/embedding`, `/hidden`, `/decode`, or `/sampling`: those
endpoints are local-only in the docs.
- `401`: missing or unauthorized NGC key for hosted requests.
- Hosted response parsing: live hosted `/generate` may return `molecules` as
a JSON string of `{sample, score}` objects, while local endpoints may return
`generated`; parse both.
- `422`: invalid SMILES, unsupported `algorithm`, invalid `property_name`, or
parameter outside documented ranges.
- Local startup auth: set `NGC_CLI_API_KEY`, or set `NGC_API_KEY`/`NVIDIA_API_KEY`
and map it as shown above.
- Local startup cache misses: mount `LOCAL_NIM_CACHE` to `/home/nvs/.cache/nim`,
not `/opt/nim/.cache`.
More agent context in NVIDIA/skills
406 other files this repository gives its agents, the first 60 shown.
Skill
- nvidia-skill-finderplugins/nvidia-skills/skills/nvidia-skill-finder/SKILL.md
- accelerated-computing-cudfskills/accelerated-computing-cudf/SKILL.md
- ambient-healthcare-agent-with-nemotron-voice-agentskills/ambient-healthcare-agent-with-nemotron-voice-agent/SKILL.md
- amc-run-rtsp-calibrationskills/amc-run-rtsp-calibration/SKILL.md
- amc-run-sample-calibrationskills/amc-run-sample-calibration/SKILL.md
- amc-run-video-calibrationskills/amc-run-video-calibration/SKILL.md
- amc-setup-calibration-stackskills/amc-setup-calibration-stack/SKILL.md
- boltz2-nimskills/bionemo-boltz2-nim/SKILL.md
- codonfm-embedskills/bionemo-codonfm-embed/SKILL.md
- codonfm-finetuneskills/bionemo-codonfm-finetune/SKILL.md
- codonfm-scoreskills/bionemo-codonfm-score/SKILL.md
- codonfm-setupskills/bionemo-codonfm-setup/SKILL.md
- diffdock-nimskills/bionemo-diffdock-nim/SKILL.md
- drug-discovery-pipelineskills/bionemo-drug-discovery-pipeline/SKILL.md
- evo2-nimskills/bionemo-evo2-nim/SKILL.md
- genmol-nimskills/bionemo-genmol-nim/SKILL.md
- kermt-add-cmim-pretrainskills/bionemo-kermt-add-cmim-pretrain/SKILL.md
- kermt-continue-pretrainskills/bionemo-kermt-continue-pretrain/SKILL.md
- kermt-embedskills/bionemo-kermt-embed/SKILL.md
- kermt-finetuneskills/bionemo-kermt-finetune/SKILL.md
- kermt-inferskills/bionemo-kermt-infer/SKILL.md
- kermt-monitorskills/bionemo-kermt-monitor/SKILL.md
- kermt-pretrain-scratchskills/bionemo-kermt-pretrain-scratch/SKILL.md
- kermt-setupskills/bionemo-kermt-setup/SKILL.md
- msa-search-nimskills/bionemo-msa-search-nim/SKILL.md
- msa-structure-prediction-pipelineskills/bionemo-msa-structure-prediction-pipeline/SKILL.md
- nvmolkit-usageskills/bionemo-nvmolkit-usage/SKILL.md
- openfold2-nimskills/bionemo-openfold2-nim/SKILL.md
- openfold3-nimskills/bionemo-openfold3-nim/SKILL.md
- proteinmpnn-nimskills/bionemo-proteinmpnn-nim/SKILL.md
- rfdiffusion-nimskills/bionemo-rfdiffusion-nim/SKILL.md
- cudaq-guideskills/cudaq-guide/SKILL.md
- cudaq-importingskills/cudaq-importing/SKILL.md
- cuopt-developerskills/cuopt-developer/SKILL.md
- cuopt-installskills/cuopt-install/SKILL.md
- cuopt-multi-objective-explorationskills/cuopt-multi-objective-exploration/SKILL.md
- cuopt-numerical-optimization-apiskills/cuopt-numerical-optimization-api/SKILL.md
- cuopt-numerical-optimization-formulationskills/cuopt-numerical-optimization-formulation/SKILL.md
- cuopt-routing-api-pythonskills/cuopt-routing-api-python/SKILL.md
- cuopt-server-api-pythonskills/cuopt-server-api-python/SKILL.md
- dali-dynamic-modeskills/dali-dynamic-mode/SKILL.md
- data-designerskills/data-designer/SKILL.md
- deepstream-devskills/deepstream-dev/SKILL.md
- deepstream-generate-pipelineskills/deepstream-generate-pipeline/SKILL.md
- deepstream-import-vision-modelskills/deepstream-import-vision-model/SKILL.md
- deepstream-profile-pipelineskills/deepstream-profile-pipeline/SKILL.md
- deepstream-run-mv3dtskills/deepstream-run-mv3dt/SKILL.md
- deepstream-sopskills/deepstream-sop/SKILL.md
- dicom-metadata-extractskills/dicom-metadata-extract/SKILL.md
- dicom-series-preflightskills/dicom-series-preflight/SKILL.md
- dicom-series-to-volumeskills/dicom-series-to-volume/SKILL.md
- digital-health-clinical-asr-buildskills/digital-health-clinical-asr-build/SKILL.md
- digital-health-clinical-asr-evalskills/digital-health-clinical-asr-eval/SKILL.md
- digital-health-clinical-asr-finetuneskills/digital-health-clinical-asr-finetune/SKILL.md
- digital-health-clinical-asr-setupskills/digital-health-clinical-asr-setup/SKILL.md
- doca-aes-gcmskills/doca-aes-gcm/SKILL.md
- doca-argpskills/doca-argp/SKILL.md
- doca-argusskills/doca-argus/SKILL.md
- doca-bare-metal-deploymentskills/doca-bare-metal-deployment/SKILL.md
Discussion
Talked about elsewhere, linking to NVIDIA/skills
- docs(skills): deprecate vss-deploy-profile in favour of vss-build-vis…
GitHub · NVIDIA-AI-Blueprints/video-search-and-summarization · 1 reactions · 3 comments · Sep 9, 2026
- Onboard IsaacLab skills for NVCARPS compatibility
GitHub · isaac-sim/IsaacLab · 1 reactions · 4 comments · Aug 14, 2026
- Fix NVSkills workflow permissions [skip ci]
GitHub · NVIDIA/cudf-spark · 1 reactions · 2 comments · Aug 14, 2026
- NVSkills Request CI Workflow [skip ci]
GitHub · NVIDIA/cudf-spark · 1 reactions · 2 comments · Jul 2, 2026
- Publish Skill Card Generator as an installable Agent Skill
GitHub · NVIDIA/Trustworthy-AI · 1 reactions · 3 comments · May 22, 2026
- Provide official CCCL SKILLs
GitHub · NVIDIA/cccl · 1 reactions · 2 comments · May 22, 2026
- Document that the dali-dynamic-mode skill exists
GitHub · NVIDIA/DALI · 1 reactions · 15 comments · May 20, 2026
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

