biology
BioNeMo MolMIM
NVIDIA NIM for MolMIM molecule generation, embedding, and property optimization.
Model details
View repositoryExample usage
Call BioNeMo MolMIM on Baseten using the NIM molecule generation route.
Note: You need to procure your own NVAIE licenses to access this NIM.
Input
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 "smi": "CN1C=NC2=C1C(=O)N(C(=O)N2C)C",
13 "algorithm": "CMA-ES",
14 "num_molecules": 5,
15 "property_name": "QED",
16 "minimize": False,
17 "min_similarity": 0.4,
18 "particles": 8,
19 "iterations": 3,
20}
21
22response = requests.post(
23 BASETEN_URL,
24 headers={
25 "Authorization": f"Bearer {BASETEN_API_KEY}",
26 "Content-Type": "application/json",
27 },
28 json=payload,
29 timeout=300,
30)
31response.raise_for_status()
32result = response.json()
33print(result)
34JSON output
1{
2 "generated": [
3 "<SMILES>",
4 "<SMILES>"
5 ]
6}