How ankitgundewar/mlops-cookbook works
This repository is a baseball-player height-prediction example for containerized ML and AWS deployment. Its main workflow accepts a player's weight through a CLI or Flask endpoint, runs a trained model and input/target scaling, and returns height in inches and human-readable form. A separate utility CLI retrains the model from CSV data or queries the Flask endpoint; an AWS SAM recipe exposes a Lambda handler using a parallel model library. The graph follows shown calls and documented capabilities; the recipe’s deployment wiring is not inferred from its configuration files.
Main entry points: mlib.py Model operations · ml_hello_world/mlib.py Lambda model library · app.py Flask API · utilscli.py Utility CLI
Components 13
Prediction interfaces
- Prediction CLI
cli.py - Flask API
app.py - Utility CLI
utilscli.py
ML runtime
- Prediction pipeline
mlib.py - Model operations
mlib.py
Model assets
- Training data
htwtmlb.csv - Trained model
model.joblib
AWS recipe
- Lambda handler
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/app.py - Lambda model library
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/mlib.py - Lambda training data
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/htwtmlb.csv - Lambda model
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/model.joblib
Other components
- User
- Prediction service
Connections 14
- User → Prediction CLI: requests prediction
README.md - User → Flask API: submits weight
README.md - Prediction CLI → Prediction pipeline: calls predict
cli.py - Flask API → Prediction pipeline: calls predict
app.py - Utility CLI → Model operations: retraining call
utilscli.py - Utility CLI → Prediction service: posts prediction
utilscli.py - Prediction service → Flask API: routes request
README.md - Prediction pipeline → Model operations: loads and scales
mlib.py - Model operations → Training data: reads data
mlib.py - Model operations → Trained model: loads or saves
mlib.py - User → Lambda handler: invokes prediction
README.md - Lambda handler → Lambda model library: calls predict
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/app.py - Lambda model library → Lambda training data: reads data
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/mlib.py - Lambda model library → Lambda model: loads or saves
recipes/aws-lambda-sam/sam-ml-predict/ml_hello_world/mlib.py