FastAPI is a high performance simple framework for building APIs(Application Programming Interface).
It is widely used to write production level API's for ML services.
Important: More info https://fastapi.tiangolo.com/
-
Linux
Systems:#sudo pip3 install virtualenv python3 -m venv ./venv source venv/bin/activate pip3 install fastapi uvicorn #pip3 install -r requirements.txt
deactivate
-
Windows
Systems:#pip3 install virtualenv python3 -m venv ./venv venv\Scripts\activate pip3 install fastapi uvicorn #pip3 install -r requirements.txt
venv\Scripts\deactivate
If getting issue on
windows
, use administrator privileges
-
Using from command line
python3 app.py
or
uvicorn app:app --reload
or
uvicorn app:app --host 0.0.0.0 --port 8000 --reload
or
uvicorn app:app --host 0.0.0.0 --port 8000 --reload --workers 4
- http://127.0.0.1/ >> You can then navigate to the localhost to see your app in action.
- http://127.0.0.1/docs >> This yields the OpenAPI Swagger UI.
- http://127.0.0.1/redoc >> This uses the Redoc UI with some documentations out of the box.
Kuldeep Singh Sidhu
Github: github/singhsidhukuldeep
https://github.com/singhsidhukuldeep
Website: Kuldeep Singh Sidhu (Website)
http://kuldeepsinghsidhu.com
LinkedIn: Kuldeep Singh Sidhu (LinkedIn)
https://www.linkedin.com/in/singhsidhukuldeep/