About this Project
An end-to-end MLOps system that predicts F1 pitstops in real-time during each session. Two XGBoost models run live — one predicts pitstop probability per driver per lap, one predicts race outcome probabilities. Groq (Llama 3.3 70B) generates natural language strategy commentary from the raw predictions.
Architecture
OpenF1 → Lambda → SageMaker → S3 / New Relic → API Gateway → This UI
Data Source
OpenF1 API
Live telemetry — tyre age, gaps, compounds, safety car
Prediction Engine
XGBoost on AWS SageMaker
Serverless endpoint, 11 engineered features, updated every 30s
Commentary
Groq (Llama 3.3 70B)
Natural language race strategy insights generated per lap
Orchestration
AWS Lambda + EventBridge
5 Lambda functions (enrichment, rest_handler, prewarm, slack_notifier, prerace_check), enrichment fires every 60s during sessions
Storage
S3 + New Relic
Raw predictions in S3, live metrics and observability via New Relic
Alerts
CloudWatch → SNS → AWS Chatbot
Slack alerts for model drift, Lambda errors, billing cap
CI/CD
AWS CodePipeline + GitHub Actions
5-stage pipeline: Test → Plan → Approve → Deploy via Terraform
Frontend
Next.js → Vercel
Live predictions, race history, AI commentary — updates every 30s
Model Details
Algorithm
XGBoost (gradient boosted trees)
Features
11 engineered (tyre age², heat degradation, wet stint, sector delta)
Target
Pitstop probability in next 3 laps
Inference
SageMaker Serverless, ~30ms p99
Training data
2022–2025 F1 seasons via FastF1
Drift detection
CloudWatch alarm if confidence < 0.65