Skip to content

LittleWhole/Tseda

Repository files navigation

Tseda

AI-assisted drug discovery MVP built with Next.js.

Features

  • / Generate candidate molecules from a query:
    • like: generate candidates structurally similar to a reference drug
    • for: generate candidates for a disease/condition hypothesis
  • /editor Draw molecules in ChemDoodle and request pharmacological property predictions
  • Server-side API routes:
    • POST /api/generate calls Claude and returns normalized candidates
    • POST /api/predict runs local MLM-FG SIDER inference bridge

Environment Variables

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.py

Notes:

  • ANTHROPIC_API_KEY is required for POST /api/generate.
  • GEMINI_API_KEY is required for Gemini-powered Magic Edit in the editor.
  • GEMINI_EDIT_MODEL controls Magic Edit model in the editor (defaults to GEMINI_MODEL, then gemini-3-flash-preview).
  • IUPAC naming uses STOUT (Python package). Install with pip install STOUT-pypi.
  • IUPAC_PYTHON_BIN chooses which Python executable runs STOUT.
  • IUPAC_TIMEOUT_MS controls the naming timeout per molecule.
  • MLM_FG_PYTHON_BIN/MLM_FG_INFER_SCRIPT_PATH should point to the MLM-FG bridge runner.
  • All keys remain server-side and are never exposed to the browser.

Local Development

npm install
npm run dev

Open http://localhost:3000.

API Contracts

POST /api/generate

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
      }
    }
  ]
}

POST /api/predict

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
}

MLM-FG Integration Notes

  • 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.

About

Generate drugs and predict their pharmacological properties

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors