Skip to content

Forward Prediction API for the AI4Green4Students

Notifications You must be signed in to change notification settings

AI4Green/forward-prediction-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forward Prediction API

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

Local Development

  1. Install dependencies

    # Install uv package manager
    pip install uv
    
    # Install project dependencies using uv
    uv sync

    Check this for installing uv.

  2. Download trained models

    chmod +x download_trained_models.sh
    ./download_trained_models.sh
  3. Run the application

    uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Docker Deployment

  1. Build the image

    docker build -t forward-prediction-api:latest .
  2. Run the container

    docker run -d --name forward-prediction-api \
      -p 8000:8000 \
      -e AUTH_ENABLED=false \
      forward-prediction-api:latest

API Endpoint

POST /api/predict

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"}'

About

Forward Prediction API for the AI4Green4Students

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •