Skip to content
All projects
01ML System · Model Serving2026

Insurance Premium API

Trained a model on insurance data, then wrapped it in a FastAPI service so it can actually answer requests instead of sitting in a notebook.

REQUESTPOST /predictFASTAPIScikit-learn estimator{ }
Problem

The model worked fine locally. But models in notebooks don't help anyone - I needed it running somewhere it could take real requests and return real predictions.

Approach
  • Built the API with FastAPI - loads the model on startup, takes a policy record, returns a premium prediction.
  • Tested it with curl and Postman before calling it done. The model isn't fancy (Random Forest), but the pipeline works.
Architecture
  1. Policy dataset
  2. Scikit-learn
  3. Joblib dump
  4. FastAPI
  5. JSON endpoint
Specification
Endpoint
POST /predict
Input
JSON policy record
Output
Premium estimate (float)
Latency
~50ms per request
Stack
  • FastAPI
  • Scikit-learn
  • Python
All case studies
Code is private for now. Happy to share on request.