ApexFlow is a production-grade, end-to-end MLOps platform designed for real-time Formula 1 lap-time prediction. It leverages professional telemetry, automated retraining, and cloud-native orchestration to deliver race-weekend insights.
This project implements a full ML lifecycle including:
- Data Engineering: DVC-tracked telemetry processing with schema validation.
- Model Engineering: XGBoost/LightGBM with Optuna hyperparameter tuning.
- Automated Retraining: Weekly retraining with warm-start on new race data via Apache Airflow.
- Inference Service: Secure FastAPI service with uncertainty estimation.
- Live Telemetry & Frontend: A React/Vite dashboard for real-time race visualization.
- Observability: Prometheus/Grafana stack for performance & drift tracking.
- Frontend: React 19, Vite, TailwindCSS, Recharts, Lucide-React
- Backend API: Python 3.10, FastAPI, Uvicorn
- Orchestration: Apache Airflow
- Database: PostgreSQL (Supabase / Local)
- Tracking: MLflow & DagsHub
- Data Versioning: DVC
- Monitoring: Prometheus + Grafana + Loki
- Deployment: Docker, Vercel (Frontend), Render (Backend), Supabase (DB)
.
├── .github/workflows/ # CI/CD pipelines
├── config/ # YAML environment configs
├── dags/ # Airflow DAGs
├── data/ # Data samples (versioned by DVC)
├── deploy/ # Cloud Run/K8s manifests
├── docs/ # Detailed documentation
├── frontend/ # React/Vite Frontend Application
├── monitoring/ # Prometheus/Grafana/Loki configs
├── scripts/ # Utility scripts (Continuous Training, etc.)
├── src/apex_flow/ # Core source code
│ ├── api/ # Prediction API layer
│ ├── data/ # Ingestion & validation
│ ├── modeling/ # Training & versioning
│ ├── monitoring/ # Drift & metrics logic
│ └── orchestration/ # Orchestration logic
└── tests/ # Unit, integration, & quality tests
- Docker & Docker Compose
- Node.js 18+ & npm
- Python 3.10+
- DagsHub Account (for MLflow/DVC)
Create a .env file in the root directory:
# Security
DAGSHUB_USER_TOKEN=your_token_here
APEX_API_KEY=race-weekend-key-2026
# Supabase (Optional)
# VITE_SUPABASE_URL=...
# VITE_SUPABASE_ANON_KEY=...Launch the API, MLflow, Database, and Monitoring stack:
docker-compose up -dcd frontend
npm install
npm run devAccess the dashboard at http://localhost:5173.
Trigger the automated retraining pipeline (manually or via Airflow):
# Manual Run
python scripts/continuous_training_pipeline.py
# Airflow
# Enable the 'apexflow_weekly_retraining' DAGWe recommend a cost-effective, split deployment strategy:
- Frontend: Deployed on Vercel (connects to
frontend/directory). - Backend: Deployed on Render or Railway (runs
uvicorn src.apex_flow.api.main:app). - Database: Managed Supabase instance (PostgreSQL).
- Orchestration: Self-hosted Airflow or Cloud Composer (for Weekly Retraining).
Important: Ensure
DAGSHUB_USER_TOKENandAPEX_API_KEYare set in your deployment environment variables.
- Continuous Training:
python scripts/continuous_training_pipeline.py- Fetches latest race, retrains model, and promotes if better. - Register Model:
python scripts/register_model.py- Manual model registration helper.
For deep dives, troubleshooting, and contributing, see:
Built with ❤️ for F1 Engineers.