What is in GridSimEnv
GridSimEnv hands an AI agent the trading desk of a real battery on the Texas grid. For three days at a time, while a real heat wave or winter storm sweeps across Texas, it reads ERCOT’s prices and forecasts as they were posted, bids the battery into the power markets and decides when to charge and when to sell. Every window is settled in dollars and scored against the best plan hindsight allows. We put 15 AI models through 32 of these windows, and in the August heat wave most of them out-earned the real operator at three of the four batteries.
Before and after: the real operator and the agents
Every window also happened for real. The battery’s own operator traded those same three days, and ERCOT publishes what each battery did 60 days later: its day-ahead awards, its output and its charge every five minutes (Electric Reliability Council of Texas, 2026a, 2026b). That gives each window a before and an after. Here are the 3 windows where the agents most clearly beat the operator, all on the 18 to 20 August 2026 heat wave, after every reported training cutoff1. Each shows the operator beside the run that made the most there, GPT-6.1 Sol’s.
Most of each gap is day-ahead trading. Through most of this heat wave the day-ahead price ran above real time, and GPT-6.1 Sol sold far more energy a day ahead than the battery could deliver, then bought it back in real time, cheaper; other models traded the same way on a smaller scale. ERCOT’s day-ahead market allows such positions because it ignores a battery’s charge; its credit screening, not modelled here, would limit them. They do not always pay: on the next front, 26 to 28 August 2026, real-time prices spiked to about $800 a MWh, and the operator came out ahead of at least 13 of the models at each of its 4 batteries.
Try it
This is the GridSimEnv Playground, the environment’s OpenEnv Space, embedded live. Load a window and run the desk with the agents’ own eleven tools, call budget and grade: ask the optimizer, send its offers, end your turn and watch the market play out beside the battery in 3D, then see how you rank against the real operator and the 15 models. Its Playground tab is OpenEnv’s MCP playground; the code is in hub/openenv on GitHub.
Why it matters
A grid battery makes its money on decisions: when to charge, when to sell and how much to hold in reserve, around the clock in ERCOT’s day-ahead and real-time markets. The same hardware earns very different amounts depending on who bids it, so closing that gap is revenue without a single new battery, and well-timed batteries put power on the grid exactly when it is scarcest, on heat-wave evenings and storm mornings.
21.5GW
of batteries on ERCOT's grid, October 2026
76%
of what perfect timing allowed, captured by the best quarter of ERCOT battery bidders in January 2026
$29.4/kW
a year of revenue for ERCOT batteries in 2025, Modo's estimate, down from 2023
166GW
of batteries waiting to connect to ERCOT in July 2026, more than any other kind of plant
12.0GW
discharged at once by ERCOT's batteries, a record, on 22 July 2026
$799/MWh
real-time price at Battery S01 at 22:00 on 26 August, the rollout's spike, against that hour's day-ahead price
That work is done today by round-the-clock trading desks and bidding software; an AI agent with the same forecasts, notices and rules could watch every interval, act on news in seconds and let one desk run far more batteries. No one should hand a real battery to an untested agent, though: here, one bad position in a price spike lost $142,769 in a single window, nearly twice what the same model made at the same battery a week earlier. GridSimEnv is where to test and train them first: real ERCOT days, the desk’s own tools and rules, and every window settled in dollars against hindsight and the battery’s real operator.
The eval
Fifteen models ran all 32 windows once, each in its maker’s own harness (Claude Code, Codex CLI or Gemini CLI) or, for the open-weight models, OpenCode, with the same eleven tools, 14 calls a wake-up and at most 100 wake-ups a window.
Cost: each window's tokens at the model maker's list price; Beam-1.0 at Together AI's; Qwen3.5-9B at Fireworks' metered rate; Qwen3.5-9B + desk SFT and Qwen3-4B in GPU time.
- GPT-6.1 Sol leads at 27.0% of the best possible profit, for $4.12 a window. DeepSeek V4.1 Flash is close behind at 24.6% for $0.38; the 95% CI on the gap, −8.2 to +12.8 points, includes zero.
- Every model scores lower in July and August than in January to May, even Qwen3-4B, trained before any window: the later fronts are harder, not just unseen. On 26 to 28 August 2026, a real-time spike to about $800 left 9 of the 15 models in the red.
- What to train next: re-planning to the end. The later a model’s last accepted offer, the higher it scores, a rank correlation of 0.74 across the 15: GPT-6.1 Sol’s last accepted offer comes 1.3 hours before a window ends on average, Beam-1.0’s 23.5. Distilling the desk’s own planner already lifted Qwen3.5-9B from 7.3% to 20.3%, near the planner’s 20.9%.
Watch a rollout
All 476 runs replay in the Replays Space: the battery site in 3D in its real light and weather, each wake-up’s tool calls and what the agent wrote, the market and the battery as they moved, and the grade.
How the reward works
Every window ends in an ERCOT settlement statement: day-ahead and real-time energy, reserves, imbalance and battery wear, priced by the market’s own rules. The score is that statement’s total P, so it is deterministic, with no judge model and no sampling. Capture C places P between doing nothing and perfect hindsight, C = (P − Pidle) / (Phind − Pidle): 0% at idle, 100% at hindsight, below zero for a run that does worse than idling. The contract’s reward R runs from 0.2 at idle to 1 at the desk’s own planner, R = 0.2 + 0.8 (P − Pidle) / (Pplan − Pidle) clipped to 0 and 1, with the planner’s margin over idle counted as at least a tenth of the physical hindsight’s; it is 0 for a run with no accepted offer.
The references are settled the same way. Hindsight is the best plan the market’s rules allow with every price, award and deployment of the window known in advance, one linear program solved by the same optimiser the agents can call. Idle sends no offers. The planner is that optimiser re-planning at every wake-up on exactly what the agent can see. The real operator appears twice: its own disclosed bids replayed through the same clearing and settlement, and what it actually did, settled on the same statement. Offers the desk’s checks refuse change nothing.
On the film’s window GPT-6.1 Sol settles $85,771, idle settles $2 and hindsight $120,595, so C = ($85,771 − $2) / ($120,595 − $2) = 71.1%. It beat the planner’s $55,981, so its R is capped at 1.
Training on GridSimEnv
We fine-tuned Qwen3.5-9B with TRL on transcripts of the desk’s own planner, which calls optimize and submits
its proposal. AgentEnv captured them by playing the planner through OpenCode on 144 training windows whose
operating days stay clear of the benchmark’s2, and the model learned to make the same calls, with a short
rationale at each wake-up.
The recipe
- Data
- 144 three-day training windows; 438 rows, three a window; 397 after the 150k-token cap, about 34M tokens, 1.3M of them trained
- Model
- Qwen3.5-9B, LoRA r 32 / α 64 on all linear layers
- Training
- TRL SFTTrainer, lr 1e-4, 1 epoch, 50 steps, gradient accumulation 8; activations offloaded to CPU, so rows up to 150k tokens fit on one 95 GiB GPU (RTX PRO 6000, g7e.8xlarge spot), in 4.5 h
- Eval
- OpenCode with vLLM at a 262,144-token context, the same harness for base and student
- Cost
- about $104 of GPU for training and the evals on our own servers; the teacher is our own planner, so no LLM API spend
- Code
- desk_distill_sft.py and desk_distill_train.py, and the pre-registration
- Guide
- AgentEnv’s training docs
- Benchmark: +13.0 points over the base model [+6.3, +19.6], better on 23 of 32 windows. The fine-tuned 9B lands near the planner it copied (20.3% against 20.9%), at $0.56 a window.
- Pre-registered primary test: on 18 held-out training-period windows the gain was +3.8 points [−3.4, +10.6], not significant; the planner itself is only 3.9 points above base there3.
- The earlier attempt: GRPO alone on Qwen3.5-9B, 18 steps, did not move the score; imitating a strong policy moved it on the benchmark. What the model learned is the planner’s habits: refused day-ahead offers fell from 48% to 5.7%.
Where models fail
We replayed every one of the 476 benchmark runs on the frozen engine and measured how each model ran the desk. Three habits separate the top of the board from the bottom.
Beam-1.0 on GridSimEnv
We replayed all 32 of Beam-1.0’s runs exactly, every P to the cent, and changed one thing at a time. Beam
follows the desk’s planner faithfully: 97% of the day-ahead curve hours it submits against a proposal copy
it exactly. Two habits cost it: 91% of its optimize calls keep the default physical
position where the planner asks for spread, a fix that leans on Winter Storm Fern’s windows, and
its last accepted offer comes 23.5 hours before a window ends. Fixing both in the replay adds +14.0
points of C [+3.0, +28.7], 98% of its 14.2-point gap to the planner. With a pre-registered
playbook of those habits, Beam-1.0 itself then reached C 18.9% [6.0, 35.8], up from 6.7% and
near the planner’s 20.9%: +12.2 points [+1.6, +26.9], where the replay predicted
+14.0. The playbook was written after seeing Beam’s failures on these same windows, so this shows the fixes
carry over to Beam’s own play, not performance on unseen windows; outside Winter Storm Fern’s front the gain is
+5.8 [−0.3, +12.8], an interval that includes zero. The dataset card
gives each effect with its interval, the playbook run, and the published files.
Data sources
| Data | Source | Licence |
|---|---|---|
| Day-ahead and real-time prices, reserve prices, system lambda and demand curves | ERCOT public reports NP4-190-CD, NP6-905-CD, NP6-788-CD, NP4-188-CD, NP6-332-CD, NP6-331-CD, NP4-212-CD and NP6-323-CD | ERCOT Website User Agreement, section 5; not relicensed |
| Load, wind and solar, ERCOT’s forecasts as issued, outages | ERCOT public reports NP6-345-CD, NP4-733-CD, NP4-738-CD, NP3-565-CD, NP4-742-CD, NP4-745-CD, NP3-233-CD and NP1-346-ER | ERCOT Website User Agreement, section 5 |
| Market and operations notices | ERCOT notices | ERCOT Website User Agreement, section 5 |
| The real operator’s bids, awards and output; each battery’s limits | ERCOT 60-day disclosures NP3-966-ER, NP3-965-ER and NP3-991-EX, and ERCOT’s December 2025 CDR report | ERCOT Website User Agreement, section 5; only derived values are published |
| Weather alerts | NWS watches, warnings and advisories, through the Iowa Environmental Mesonet’s VTEC archive | public domain (NWS) |
| Weather in the replays | ASOS observations, from the Iowa Environmental Mesonet, Iowa State University | public domain (NWS, FAA), credited as the IEM asks |
| Temperatures that located the fronts | NOAA HRRR model runs | public domain (NOAA) |
| Solar capacity behind the modelled PV | U.S. Energy Information Administration, Form EIA-860M | public domain |
| The desk’s price forecast | desk-qr-v1, fitted in the plugin on ERCOT’s posted prices and forecasts | Apache-2.0 code; ERCOT’s terms for the data |
| The battery sites in 3D | procedural, built in code; three.js | CC0; MIT |
Source: ERCOT. GridSimEnv is not affiliated with or endorsed by ERCOT, NOAA, the EIA or the Iowa Environmental Mesonet; the plugin’s data licence holds ERCOT’s terms in full, and its NOTICE sets out each source.
Links
Playgroundhuggingface.co/spaces/earakely-scale/GridSimEnv-OpenEnv
Replayshuggingface.co/spaces/earakely-scale/GridSimEnv-AgentEnv
Resultsevery model on every window, in the Replays Space
Datasethuggingface.co/datasets/earakely-scale/GridSimEnv-AgentEnv
Codegithub.com/earakely-scale/agentenv-gridsim-plugin
Pre-registrationdocs/prereg/v4-bench.md
Training guideagentenvframework.com/docs/training
Footnotes
-
The windows: every window in July and August 2026, after every reported training cutoff, on which at least 12 of the 15 models settled above the real operator, both as it ran and with its own bids replayed through the same market. That picks Batteries S01, S02 and S03 on the 18 to 20 August 2026 heat wave. The operator as it ran is its real day-ahead awards and metered output, settled on the same statement as the agents’ runs at ERCOT’s real prices; its own bids, replayed from the same starting charge, earn $10,827, $17,102 and $32,268.
-
One benchmark front, 8 to 10 May 2026, falls inside some training windows’ spans, but only as their day-ahead price history, the week before their operating days; no training transcript names those dates.
-
Base Qwen3.5-9B was served by Fireworks on the benchmark and by our own vLLM on the held-out windows; the fine-tuned model by our own vLLM on both.
- Electric Reliability Council of Texas. (2026a). 60-Day DAM Disclosure Reports (NP3-966-ER). https://www.ercot.com/mp/data-products/data-product-details?id=NP3-966-ER
- Electric Reliability Council of Texas. (2026b). 60-Day SCED Disclosure Reports (NP3-965-ER). https://www.ercot.com/mp/data-products/data-product-details?id=NP3-965-ER