Model details
View repositoryGenMol 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.
1import os
2import requests
3
4MODEL_ID = os.environ["BASETEN_MODEL_ID"]
5BASETEN_API_KEY = os.environ["BASETEN_API_KEY"]
6BASETEN_URL = (
7 f"https://model-{MODEL_ID}.api.baseten.co/environments/production/sync"
8 "/generate"
9)
10
11payload = {
12 "smiles": "[C@H]1O[C@@H](CO)[C@H](O)[C@@H]1O.[*{15-15}]",
13 "num_molecules": 5,
14 "temperature": 1.0,
15 "noise": 1.0,
16 "scoring": "QED",
17}
18
19response = requests.post(
20 BASETEN_URL,
21 headers={
22 "Authorization": f"Bearer {BASETEN_API_KEY}",
23 "Content-Type": "application/json",
24 },
25 json=payload,
26 timeout=300,
27)
28response.raise_for_status()
29result = response.json()
30print(result)
311{
2 "status": "success",
3 "molecules": [
4 {
5 "smiles": "OC[C@@H]1O[CH][C@@H](O)[C@H]1O",
6 "score": 0.397
7 }
8 ]
9}