Building the API

MLOps Deployment and Life Cycling

Nemanja Radojkovic

Senior Machine Learning Engineer

API highest level

MLOps Deployment and Life Cycling

API definition

MLOps Deployment and Life Cycling

Server

MLOps Deployment and Life Cycling

Client

MLOps Deployment and Life Cycling

Service to the client

Running procedures on our server

Example: Sentiment analysis API for Amazon Comprehend

Amazon comprehend logo

Access remote databases

Example: Twitter API, New York Times API

Twitter API logo

MLOps Deployment and Life Cycling

API architectures

 

  1. REST: REpresentational State Transfer
  2. RPC: Remote Procedure Call
  3. SOAP: Simple Object Access Protocol

 

In this course: Architecture-agnostic view

MLOps Deployment and Life Cycling

Example: Navigation app

Navigation app

 

 

 

API purpose: Enable client apps to calculate the estimated time of arrival

1 Image: Pixabay, https://www.stockvault.net/user/profile/161904
MLOps Deployment and Life Cycling

Simplest API

MLOps Deployment and Life Cycling

simplest api 2

MLOps Deployment and Life Cycling

model running

MLOps Deployment and Life Cycling

model response

MLOps Deployment and Life Cycling

Server error

MLOps Deployment and Life Cycling

MLOps Deployment and Life Cycling

MLOps Deployment and Life Cycling

Input validation

MLOps Deployment and Life Cycling

Input validation - expectations

MLOps Deployment and Life Cycling

Input validation 3

MLOps Deployment and Life Cycling

Input val informative msg

MLOps Deployment and Life Cycling

Request model

MLOps Deployment and Life Cycling

Output validation

MLOps Deployment and Life Cycling

A bug in the code

MLOps Deployment and Life Cycling

Client crashed

MLOps Deployment and Life Cycling

Response model

MLOps Deployment and Life Cycling

Output validation - Informative error message

MLOps Deployment and Life Cycling

Expectations defined

MLOps Deployment and Life Cycling

Authentication and throttling

MLOps Deployment and Life Cycling

Authentication

MLOps Deployment and Life Cycling

Throttling

MLOps Deployment and Life Cycling

FastAPI

  • open-source API framework for Python
  • all essential features out of the box
  • build and launch REST APIs in no time
1 https://fastapi.tiangolo.com
MLOps Deployment and Life Cycling

Let's practice!

MLOps Deployment and Life Cycling

Preparing Video For Download...