How mdhabibullahmahmudncs13/bup-hackathon-preliminary-round works
GridWise is an HTTP service that turns campus operators’ scenario data and natural-language notes into a validated, cost-minimal 24-hour energy schedule. The main path accepts and validates a request, interprets each note with OpenRouter (falling back to deterministic parsing when needed), solves the resulting constraints as a battery-aware MILP, then independently replays the plan before returning it. The README also documents a dashboard, health endpoint, and retry cache. Some wiring is inferred from explicit README pipeline documentation; unsampled route and response details are not expanded.
Main entry points: main.py API pipeline · llm.py LLM client · optimizer.py MILP optimizer · models.py Request and response schemas
Components 16
HTTP service
- API pipeline
app/main.py - Request and response schemas
app/models.py - Control-room dashboard
app/static/ui.html - Response cache
app/main.py - Schedule response
app/models.py
Directive interpretation
- LLM client
app/llm.py - Directive guardrails
app/main.py - Heuristic interpreter
app/fallback_interpreter.py - Provider settings
app/settings.py
Schedule optimization
- MILP optimizer
app/optimizer.py - Plan replay
app/optimizer.py
Plan verification
- Independent validator
app/validator.py
Other components
- Operator
- OpenRouter
- PuLP and CBC
- Browser client
Connections 20
- Operator → API pipeline: submits scenario
- API pipeline → Request and response schemas: validates request
- API pipeline → Response cache: checks and stores
- API pipeline → LLM client: requests interpretation
- LLM client → Provider settings: reads configuration
- LLM client → OpenRouter: sends notes
- OpenRouter → LLM client: returns proposals
- API pipeline → Directive guardrails: checks proposals
- Directive guardrails → Request and response schemas: validates directives
- Directive guardrails → Heuristic interpreter: falls back per note
- API pipeline → Heuristic interpreter: falls back on LLM failure
- API pipeline → MILP optimizer: passes request and directives
- MILP optimizer → PuLP and CBC: solves MILP
- MILP optimizer → Plan replay: replays solution
- API pipeline → Independent validator: checks final plan
- API pipeline → Schedule response: builds response
- Schedule response → Request and response schemas: validates response
- API pipeline → Control-room dashboard: serves dashboard
- Browser client → API pipeline: requests API or UI
- API pipeline → Browser client: returns schedule or UI