Microservices with FastAPI and Docker (Python based) -  Hands on Tutorial @DataScienceGarage
Microservices with FastAPI and Docker (Python based) -  Hands on Tutorial  @DataScienceGarage
Uploaded September 2021 | Updated September 2026, 2 weeks ago
In this tutorial you will learn about APIs and microservice management. You will learn the principles of API and microservice design for Machine Learning (ML) inference so that you can design your own ML solution.

FastAPI is a modern, fast, web framework for building APIs with Python 3.6+ based on standard Python type hints.

The following parts will be covered with this tutorial:
- Introduction to APIs and microservices
- REST API-based microservices
- Hands-on implementation of serving an ML model as an API
- Developing a microservice using Docker (you will learn how to setup your Dockerfile for your container image)
- Testing the API service.

The artifacts which we will use in the tutorial are:
- model data scaler - it scales input data to be representative for the ML model (classifier).
- SVC classifier - ML model, classification classifier, which makes binary classification (predictions of weather).

API is the gateway that enables developers to communicate with an application. APIs enable two things:
- Access to an application's data
- The use of an application's functionality.

On the other hand, Microservices are a modern way of designing and deploying apps to run a service.

So in this video example we will apply the principles of APIs and microservices and develop a RESTful API service to serve the ML model. The ML model we will serve will be for the business problem - weather prediction using ML. We will use the FastAPI framework to serve the model as an API and Docker to containerize the API service into a microservice.

Some key points you should keep in mind:
- A POST request is often used to create new resources. For ML applications, it is used to infer predictive ML models.
- For feature definitions in variables Python based file we will use pydantic module: pydantic-docs.helpmanual.io
- uvicorn - is an ASGI (Asynchronous Server Gateway Interface) server implementation package (pypi.org/project/uvicorn/).
- onnxruntime - used to deserialize and infer onnx models.
- uvicorn-gunicorn-fastapi image on Docker Hub: hub.docker.com/r/tiangolo/uvicorn-gunicorn-fastapi/dockerfile
- Docker documentation for RUN command: docs.docker.com/engine/reference/commandline/run

Github repo for the tutorial: github.com/PacktPublishing/EngineeringMLOps/tree/master/08_API_Microservices
- Engineering MLOps book on Amazon: amazon.com/Engineering-MLOps-Rapidly-production-ready-learning/dp/1800562888

#fastapi #microservices #api
Microservices with FastAPI and Docker (Python based) -  Hands on TutorialAzure Data Science (DP100) Certification 2020. Courses to LearnHyperparameter Tuning and Cross Validation to Decision Tree classifier (Machine learning by Python)Build Python Graphic User Interface (GUI) by TkinterLLM Configuration Parameters | Clearly ExplainedData Cleaning with ECDF Statistics in Python (Explanation and Example)Digits Classification with Random Forest  Example in 10 minutesImplement DBSCAN Clustering and detecting OUTLIERS with PythonFind Outliers with AutoEncoder - Full Tutorial (Hands-on and Theory)Deploy Flask application to AWS Elastic Beanstalk as a web app. | PART #2Prepare datasets with drawdata Python Module | Cool Python Tool in Jupyter NotebookGoogle Cloud Storage Services. Which to choose? Hints for GCP Data Engineering Exam
Data Science Garage |

Microservices with FastAPI and Docker (Python based) - Hands on Tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER