Live Production Site: project.patech.in/datascience/winemeup/
Most data science projects never leave a Jupyter Notebook. WineMeUp is a demonstration of how to bridge the gap between a "working model" and a "scalable production system." It is a containerized, microservices-based architecture designed for high-availability, low-latency wine quality predictions.
This project doesn't just predict a score; it implements a robust Inference Engine capable of handling model routing, multi-layer caching, and real-time observability.
The system is engineered as a decoupled stack to ensure independent scalability of the UI and the Inference API.
- Inference API (FastAPI): An asynchronous backend designed for high-throughput. It features strict Pydantic schema validation and dynamic model loading.
- Intelligent Caching (Redis): Implemented a deterministic MD5-hashing mechanism for input data. Repeat queries return in <2ms, bypassing the ML model entirely to save compute costs.
- Dynamic Model Routing: The system supports hot-swapping between 7 different pre-trained architectures including XGBoost, LightGBM, CatBoost, and Random Forest.
- Observability Stack (Prometheus): Real-time monitoring of API health, inference latency, and Redis cache hit ratios.
- Reverse Proxy (Nginx): Manages SSL termination and WebSocket headers, ensuring secure and stable connections to the Streamlit frontend.
While the system supports multiple models, the LightGBM Regressor serves as the primary engine.
- Optimization: Hyperparameters were tuned using Optuna with a focus on minimizing Root Mean Squared Error (RMSE).
- Data Alignment: Implemented a custom mapping layer to resolve the "feature-name mismatch" common in production pipelines where API field names (underscored) differ from training headers (spaced).
- Post-Processing: The engine handles raw output unwrapping (addressing NumPy array nesting issues specific to CatBoost) to ensure clean integer quality scores.
| Layer | Technology |
|---|---|
| Language | Python 3.12 |
| ML Frameworks | Scikit-Learn, XGBoost, LightGBM, CatBoost |
| API Framework | FastAPI (Uvicorn) |
| Frontend | Streamlit |
| Caching/DB | Redis 7.0 |
| DevOps/Ops | Docker, Docker Compose, Nginx |
| Monitoring | Prometheus, Redis Exporter |
The entire stack is containerized. To replicate this production environment:
-
Clone the Repository:
git clone [https://github.com/your-username/WineMeUp.git](https://github.com/your-username/WineMeUp.git) cd WineMeUp -
Environment Configuration: Create a
.envfile with yourAPI_KEYandMODEL_DIR. -
One-Click Launch:
docker-compose up --build -d
-
Verify Services:
- Frontend:
http://localhost:8501 - Inference API Docs:
http://localhost:8000/docs - Prometheus Metrics:
http://localhost:9090
- Frontend:
- Lazy-Loading Pattern: Models are only loaded into RAM when first called, optimizing memory usage for a multi-model environment.
- Zero-Downtime Design: The use of Docker Compose and Nginx allows for service updates without interrupting user experience.
- Production Guardrails: Implemented robust error handling for API authentication failures and inference-time array dimension mismatches.
I am a Data Scientist & Machine Learning Engineer focused on the intersection of Mathematical Modeling and Scalable Software Architecture. I build tools that don't just work—they perform.