
NVIDIA/BioNeMo GenMol
NVIDIA NIM for GenMol molecule generation and scaffold decoration.
GenMol is a masked diffusion model trained on Sequential Attachment-based Fragment Embedding (SAFE) representations for fragment-based molecule generation, serving as a generalist tool across drug discovery tasks. It takes a SAFE-format molecular template as input — letting users specify fixed fragments to keep unchanged, attachment positions for new fragments, and desired fragment lengths — and generates novel drug-like molecules tailored to specific chemical properties through an iterative masking-unmasking process.
Call BioNeMo GenMol on Baseten using the NIM generation route.
Input
import os
import requests
MODEL_ID = os.environ["BASETEN_MODEL_ID"]
BASETEN_API_KEY = os.environ["BASETEN_API_KEY"]
BASETEN_URL = (
f"https://model-{MODEL_ID}.api.baseten.co/environments/production/sync"
"/generate"
)
payload = {
"smiles": "[C@H]1O[C@@H](CO)[C@H](O)[C@@H]1O.[*{15-15}]",
"num_molecules": 5,
"temperature": 1.0,
"noise": 1.0,
"scoring": "QED",
}
response = requests.post(
BASETEN_URL,
headers={
"Authorization": f"Bearer {BASETEN_API_KEY}",
"Content-Type": "application/json",
},
json=payload,
timeout=300,
)
response.raise_for_status()
result = response.json()
print(result)
Output
{
"status": "success",
"molecules": [
{
"smiles": "OC[C@@H]1O[CH][C@@H](O)[C@H]1O",
"score": 0.397
}
]
}