Production-ready recommendation system demonstrating machine learning engineering, MLOps, containerization, CI/CD, experiment tracking, and cloud deployment.
RecSysOps is an end-to-end recommendation system built using the MovieLens 100K dataset. The project trains, evaluates, compares, and serves multiple recommendation algorithms through a FastAPI service deployed on AWS EC2 with automated testing and CI/CD.
- Matrix Factorization
- Two-Tower Neural Recommendation Model
- Popularity Baseline
- FastAPI inference service
- Docker containerization
- GitHub Actions CI/CD
- AWS EC2 deployment
- Experiment tracking
- Model comparison endpoint
- Automated testing
- Swagger API documentation
- Model artifact management
The diagram below illustrates the complete machine learning lifecycle from training to deployment.
MovieLens Dataset → Training Pipeline → Recommendation Models → Experiment Artifacts → FastAPI Service → Docker Container → AWS EC2 Deployment
GitHub Actions automatically runs tests and validates changes before deployment.
Interactive Swagger/OpenAPI documentation generated automatically by FastAPI.
Example recommendation request and ranked movie recommendations returned by the API.
Experiment tracking and model comparison across recommendation algorithms.
Automated testing and deployment validation using GitHub Actions.
Models were evaluated using Precision@10 and Recall@10.
| Model | Precision@10 | Recall@10 |
|---|---|---|
| Popularity | 0.00477 | 0.04772 |
| Matrix Factorization | 0.00361 | 0.03606 |
| Two-Tower | Training Loss = 0.378 | N/A |
Current best model according to Precision@10:
Popularity Baseline
GET /health
Response:
{
"status": "ok"
}POST /recommend
Request:
{
"user_id": 1,
"k": 10,
"model_name": "matrix_factorization"
}GET /metrics
Returns training metrics, experiment artifacts, and model information.
GET /compare-models
Compares available recommendation models and identifies the best-performing model based on evaluation metrics.
GET /model-info
Displays available recommendation models and metadata.
- PyTorch
- NumPy
- Pandas
- Scikit-Learn
- Docker
- GitHub Actions
- AWS EC2
- FastAPI
- Uvicorn
- Pytest
- Trained and evaluated three recommendation approaches
- Implemented experiment tracking and artifact management
- Built production-style REST APIs using FastAPI
- Containerized the application with Docker
- Automated testing with GitHub Actions
- Deployed inference services to AWS EC2
- Added model comparison and monitoring endpoints
- Created an end-to-end MLOps workflow from training to deployment
Run locally:
pytestClone the repository:
git clone https://github.com/farshad-haddadi/recsysops.git
cd recsysopsBuild the Docker image:
docker build -t recsysops .Run the application:
docker run -p 8000:8000 recsysopsOpen:
http://localhost:8000/docs
http://18.116.199.104:8000/docs
http://18.116.199.104:8000/health
Current deployed models:
- Matrix Factorization
- Two-Tower Neural Recommendation Model
- Popularity Baseline
The model comparison endpoint automatically evaluates available experiment artifacts and identifies the best-performing model.
Farshad Haddadi




