CoolFace
Apppublic

sassy78420/openenv-datacenter-optimisation

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

Data Center Energy Optimization — OpenEnv

An AI agent optimises a data center's energy consumption by tuning server power states, cooling settings, and workload placement — while never violating thermal limits or SLA performance targets.

Why This Environment?

Data centers consume ~1–2 % of global electricity. Operators constantly balance three competing objectives:

ObjectiveMetric
Reduce energyTotal kW, PUE (Power Usage Effectiveness)
Maintain performanceWorkload latency ≤ SLA, no dropped jobs
Stay thermally safeInlet temperature ≤ 40 °C per rack

This environment models those trade-offs with a simplified but physically grounded simulation so RL / LLM agents can learn to make the same decisions a human operator would.


Observation Space

Each observation is a CallToolObservation (OpenEnv spec) containing:

FieldDescription
resultJSON output from the last tool call
metadata.current_scoreNormalised score [0.0, 1.0] reflecting progress
metadata.initial_metricsPUE, power, violations at episode start

Action Space (MCP Tools)

ToolArgumentsDescription
view_datacenter()Overview: total power, PUE, rack summaries, CRAC status
view_rack(rack_id)intDetailed server list for one rack
view_workloads()All workloads with SLA and priority
set_server_power_state(server_id, state)int, `active\idle\sleep\off`Change server power mode
adjust_cooling(crac_id, setpoint_temp, fan_speed_pct)int, float, floatTune CRAC unit
migrate_workload(workload_id, target_server_id)int, intMove a workload to another server
set_power_cap(rack_id, cap_watts)int, floatSet rack power budget
submit_config()Finalise and score the episode

Tasks & Difficulty

TaskScaleKey ChallengesGrader Weights
easy2 racks · 8 servers · 1 CRAC · 6 workloadsIdle servers wasting power, fan speed too highEnergy 60 %, Thermal 20 %, SLA 20 %
medium4 racks · 16 servers · 2 CRACs · 12 workloadsHotspot rack, workload imbalance, overcoolingEnergy 40 %, Thermal 20 %, SLA 20 %, PUE 20 %
hard6 racks · 24 servers · 3 CRACs · 18 workloadsCascading thermals, tight power caps, SLA-critical migrationsEnergy 30 %, Thermal 15 %, SLA 20 %, PUE 15 %, Balance 10 %, Power-cap 10 %

Baseline Scores (Mock Agent — no LLM)

TaskScore
easy0.00
medium0.00
hard0.00

Mock agent submits immediately with no changes, so normalised reward from baseline is 0.0.


Reward Function

  • Per-step delta reward — each step returns new_score - old_score, giving the agent immediate signal for every action.
  • Partial credit across multiple dimensions (energy, thermal, SLA, PUE, balance, power-cap).
  • Penalty via normalisation — the score is normalised against the initial (unoptimised) state, so doing nothing yields 0.
  • Step cap at 20 to prevent infinite loops.

Setup & Usage

Install

bash
pip install -e .

Run Inference

bash
export HF_TOKEN="your_token"
export API_BASE_URL="https://router.huggingface.co/v1"
export MODEL_NAME="Qwen/Qwen3.5-35B-A3B"
python inference.py

Validate OpenEnv Spec

bash
openenv validate

Docker

bash
cd server
docker build -t dc-energy-env .
docker run -p 8000:8000 dc-energy-env

Environment Variables

VariableRequiredDefaultDescription
HF_TOKENYes (for real LLM)Hugging Face API key
API_BASE_URLNohttps://router.huggingface.co/v1LLM endpoint
MODEL_NAMENoQwen/Qwen2.5-72B-InstructModel identifier
DC_TASKNoeasyTask override for the server

Project Structure

├── datacenter_generator.py   # Scenario generation (baseline + golden)
├── graders.py                # Multi-dimensional scoring per task
├── inference.py              # Baseline LLM inference script
├── openenv.yaml              # OpenEnv metadata
├── pyproject.toml            # Python project configuration
├── client.py                 # MCPToolClient wrapper
├── __init__.py               # Package exports
├── server/
│   ├── datacenter_environment.py  # MCPEnvironment implementation
│   ├── app.py                     # FastAPI app factory
│   └── Dockerfile                 # Container build
└── README.md

License

BSD-style license. See LICENSE file.