Skip to content

Getting Started with the Reward Server

The Reward Server is a FastAPI application that evaluates molecular structures based on various scoring functions including docking, drug-likeness, and bioactivity predictions.

Starting the Server

Note

For GPU-accelerated docking, ensure AutoDock-GPU is installed (follow https://github.com/ccsb-scripps/AutoDock-GPU for installation instructions).

Set required environment variables (see here for all options):

export DOCKING_ORACLE=autodock_gpu
export DATA_PATH=data

Start the server:

uvicorn --host 0.0.0.0 --port 8000 mol_gen_docking.server:app

You should see:

INFO:     Uvicorn running on http://0.0.0.0:8000
INFO:     Application startup complete

Basic Usage

Python Client

import requests

response = requests.post(
    "http://localhost:8000/get_reward",
    json={
        "query": "<answer>CC(C)Cc1ccc(cc1)C(C)C(=O)O</answer>",
        "prompt": "[Textual prompt used to generate the molecule]",
        "metadata": [
             {
                 "properties": ["sample_654138_model_0", "CalcExactMolWt"],
                 "objectives": ["below", "below"],
                 "target": [-10.86, 197.27]
             }
        ]
    }
)

Next Steps