Перейти к содержимому

Deploy a Machine Learning Model as a Production REST API — FastAPI + Docker, from predict() to curl

Techno Bytes Unlocked

0:00 / 0:00

Deploy a Machine Learning Model as a Production REST API — FastAPI + Docker, from predict() to curl

5 просмотров · 2 нед. назад
Techno Bytes Unlocked
9 подписчиков
5 просмотров · 2 нед. назад
Most machine learning walkthroughs stop at fit and predict in a notebook. A model only starts earning its keep when something else can call it. In this video we take a trained scikit-learn model the whole way to a containerized, tested REST API — and every number on screen comes from a real run of the code in the repo. Five stations: Serialize the whole pipeline with joblib, and version it with a model card Wrap it in FastAPI with strict Pydantic schemas (422s before the model ever sees bad input) Optimize: load once with the lifespan pattern, cap OpenMP threads, add a batch endpoint Containerize with a multi-stage python:3.11-slim Dockerfile (165 MB vs 616 MB naive) Test with the Swagger UI, then pytest + httpx against the app in-process