This a dockerized API to expose a scikit model with fastAPI (dummy model with Iris dataset).
Install Anaconda local environment as below:
./install.sh
Set Anaconda local environment as ${PWD}/.conda
as Python interpreter of the project (using PyCharm)
main.py
schemas.py
processing.py
models/
config/
Clone repo
Change inputs format in schemas.py (& outputs if needed)
Change processing code if needed.
Train & pickle (with joblib) a scikit model and store it in app/model folder. Be sure to use the same version of scikit during training & inference.
Build & run docker image (see below)
cd generic_api
docker build -t generic_api .
docker run -d -p 80:80 generic_api
Your API documentation is available at http://127.0.0.1/docs
See DEPLOYMENT.md for simple Azure deployment.