Inspiration
We love motorsport, and while preparing for Hack the Track by Toyota GR Racing, we noticed a huge gap: sim racers lose races not because they’re slow, but because they lack strategy. Meanwhile, professional teams in Formula 1 use multi-million-dollar AI systems for pit decisions, tire management, and race forecasting. So we asked ourselves: “Why shouldn’t every racer - even a beginner - have a world-class race engineer?” That question became GR PitIQ, an AI pit wall that uses 5000+ Racing laps to bring F1-level intelligence to everyone.
What it does
GR PitIQ is an AI-powered race engineer built for Hack the Track by Toyota GR Racing that democratizes Formula 1-level strategy for sim racers and esports teams. The platform combines real-time race simulation with machine learning predictions and conversational AI to optimize every racing decision. Users configure race parameters - weather conditions, car setup, tire compounds, and fuel load - then watch their virtual race unfold with live telemetry updating every 2 seconds. The system monitors speed, fuel consumption, tire temperatures, sector times, and lap history while intelligently managing race-critical situations like fuel depletion and configuration conflicts during active sessions.
GR PitIQ's strategic power comes from 8 ensemble ML models (LightGBM + XGBoost + CatBoost) trained on 50,000+ real iRacing laps totaling 5.2 million data points. The Lap Time Predictor (0.103s MAE, R²=0.9998) forecasts next lap with physics-based adjustments for tire degradation and fuel weight. Fuel Consumption (0.115L MAE, R²=0.973) predicts usage per lap and triggers critical alerts. Pit Stop Time (1.207s MAE) estimates pit duration for undercut planning. Driver Consistency (100% accuracy) classifies reliability and flags risky tire situations. Weather Impact (0.015s MAE, R²=0.9997) predicts how rain affects lap times with warnings at 20% rainfall and critical alerts at 50%. Optimal Sector (0.0088s MAE, R²=0.9986) analyzes all three track sectors simultaneously to pinpoint time loss. Position Predictor forecasts race finish based on pace and strategy. Weather Pit Strategy (100% accuracy) determines when conditions demand tire changes. The hybrid intelligence system overrides pure ML predictions when physics demands it - immediately flagging pit stops when fuel drops below critical levels, tires exceed safe age limits, or extreme weather hits, ensuring recommendations are strategically sound beyond mathematical accuracy.
The application delivers professional race engineering through comprehensive features: Live Telemetry Dashboard displays real-time speed, RPM, fuel, tire degradation, and sortable lap history. Pit Wall Console provides race control with six monitoring modules including session overview, critical alerts (fuel/tire/weather/speed warnings), fuel projection charts, tire temperature tracking, weather forecasts, and driver performance scoring. Conversational AI Engineer powered by Groq (LLaMA 3.3 70B) analyzes live telemetry to answer strategy questions with context-aware advice and dynamic follow-ups. AI Strategy Center visualizes all 8 model predictions with confidence scores and override indicators. 3D Race Visualization renders immersive track action at 60 FPS with HUD telemetry overlay. Strategy Optimizer simulates race scenarios to recommend optimal pit windows and tire strategies with AI-generated explanations. Global Leaderboard ranks performance from 50,000+ recorded laps with class/track filtering. Model Insights provides complete transparency into ensemble architectures, hyperparameter optimization, and downloadable metadata. GR PitIQ gives every racer—from iRacing hobbyists to esports professionals - the competitive edge to win. 🏁
How we built it
Data Pipeline:
- Extracted 5000+ laps from Racing telemetry CSV (5.2M data points)
- Feature engineering : Created 131 features including tire age, fuel delta, weather interaction terms
- Trained 8 ensemble models using Optuna for hyperparameter tuning (50 trials each)
Architecture: Frontend (Next.js) → Backend (Python Flask) → Real-time updates (2s polling) → Simulation Engine (APScheduler) → ML Ensemble (LightGBM, XGBoost, CatBoost) → Supabase (PostgreSQL + Auth)
ML Training Pipeline:
# Ensemble with Optuna optimization
base_models = [
('lgbm', LGBMRegressor(**best_lgbm_params)),
('xgb', XGBRegressor(**best_xgb_params)),
('cat', CatBoostRegressor(**best_cat_params))
]
meta_learner = Ridge(alpha=1.0)
ensemble = StackingRegressor(estimators=base_models, final_estimator=meta_learner)
Challenges we ran into (Crisp & Easy Version)
- ML Models Failing on Edge Cases - Some models predicted impossible lap times when weather, fuel, and tire conditions changed suddenly. We fixed this by mixing ML predictions with physics-based calculations to keep results realistic.
- React Hook Errors & Broken Auth Flow - Refreshing protected pages caused “hooks called conditionally” errors and random logouts. We rebuilt all pages so hooks load first, added a common Loading Screen, and standardized auth using localStorage.
- Azure Deployment Issues -Deploying the backend on Azure caused multiple problems:
- Cold Starts : Took 20–30 seconds on Basic tier. Needed Always On (paid).
- Failed Installs : Heavy ML libraries timed out during build.
- CORS Errors : Azure’s default CORS conflicted with Flask-CORS.
- File System Limits : Model files were read-only until we moved them to Azure’s writable directory.
- Surprise Costs : Auto-scaling created many instances and pushed up charges.
- Fixes included : using persistent storage, enabling custom startup commands, disabling Azure CORS, optimizing build, and setting scale limits.
Accomplishments that we're proud of
- Production-Grade ML - 8 ensemble models with R² > 0.97 on all regression tasks and 100% accuracy on classification
- Real-time Everything - 2-second telemetry updates, live 3D visualization, streaming AI chat responses
- Intelligent Overrides - Our hybrid system catches edge cases models miss:
Adjusted 23% of lap time predictions when tire degradation exceeded thresholds Overrode pit strategy 18% of the time based on fuel/tire conditions - 15 Full-Featured Pages - From 3D simulation to team management to calendar scheduling - all production-ready
- Enterprise Security - Supabase RLS policies, OAuth integration, encrypted sessions
What we learned
- ML - Ensemble outperforms single models (LightGBM R²=0.994 → Ensemble R²=0.9998). Optuna cut tuning from days to hours. Domain knowledge (physics) essential for edge cases.
- Frontend - Next.js 15 server components need careful state management. Three.js demands 60 FPS optimization. Shared components prevent tech debt.
- Real-time - APScheduler + Flask = lightweight simulation without WebSockets. 2s polling is sweet spot (1s overloads, 5s lags).
What's next for GR PitIQ
- Multi-Car Simulations - Race against AI opponents with different strategies
- Live Racing Integration - Real-time telemetry streaming via Racing SDK
- Community Datasets - Allow users to upload telemetry and retrain models
- VR Pit Wall - Immersive race control experience with Quest 3
Log in or sign up for Devpost to join the conversation.