TensorLearn
Back to Course
Machine Learning: The Engineering Approach
Module 5 of 13

5. Deployment with FastAPI

1. Pickle

Saving your Python object to a file.

python
import joblib joblib.dump(model, "model.pkl")

2. API

Serving predictions via HTTP.

python
from fastapi import FastAPI import joblib app = FastAPI() model = joblib.load("model.pkl") @app.post("/predict") def predict(features: list): return model.predict([features]).tolist()

Mark as Completed

TensorLearn - AI Engineering for Professionals