A FastAPI-based API that uses pre-trained model from the ASKCOS project for forward prediction.
Docker image can be found at: https://hub.docker.com/r/ai4greeneln/forward_prediction
-
Install dependencies
# Install uv package manager pip install uv # Install project dependencies using uv uv sync
Check this for installing uv.
-
Download trained models
chmod +x download_trained_models.sh ./download_trained_models.sh
-
Run the application
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Build the image
docker build -t forward-prediction-api:latest . -
Run the container
docker run -d --name forward-prediction-api \ -p 8000:8000 \ -e AUTH_ENABLED=false \ forward-prediction-api:latest
Headers:
X-API-Key: API key for auth (optional)
Request body:
{
"smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"
}Example:
curl -X POST "http://localhost:8000/api/predict" \
-H "Content-Type: application/json" \
-d '{"smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"}'