
I was using Flask few months ago, but when I discover FASTAPI my life change
The official documentation :
https://fastapi.tiangolo.com/tutorial/
To create a very easy and quick API on Python.
Select your python version, interpreter, and packge isntall pip or pip3
- Create folder
- Create git init
- Create via pip3 virtual environment :
https://realpython.com/python-virtual-environments-a-primer/
# Python 3
$ python3 -m venv env
4. Install FastAPI lib and uviocorn
check that whole packe are installed on env/lib/bin
And run the code.
That’s all folks!

I will try to deploy a decision tree classifier model in my local machine and use predict via postman, the original post is :
https://towardsdatascience.com/deploy-your-machine-learning-model-as-a-rest-api-4fe96bf8ddcc
- Install joblib
pip install joblib
this import joblib create a new file (model) you can read and make prediction.
The sample if for classifier the flower with load_iris dataset from sklearn