How sodium16/ev-smart-grid-openenv works
This repository is an OpenEnv-compatible EV charging and V2G simulator for Indian grid conditions. The principal workflow is a client resetting an episode, submitting charge/discharge actions, receiving observations and rewards, then requesting a task score. The FastAPI layer routes these operations to the simulation and graders; the simulator models grid availability, power delivery, battery health, tariffs, and episode progress. A separate inference runner asks an OpenAI-compatible model for actions and calls the API. Relationships reflect the sampled source and README; no database or unsampled frontend behavior is inferred.
Main entry points: app.py FastAPI service · environment.py Episode simulation · inference.py Inference runner · models.py Action and state models
Components 9
API and contracts
- FastAPI service
server/app.py - Action and state models
server/models.py - Browser frontend
index.html
EV simulation
- Episode simulation
server/environment.py - User history generator
server/utils.py
Tasks and grading
- Task registry and graders
server/tasks.py
LLM policy runner
- Inference runner
inference.py
Other components
- API client
- LLM provider
Connections 9
- API client → FastAPI service: calls endpoints
README.md - FastAPI service → Episode simulation: resets and steps
server/app.py - FastAPI service → Task registry and graders: gets task scores
server/app.py - FastAPI service → Action and state models: validates and schemas
server/app.py - Episode simulation → Action and state models: uses state models
server/environment.py - Episode simulation → User history generator: generates history
server/environment.py - FastAPI service → Browser frontend: serves UI
server/app.py - Inference runner → LLM provider: requests actions
inference.py - Inference runner → FastAPI service: resets, steps, grades
inference.py