AI-assisted drug discovery MVP built with Next.js.
/Generate candidate molecules from a query:like: generate candidates structurally similar to a reference drugfor: generate candidates for a disease/condition hypothesis
/editorDraw molecules in ChemDoodle and request pharmacological property predictions- Server-side API routes:
POST /api/generatecalls Claude and returns normalized candidatesPOST /api/predictruns local MLM-FG SIDER inference bridge
Create a .env.local file in the project root:
ANTHROPIC_API_KEY=your_anthropic_api_key
ANTHROPIC_MODEL=claude-3-5-haiku-latest
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-3-flash-preview
GEMINI_EDIT_MODEL=gemini-3-flash-preview
IUPAC_PYTHON_BIN=python3
IUPAC_TIMEOUT_MS=12000
MLM_FG_PYTHON_BIN=python3
MLM_FG_INFER_SCRIPT_PATH=mlm-fg-sider-app/backend/mlm_fg_infer_once.pyNotes:
ANTHROPIC_API_KEYis required forPOST /api/generate.GEMINI_API_KEYis required for Gemini-powered Magic Edit in the editor.GEMINI_EDIT_MODELcontrols Magic Edit model in the editor (defaults toGEMINI_MODEL, thengemini-3-flash-preview).- IUPAC naming uses STOUT (Python package). Install with
pip install STOUT-pypi. IUPAC_PYTHON_BINchooses which Python executable runs STOUT.IUPAC_TIMEOUT_MScontrols the naming timeout per molecule.MLM_FG_PYTHON_BIN/MLM_FG_INFER_SCRIPT_PATHshould point to the MLM-FG bridge runner.- All keys remain server-side and are never exposed to the browser.
npm install
npm run devOpen http://localhost:3000.
Request:
{
"mode": "like",
"query": "Ibuprofen",
"maxCandidates": 6
}Response:
{
"mode": "like",
"query": "Ibuprofen",
"generatedAt": "2026-04-11T00:00:00.000Z",
"candidates": [
{
"id": "cand-1",
"smiles": "CC(C)CC1=CC=C(C=C1)C(C)C(=O)O",
"rationale": "Brief scientific reasoning.",
"confidence": "medium",
"properties": {
"molecularWeight": 206.28,
"logP": 3.5,
"tpsa": 37.3,
"hBondDonors": 1,
"hBondAcceptors": 2,
"rotatableBonds": 4
}
}
]
}Request:
{
"structure": "CC(=O)OC1=CC=CC=C1C(=O)O",
"encoding": "smiles"
}Response:
{
"input": {
"structure": "CCO",
"encoding": "smiles"
},
"model": "MLM-FG",
"predictedAt": "2026-04-11T00:00:00.000Z",
"sideEffectScores": [
{ "label": "Nervous system disorders", "score": 0.734 },
{ "label": "Cardiac disorders", "score": 0.521 }
],
"mock": false,
"smokeTrained": false
}- To use real MLM-FG inference, install backend deps and configure checkpoint env vars expected by
mlm-fg-sider-app/backend/mlm_fg_predictor.py. - You must train your MLM-FG based model yourself, which is not provided in the repo due to large file sizes.