How Hyperbolic is put together, word for word as it stood in the README up to 0.15.0. The front page is README.md.
An AI supervisor that runs a simulated district and tries to beat the no-control reference on cost, emissions and comfort.
Hyperbolic runs CityLearn, an open source district energy simulator, entirely on one machine. Every simulated hour it reads CityLearn's observations, forecasts and prices for all buildings, asks a language model for one action per device, passes the answer through a deterministic safety envelope, and applies what survives. Both the agent and the reference are scored by CityLearn's own KPI evaluation, so the numbers come from the benchmark, not from this project.
citylearn_challenge_2023_phase_2_local_evaluation, the public local evaluation set of the CityLearn 2023 challenge, the most recent official challenge. It ships unchanged in hyperbolic/data.
| Buildings | 3, each with a heat pump for cooling, a hot water tank, a battery and rooftop solar |
| Episode | 720 hourly time steps (one summer month), so 719 hourly decisions |
| Indoor temperature | Predicted by CityLearn's LSTM model of each building |
| Comfort | An occupied hour is uncomfortable outside cooling setpoint plus or minus 2 C |
| Actions per building | cooling_device 0 to 1 (fraction of heat pump power), dhw_storage -1 to 1, electrical_storage -1 to 1 |
| Observations | Hour, day type, outdoor temperature and solar with forecasts 6, 12 and 24 hours ahead, electricity price with exact forecasts 6, 12 and 24 hours ahead, carbon intensity (no forecast), and per building indoor temperature, setpoint, occupants, loads, solar, storage charge, net grid draw, outage flag |
| KPIs | cost_total, carbon_emissions_total, electricity_consumption_total, discomfort_proportion (hot and cold), ramping_average, daily_peak_average, all_time_peak_average, daily_one_minus_load_factor_average, one_minus_thermal_resilience_proportion, power_outage_normalized_unserved_energy_total |
The ratio KPIs are relative to CityLearn's no-control reference, so the reference itself scores 1.0 on them. Discomfort and resilience are absolute shares.
The baseline is CityLearn's no-control reference, exactly as its BaselineAgent runs it: storage idle and the heat pump meeting the ideal load. Every CityLearn KPI is normalized against it. The full-episode run is committed in results/baseline and replays with hyperbolic replay results/baseline.
| CityLearn KPI (district) | Baseline |
|---|---|
| cost_total, carbon_emissions_total, electricity_consumption_total, ramping, peaks, load factor | 1.000 (the reference) |
| discomfort_proportion | 0.171 (0.018 too warm, 0.154 too cool) |
| one_minus_thermal_resilience_proportion | 0.370 |
| power_outage_normalized_unserved_energy_total | 0.684 |
Summed from CityLearn's hourly series: $82.69 of electricity, 1,166 kg CO2, 348 uncomfortable occupied building hours over the month.
Prompt version 9 (hyperbolic/prompt.py) is the default from 0.11.0. Version 10 (0.13.0, free mode), version 11 (0.14.0, blind mode) and version 12 (0.15.0, rules in words) are experiments beside it, described in Version 0.13.0, Version 0.14.0 and Version 0.15.0. Version 9 keeps everything in version 8 and:
- Says to send every number of
strategyexactly: a battery -0.033 is not 0, and cooling under baseline_action is notnull, with the trim state off too. The 0.10.0 live months left the batteries idle in skipped shaves and sentnullin 415 of 416 missed trim starts. - Shows
peak.shave_now, the strategy's own test for a peak hour, and says to shave whenever it is true, after the top price and on flat_24h days too, with whatever charge is left. Version 8's "Before them discharge only to shave" and "Idle on flat_24h days" are gone. - Keeps 0.01 of charge above the floor through the top-price hours (
StrategyParamsV9.evening_reserve), so the evening shave has something to discharge.
Prompt version 8, the default in 0.10.0, keeps everything in version 7 and:
- Shows the strategy's whole action per building,
strategywithcooling,dhwandbattery(fromstrategy_plan_v8, inside the envelope's ranges), andstrategy_reason, in place ofstrategy_batteryandstrategy_battery_reason. The agent is told to send it as given and to say why where it differs. - Says a trim starts when an overcooled room's trim state is off, and that a held trim is a number inside
cooling_range, nevernull. The version 7 line thatnullis for "only when trim state is off or end" is gone: the 0.9.0 live month read it as "send null when the trim is off". - Adds extra cooling in a room that runs warm to the strategy: from 0 at 1.5 C above its setpoint to 0.05 above the baseline action at 2.5 C or more, never while a trim is held and never in an outage.
- Drops
signal_outlook, which no version 7 or 8 strategy reads, and names no single dataset, so the same prompt serves every month of the month set. Requests are 12.0 percent smaller than version 7's.
Prompt version 7, the default in 0.9.0, keeps everything in version 6 and:
- Shows what the envelope allows each building this hour.
trim: the held trim'sdepth, itsstate(off, hold, ease or end) and why,min_depth(the least trim allowed this hour while one is held) andend_trim_ok.cooling_rangeandbattery_range: the values that pass the range, rate, state of charge, deviation, comfort and trim hold rules without a clamp (nullwhen only the exact baseline passes). The spread check and the peak limiter are still shown asgrid_charging_okandheadroom_kwh. - Shows
last_clampper building, last hour's clamps there with their reasons, in place of the district-widelast_clamps.cooling_trim_heldandcooling_trim_last_hourare dropped. - Says
nullis exactly the baseline, for use only when the trim state is off or end; a held trim takes a number insidecooling_range. In 0.8.0nullon a held trim was kept by the envelope and logged as a clamp. - Takes
strategy_batteryfrombattery_plan_v7, which with the shipped numbers is version 5's plan, kept insidebattery_range. The agent is told to send it as given, and when it differs to stay within 0.1 of it and never skip a peak-shaving discharge. - Is shorter. The envelope's rules are summed up by the ranges, so the system prompt drops 441 characters.
Prompt version 6, the default in 0.8.0, keeps everything in version 5 and:
- States the trim hold. The envelope holds a cooling trim in code (see How the safety envelope works);
nullcooling keeps a held trim, and a deeper trim is allowed. - Adds
end_trimto the reply, per building:null, or a short reason to end that building's held trim now. It is the only way to end one early, and every early end is logged and shown in the viewer. - Adds
cooling_trim_heldin each building: the trim the envelope keeps this hour, 0 when none. - Replaces
reference_action(the 0.4.0 rule-based controller's plan) withstrategy_batteryin each building andstrategy_battery_reason: the battery action the version 5 strategy gives this hour, worked out by the same code the scripted strategy runs (battery_plan_v5). The agent is told to use it unless it has a clear reason, and to say why when it differs.
Prompt version 5, the default in 0.7.0, keeps everything in version 4 and adds:
smoothing:district_draw_last_hour_kwh(measured),district_load_now_kwh(before storage) anddistrict_load_next_hour_kwh(the next hour's load before storage, as yesterday).cooling_trim_last_hourin each building: how far below the baseline action its cooling ran last hour.- A smoothing strategy. The goals now say that ramping counts only steps up. Once a trim is on, hold it until the room is within 0.5 C of its setpoint, then ease it off by at most 0.02 per hour. Start grid charging small and raise it by at most 0.15 per hour. Discharge the usable charge evenly over the top-price hours left. The numbers come from
StrategyParamsV5, the settings chosen on the tuning set.
Prompt version 4, the default in 0.6.0, keeps everything in version 3 and adds:
reference_actionin each building, withreference_reason: what the 0.4.0 rule-based controller would do this hour (rule_plan_v3, the same function its runs use). The agent is told it is the bar to beat and that where its plan differs, a point of the strategy should say why.price_plan: the price now, the 24 hour top and low,top_price_now, the top-price hours ahead andflat_24h.- Battery limits:
soc_floor(CityLearn's depth of discharge leaves 0.2 here, above the envelope's 0.1),usable_kwhabove it,round_trip_min, andgrid_charging_ok, the envelope's spread check verdict for this hour. indoor_vs_setpoint_c, from the room temperature CityLearn actually simulated.- A strategy in priority order: comfort (trim cooling gradually, up to 0.1 below the baseline, in occupied rooms more than 0.5 C below their setpoint; never cool less in a room at or above its setpoint), then hold the battery for the top-price hours and discharge there sized to each building's own load, discharging earlier only once district load reaches 0.9 of the forecast peak, charge about 0.15 of capacity per hour in the cheapest, cleanest hours so the battery is near 0.95 when the top-price hours start and only when
grid_charging_ok, leave flat-price days alone, never charge at the top price, and leave the hot water tank at 0. The numbers come fromStrategyParams, the settings chosen on the tuning set, so the prompt and the scripted strategy cannot drift apart.
Prompt version 3, the default in 0.4.0, keeps everything in version 2 and adds the peak block, the combined signal and hours left in the month (see Version 0.4.0). Version 2, the default in 0.3.0:
- A 24 hour price outlook from forecasts already received. Each hour brings exact price forecasts for 6, 12 and 24 hours ahead. Kept and lined up by the hour they refer to, they cover every one of the next 24 hours after the first day. Hours not covered yet fall back to the same hour yesterday. Each value is tagged with its source.
- A 24 hour carbon outlook as the same hour yesterday, from observed values only. It is a guide, not a forecast.
- A summary of both: now, the 24 hour min and max, hours until each, and where now ranks in the coming day.
- Storage per building: state of charge, capacity and how far the battery can move in one hour, for the battery and the hot water tank.
- A plain strategy: charge the battery in the cheapest, cleanest hours and with spare solar, discharge into the price peak sized to the building's own load (exports earn nothing), mostly leave the hot water tank alone, keep cooling at the baseline unless a small pre-cool is clearly safe, and hold when nothing stands out.
Nothing reads the dataset ahead of time; the outlook is built only from observations the controller has already received. Prompt versions 1 to 8 are kept unchanged so runs recorded with 0.2.0 to 0.10.0 replay byte for byte, and --prompt-version 1 to 8 still selects them: 1 to 5 with the 0.7.0 envelope rules, 6 to 8 with the 0.8.0 rules that version 9 also uses.
From 0.6.0 there is a separate 2023 tuning set. scripts/tuning_data holds citylearn_challenge_2023_phase_2_online_evaluation_1 from CityLearn v3.0.2, copied unchanged: the same three buildings, batteries and LSTM models as the reported month, but June, July and August of a different period, with its own weather, loads, solar, carbon intensity and tariff, and no hour in common with the reported month. (citylearn_challenge_2023_phase_1 is byte for byte the reported month's data, so it is no use for tuning; online evaluation sets 2 and 3 differ from set 1 only in the outage seed.)
In 0.11.0, python scripts/tune_strategy.py --version 9 searched charge kept for the evening shave (StrategyParamsV9.evening_reserve), the shave share and the grid charge rise on the four months of the month set, the phase 2 month included, under the acceptance rule written into the CHANGELOG first (see Version 0.11.0). The first pass of 36 settings passed none and a finer second pass of 8 passed one. The holdout (HOLDOUT.md, Buildings 4 to 6 of citylearn_challenge_2023_phase_3_1) was sealed before the search and played no part: months() never lists it, and scoring it needs --holdout-final.
In 0.10.0, python scripts/tune_strategy.py --version 8 searched the version 8 strategy's extra cooling in a warm room (StrategyParamsV8) and a no-trim night, 36 settings with the 0.8.0 rules, with comfort first: too warm at or below the baseline on every tuning month, too cool within 0.001 of version 7's, ramping and both peaks at or below the baseline's, then the lowest cost plus emissions (see Version 0.10.0). The tuning months are now also part of the month set (hyperbolic.months, hyperbolic months), which the search and the compare report share; the phase 2 month is still only reported, never searched.
In 0.9.0, python scripts/tune_strategy.py --version 7 searched the version 7 battery plan's smoothing (StrategyParamsV7): a soft cap on how fast a battery action may rise (0.05 to 0.25, on charging and discharging or on a discharge winding down only), valley filling when grid charging, and a charge rate of 0.1 or 0.15, 36 settings with the 0.8.0 rules. Every candidate runs the same cooling, so the reference is the candidate with version 6's battery plan, and a setting qualified when ramping was lower with cost, emissions, discomfort and both peaks no worse. None did. Every cap raised cost and the all-time peak (a cap of 0.1: cost 0.9138 against 0.9086, all-time peak 0.8835 against 0.8526, ramping 0.9965 against 0.9823), and capping only the wind-down of a discharge raised ramping (1.0016). Charging at 0.1 cut ramping to 0.9644 and valley filling to as low as 0.9116, but both raised cost and the all-time peak. The shipped numbers are version 5's.
In 0.8.0 nothing was tuned. The trim hold takes its numbers from the version 5 strategy (hold until within 0.5 C, then ease by at most 0.02 per hour), and python scripts/tune_strategy.py --version 6 runs the shipped version 5 strategy on the tuning months through the 0.7.0 rules and through the 0.8.0 rules, before anything is reported on the phase 2 month. The one choice made there was the hold's rounding allowance (see Version 0.8.0).
In 0.7.0, python scripts/tune_strategy.py (version 5, the default) searched how strategy_plan_v5 smooths the load: how long a cooling trim is held, how fast it is eased off and how fast a grid charge may rise (StrategyParamsV5). A setting qualified when, averaged over the three tuning months, ramping was below the baseline and cost, emissions, discomfort and both peaks were no worse than the 0.6.0 strategy on the same months; the qualifying setting with the lowest ramping plus load factor won. 8 of 18 qualified. On the tuning months the shipped setting scores ramping 0.9816 and load factor 0.9517 against the 0.6.0 strategy's 0.9953 and 0.9529, with cost 0.9089 against 0.9113, emissions 0.9610 against 0.9671 and discomfort 0.0310 against 0.0344.
In 0.6.0, python scripts/tune_strategy.py --version 4 ran each of its three months as its own episode and searched the version 4 strategy's numbers (StrategyParams: when a room counts as too cold and how far its cooling is trimmed, the charge rate, peak shaving, and whether discharge is spread over the top-price hours), executed literally by strategy_plan_v4. A setting qualifies when, averaged over the three months, discomfort is at or below the baseline's, the daily and all-time peaks, ramping and the daily load factor are at or below the baseline's to four decimals, and cost and emissions are both below the 0.4.0 rule-based controller's on the same months. 36 of 216 settings qualified; the one with the lowest cost plus emissions is shipped. On the tuning months it scored cost 0.9113 and emissions 0.9671 against the rule-based controller's 0.9621 and 1.0021, discomfort 0.0344 against 0.1231, daily peak 0.8900, ramping 0.9953 and load factor 0.9529. The reported month was used only to report. The envelope's spread check has nothing to tune: it uses each battery's own efficiency curve and standing loss.
Before 0.6.0 the repository had no other 2023 dataset offline, and the rule-based policy's settings were chosen on the first week of the reported month only (167 hourly decisions) with python scripts/tune_rules.py. That controller is now the frozen 0.4.0 reference and keeps those settings. In 0.4.0 its grid covered the signal thresholds for charging and discharging, the charge rate, peak shaving, the battery charge limits, when to stop charging before the month ends, and the limiter's target fraction and forecast window; a setting qualified when, on that week, discomfort was no more than half a point above the baseline and both peaks were at or below the baseline's to four decimals. (Four decimals because the baseline action under control rounds the heat pump fraction, which by itself moves a peak ratio by about 0.00001.)
hyperbolic/envelope.py. Every reply goes through these steps before CityLearn sees anything:
- Schema validation. One JSON object, strict Pydantic model: a short reason plus
cooling,dhwandbatteryfor every building. Each value is a finite number ornull. Extra or missing fields, strings, booleans, NaN and infinity are rejected. From prompt version 6 each building may also carryend_trim,nullor a reason of 1 to 300 characters. - Action range. The configured range intersected with CityLearn's own action space.
- Rate limit. At most 0.35 per hour for cooling and 0.5 for the tank and battery, measured from last hour's action or from this hour's baseline action, whichever is closer. Returning to the baseline is never too fast.
- State of charge. No charge or discharge that would take a battery or tank outside 10 to 95 percent.
- Price spread (new in 0.6.0). No grid charging of a battery when no price in the next 24 hours, after the battery's worst round trip efficiency and its standing loss until then, is worth more than the price now, while a cheaper hour is coming. Spare solar the building would otherwise export may still be stored. A flat outlook does not block, since the next peak may lie beyond the forecast.
- Cooling deviation (new in 0.3.0). Cooling may not move more than 0.15 from the baseline action, the fraction that meets the ideal load. Enough to pre-cool, not enough to switch the heat pump off.
- Comfort. In occupied hours within 0.5 C of the comfort band edge, cooling may not drop below the baseline when warm or rise above it when cool. From 0.3.0, an unoccupied building already near the bottom of its band gets no extra cooling either.
- Trim hold (new in 0.8.0). Per building the envelope keeps whether a cooling trim is on (cooling more than 0.002 below the baseline action) and how deep it is. While the room is occupied and more than 0.5 C below its setpoint, the trim stays at least as deep as last hour; within 0.5 C it eases off by at most 0.02 per hour; it ends at once at or above the setpoint, when the room is unoccupied, or when the baseline has no cooling to trim, and no trim may start there.
nullkeeps a held trim, a deeper one is allowed, and a miss of less than 0.002 counts as rounding (the full depth stays held). The model can end a trim early only throughend_trimwith a reason. Every hold action is recorded with its reason in the hour'sholds, and every value it changes is a clamp with ruletrim_hold. It runs after the comfort rule and only keeps cooling below the baseline, within the deviation limit the trim already passed. It is not a ramp limit: it does not taper rises, it keeps a trim on. - Peak limit (new in 0.4.0). Across the district, battery charging and then tank charging are trimmed so the district's estimated draw this hour stays at or below the peak target (the higher of today's peak so far and the forecast of today's peak). Discharging and cooling are never touched by it, and discharging earns no credit in the estimate, so it never understates the load.
0.10.0 changes none of these rules either; a test still pins every EnvelopeConfig field to its 0.8.0 value. 0.9.0 changed none of them. Prompt version 7 shows the agent, per building, the cooling and battery values that pass steps 2 to 8 without a clamp, worked out read only from the envelope's own state (prompt.cooling_range, battery_range, trim_view). One thing it makes visible: null on a held trim is kept by step 8 and still logged as a trim_hold clamp, and where a held trim is deeper than the baseline cooling, cooling 0 is held and logged as a clamp whatever the reply.
Older runs replay with the rule set they were recorded with: the run's manifest stores the envelope settings, and settings missing from an old manifest take the values they had before they existed (no deviation cap or unoccupied guard before 0.3.0, no peak limit before 0.4.0, no spread check before 0.6.0, no trim hold before 0.8.0). The rule-based reference controller runs with the 0.4.0 rules, without the spread check, so its result stays comparable. New runs on prompt versions before 6 run with the 0.7.0 rules (EnvelopeConfig.v070()), without the trim hold, because those prompts do not describe it.
From 0.6.0 the comfort rule acts on the room temperature CityLearn simulated for the hour just finished. Before, it saw the dataset's no-control value for the coming hour (see Version 0.6.0).
null keeps the baseline action for that device. An invalid reply, a timeout, a refusal, a truncated reply or a client error falls back to the baseline action everywhere for that hour. Every clamp and every fallback is logged with the requested value, the applied value and the reason, and both are highlighted in the viewer.
The baseline action under active control is storage idle and the heat pump at the fraction of nominal power that delivers the ideal cooling load. A test checks that running those actions every hour reproduces CityLearn's no-control KPIs (1.000 to six decimals, identical discomfort), so a fallback hour is a no-control hour.
- Key from
HYPERBOLIC_ANTHROPIC_KEY, falling back toTRIAGE_ANTHROPIC_KEY. The key lives only in the environment, never in a file, log or run folder (a test checks this). - Model:
--model haiku(default,claude-haiku-5-5) or--model sonnet(claude-sonnet-5-5). Structured JSON output, low effort, 2000 max tokens. - Hard budget per run,
--budget(default 2.00 USD). Before every call the runner computes that call's worst case (prompt size plus full max tokens). If it could push spending past the budget, model calls stop for the rest of the run and every remaining hour uses the baseline action. - Episode length: the full 719 hours. The 0.2.0 live run averaged about 4,700 characters per request and cost 0.23 USD on Haiku. Prompt version 2 adds the 24 hour outlook and the strategy, about 7,400 characters per request, and the 0.3.0 live Haiku month cost 0.39 USD. Prompt version 3 is about 8,600 characters per request; the 0.4.0 live Haiku month cost 0.47 USD, against a hard worst case of about 0.93 USD. Prompt version 4 adds the reference action, the price plan and the battery limits, about 9,650 characters per request: the 0.6.0 live Haiku month cost 0.57 USD, against a hard worst case of about 0.95 USD. Prompt version 5 adds the smoothing view, about 10,430 characters per request: the 0.7.0 live Haiku month cost 0.63 USD, against a hard worst case of about 0.97 USD and the default 2.00 USD budget. Prompt version 6 adds the trim hold and
end_trim, about 10,930 characters per request (4.8 percent more): the 0.8.0 live Haiku month cost 0.53 USD (5,245 input and 429 output tokens per call), against a hard worst case of about 0.99 USD. Prompt version 7 shows the envelope's ranges and is 1.7 percent smaller, about 10,750 characters: the 0.9.0 live Haiku month cost 0.46 USD (5,185 input and 245 output tokens per call). Prompt version 8 shows the strategy's whole action and is 12.0 percent smaller again, about 9,460 characters: the 0.10.0 live Haiku months cost 0.41 to 0.43 USD, against a hard worst case of about 0.95 USD (0.98 USD for a 743 hour tuning month). Prompt version 9 adds the shave wording andshave_nowand is 2.8 percent larger, about 9,720 characters: a Haiku month should cost about 0.42 to 0.44 USD, against a hard worst case of 0.96 to 0.99 USD. Sonnet costs 20 times as much per token: a full Sonnet month should cost roughly 11 to 13 USD, so under a 2.00 USD budget it stops calling the model after about a sixth of the month and the remaining hours use the baseline action. Raise--budget(about 14 USD) for a full Sonnet run. Each run logs its exact token cost inresult.json.
.\.venv\Scripts\python -m hyperbolic serveThat starts a small local server at http://127.0.0.1:8765 and opens it in your browser. Pick a duration (24 hours, 1 week, the full month or a custom hour count), a controller (claude-haiku-5-5, claude-sonnet-5-5, the rule-based controller or the baseline) and a budget. The page shows an estimated cost from your recorded runs before you press Start. Each hour then lands on the same viewer as it finishes: building tiles, running KPIs against the baseline over the same hours, the agent's reason for every hour in a scrolling log, clamps glowing, district draw against the peak target, and the API spend against the budget. Pause, Resume and Stop work between hours, and one run goes at a time.
- Local only. The server binds 127.0.0.1, answers only requests addressed to 127.0.0.1 or localhost, and refuses cross-site requests that would start or stop a run. It is built on Python's standard library (
http.serverand Server-Sent Events), so it adds no dependency. - The key stays on the server. It is read from
TRIAGE_ANTHROPIC_KEY(orHYPERBOLIC_ANTHROPIC_KEY) and never sent to the page, the logs or the run files. Without a key the Claude options are off, and the rule-based and baseline controllers still work. - The budget is enforced on the server, exactly as
hyperbolic rundoes: model calls stop at the cap and the remaining hours keep the baseline action. - Every live run is recorded in
runs/in the same format ashyperbolic run, sohyperbolic replayreproduces it. A stopped run is saved as partial and scored against a baseline over the same hours. - Publish writes
docs/dataexactly likehyperbolic compare --pair, on your disk only. Nothing is committed or pushed.
Options: --port, --runs-dir, --docs, --no-browser. Live mode only exists when the page is served by hyperbolic serve; the published GitHub Pages replay is unchanged.
Replay viewer and scorecard: docs/index.html, published with GitHub Pages. Both sides shown there are real CityLearn runs on tuning July: the no-control baseline (committed in results/baseline_tuning07) and the live 0.15.0 Haiku run with prompt version 9, claude-haiku-5-5 (see Version 0.15.0). It replaces the 0.10.0 live run on the phase 2 month. The 0.7.0 live run scored worse and was never published (see Version 0.7.0).
To watch a run live on your own machine instead, see Watch it live.
docs/ is a static site with no build step: D3 from cdnjs, two Google Fonts, and the data in docs/data/viewer.js (the same content as viewer.json, as a script so the page also opens straight from disk).
The published data is the 0.15.0 Haiku v9 run on tuning July against results/baseline_tuning07, built with hyperbolic compare --pair results/baseline_tuning07 <run folder>. The dataset id and name on the page come from the run's manifest.
- The headline result, stated as plainly when the agent loses.
- The district for the reference and for the agent side by side: each building as a tile with indoor temperature against its comfort band, battery and hot water tank charge, and grid draw, glowing when the envelope clamps or falls back.
- A timeline with the electricity price along the top, envelope events marked, play and pause, 1x, 10x and 60x speed, and jumps between events.
- Running cost, emissions and discomfort counters for both sides.
- Indoor temperature, district grid draw and battery charge in a rolling window that follows the playhead.
- The agent's one-line reason for every hour, with clamped and fallback hours tagged, each clamp spelled out, and any cooling trim the agent ended early shown with its reason.
- The CityLearn KPI scorecard, run cost, call count and clamp and fallback counts.
- A compact "How it works" strip under the headline (the agent decides, the safety envelope checks, CityLearn simulates, CityLearn scores) and a "Run it yourself" section with the local commands, including
hyperbolic serve.
Dark by default with a light toggle, built for phones first, and it respects reduced motion. To publish it, turn on GitHub Pages: Settings, Pages, Deploy from a branch, main, folder /docs.
From 0.18.0 a second simulator sits beside CityLearn: SustainDC's data hall, pinned to one commit and fetched with hyperbolic hall fetch, with a chiller plant, a thermal mass and four scripted faults added around it, a fixed 18.0 C baseline, its own envelope with the 27.0 C rack inlet limit, and a blind hall prompt. Its runs use the same run folder format, budget, replay and pre-registration as CityLearn's, and the month can run in chunks that resume with zero API calls for the hours already done. Everything about it, including what it does not model, is in DATAHALL.md. Data Hall Live (docs/hall/) replays its 0.18.0 month from docs/hall/datahall.json, written by scripts/export_hall_replay.py --datahall.
python -m pytest -q runs fully offline. Envelope rules and runner logic run against a small fake district for speed; the backend, the CLI and the no-control equivalence run against real CityLearn on the shipped dataset; replay and the viewer builder run against CityLearn runs recorded in tests/fixtures. Covered: live mode through the real server with fake models (a full run streamed, recorded and replayed identically, the streamed hours matching the replay viewer's data, pause and resume, stop saving a partial run, the budget cap, the key never appearing in any response or file, the 127.0.0.1 binding and host checks, and the Claude options off without a key), the peak limiter (never above the target in randomized trials, trims recorded as clamps, battery before tank, off for older runs, and a CityLearn run that replays identically with its trims), the combined signal, the peak tracker, the reason length guard, the forecast horizons (6, 12 and 24 hours, the 0.2.0 mislabel), the 24 hour outlook never using unseen data, all eight prompt versions, EnvelopeConfig pinned field by field to 0.8.0 and the 0.8.0 and 0.9.0 live months replaying 719 of 719 hours when they are on disk, the deviation classes (every cooling, battery and tank class, the strategy's own reply having none, the tolerance, when each happened), the attribution replays (only the listed points replaced, the control reproducing a recorded CityLearn run exactly, a class put back moving the month toward the strategy, the gap shares), the version 8 observation (the strategy's whole action per building inside the ranges, the dropped fields), the version 8 prompt wording and request size, the warm-room cooling (the ramp, none in an outage, an empty room or with a trim held), the version 8 strategy equal to version 7's without a warm room, the night rule off, the scripted version 8 reply, version 8 runs on the fake district and 24 hours of CityLearn that replay identically, a full version 8 CityLearn month below the baseline's too-warm share, the version 8 search grid and rule, the month set (its months and lengths, a tuning month written as its own dataset, run --month recording its month and replaying, the rule-based controller reproducing its tuning month) and the compare report (means only over every month, partial runs marked), the version 7 observation (every trim state with min_depth and end_trim_ok, both ranges, last_clamp, the dropped fields), any value inside the version 7 ranges passing the envelope unclamped in randomized trials, a held trim left to null being clamped while the top of its range is not, the version 7 battery plan (version 5's with the shipped numbers, the soft cap winding a discharge down and leaving spare solar alone, valley filling), the version 7 prompt wording and request size, the scripted version 7 reply, version 7 runs on the fake district and 24 hours of CityLearn that replay identically and a full version 7 CityLearn month, the fitting evaluation and the version 7 search grid, the trim hold (on, hold, ease, release, end at the setpoint, in an empty room and with no baseline cooling, early end with a reason, the rounding allowance, logging, fallback, the deviation and comfort rules still first, off for older runs, and runs that replay byte for byte and detect changed hold settings), the version 6 prompt, observation, end_trim schema and request size, the scripted version 6 reply following strategy_battery, the viewer showing early ends, a 24 hour version 6 CityLearn run that replays identically and a full version 6 CityLearn month, the exact ramping split and the evaluation control reproducing a recorded CityLearn run, the version 4 reference action equal to what the rule-based controller replies, the version 5 smoothing view and strategy (trim hold, slow release, release at the setpoint, gentle charge start, even discharge), a full version 5 CityLearn month with ramping below the baseline, version 5 runs that replay byte for byte and detect a changed observation, the public page's How it works and Run it yourself sections, the spread check (blocked at the top price with its reason, allowed when the coming peak pays, never blocked by a flat weekend, standing losses, spare solar, off for older runs and the rule-based reference), the indoor temperature being the one CityLearn simulated, 24 hour and full-month rule-based dry runs on CityLearn (the full month must still score the 0.4.0 cost, emissions, daily peak, ramping and load factor), a 24 hour version 4 run on CityLearn that replays identically, recorded version 4 runs that replay byte for byte and detect a changed reference policy, a cooling offset moving indoor temperatures, every envelope rule, malformed and schema-breaking replies, fallback on invalid, missing and refused replies, the budget stop, key handling, deterministic replay and tamper detection, replay with CityLearn not even importable, and byte-identical viewer data from the same files in one process or two. From 0.11.0 also: the sealed holdout (its three months kept out of the month set, a schema with only Buildings 4 to 6, the seal matching HOLDOUT.md and failing on a changed or extra file, months, compare, run_month and recorded runs refusing it without --holdout-final, run on it printing no KPIs, and the baseline loading on it), the peak diagnosis (peak hours district and per building, the class ranking, version 8 deviation classes and warm_skipped, replays on their own month and never the holdout, a CityLearn run that never shaves), the version 9 acceptance rule case by case with its pick and grid, the version 9 observation, strategy, wording, request size and scripted reply, version 9 runs that replay on the fake district and on 24 hours of CityLearn, and the four 0.10.0 live months replaying hour for hour when they are on disk. From 0.13.0 also: prompt version 10 (the schema with a required deviation_reason, the suggestion equal to strategy_plan_v9, the fields it adds, what counts as a departure, a departure without a reason falling back, the envelope pinned by hash and versions 1 to 9 pinned by hash, deviations logged, replayed and shown, scripted version 10 equal to version 9 on CityLearn), the published Sonnet and Haiku prices, and scripts/analyze_free_mode.py (control reproducing a run, every departure put back equal to the strategy, a rejected hour staying rejected). From 0.14.0 also: prompt version 11 (the schema, no request naming "suggestion", "strategy" or deviation_reason, every number in the system prompt traced to something other than the strategy and the prompt unchanged when StrategyParamsV9 changes, the observation equal to version 10's without the suggestion, shadow_strategy equal to strategy_plan_v9 every hour and checked on replay, scripted version 11 equal to version 9 on the fake district and on CityLearn, the version 10 prompt and schema pinned by hash, the 0.13.0 runs replaying) and the blind-mode analysis (agreement per device, a changed shadow log caught, the control and the every-departure replay on CityLearn). From 0.15.0 also: prompt version 12 (the schema, the prompt equal to version 11's plus the strategy section, the three rules word for word version 10's with every StrategyParamsV9 number, no request carrying a suggestion, a strategy field or the shadow, the observation equal to version 11's, shadow_strategy equal to strategy_plan_v9 every hour and checked on replay, scripted version 12 equal to version 9 on the fake district and on CityLearn, the version 11 prompt and schema pinned by hash, every recorded run on disk replaying) and the analysis of a version 12 run (read as a blind-mode run, the control and the every-departure replay on CityLearn), the viewer labeling a run off phase 2 with its own dataset id and name, and the published viewer pinned to the 0.15.0 Haiku v9 run on tuning July.
The data hall tests (tests/test_datahall.py) run against SustainDC's pinned files and skip when they are not fetched, unless HYPERBOLIC_REQUIRE_SUSTAINDC is set, as in CI, which fetches them first.
CI (GitHub Actions) runs the tests on Python 3.10 and 3.12 with CPU-only torch, a repository rules check, and an author check that fails if any commit in a push or pull request was not authored by AddisonTech.