abhinavtiwary/datacenter-env
๐ฑ Sustainable Data Center RL Environment
Built for Meta x Scaler OpenEnv Hackathon 2026
An AI agent learns to operate a large-scale data center while minimizing carbon emissions and maximizing operational efficiency.
๐ด [Live Demo โ](/) | ๐ [API Docs โ](/docs)
๐ Why This Matters
Data centers consume 1-2% of global electricity and produce millions of tonnes of COโ annually. Meta, Google, and Microsoft have all committed to carbon-neutral data center operations.
This environment trains AI agents to make the kinds of real-time decisions that could dramatically reduce that footprint โ making it directly relevant to the infrastructure teams at Meta and Hugging Face who will evaluate this submission.
๐ง Environment Design
The Agent Controls:
What the Agent Observes:
{
"avg_temperature": 42.3, # ยฐC across all racks
"failed_racks": 0, # racks that have shut down
"solar_availability": 0.85, # 0-1, depends on weather+time
"wind_availability": 0.62,
"carbon_emissions_kg": 0.0, # this step's CO2
"total_carbon_kg": 12.4, # episode total
"pue": 1.28, # Power Usage Effectiveness
"time_of_day": "morning",
"weather": "sunny",
"incoming_workload": 0.72,
"sla_violations": 0
}Reward Function:
โ๏ธ Configuration
Difficulty Levels
Time of Day Workload
๐ Quick Start
Python Client
import asyncio
from client import DataCenterEnv
from models import DataCenterAction
async def main():
async with DataCenterEnv(
base_url="https://abhinavtiwary-datacenter-env.hf.space"
) as env:
obs = await env.reset(difficulty="medium")
while not obs.observation.done:
o = obs.observation
# Smart agent strategy
cooling = 5 if o.avg_temperature > 60 else 3
power = (
"solar" if o.solar_availability > 0.5 else
"wind" if o.wind_availability > 0.5 else
"hybrid"
)
obs = await env.step(DataCenterAction(
cooling_level=cooling,
workload_distribution="balanced",
power_source=power,
defer_non_critical=(o.time_of_day == "afternoon")
))
print(f"Reward: {obs.reward:.2f} | Carbon: {o.total_carbon_kg:.1f}kg")
asyncio.run(main())REST API
# Start episode
curl -X POST /reset -H "Content-Type: application/json" \
-d '{"difficulty": "hard"}'
# Take action
curl -X POST /step -H "Content-Type: application/json" \
-d '{"cooling_level": 3, "workload_distribution": "balanced",
"power_source": "solar", "defer_non_critical": false}'
# Get grade
curl /grade๐ก API Reference
๐ Baseline Performance Scores
Evaluated over 10 episodes with seed=42.
How to reproduce
# Easy
curl -X POST /reset -d '{"difficulty":"easy","seed":42}' && python inference.py
# Medium
CLUSTER_TASK=medium python inference.py
# Hard
CLUSTER_TASK=hard python inference.py๐งช Baseline Results
EASY difficulty โ Score: 0.93 | Grade: A MEDIUM difficulty โ Score: 0.85 | Grade: A HARD difficulty โ Score: 0.71 | Grade: B
๐๏ธ Project Structure
datacenterenv/ โโโ datacenterenv/ โ โโโ init.py # Package exports โ โโโ env.py # Local testing wrapper โโโ server/ โ โโโ app.py # FastAPI HTTP server โ โโโ datacenter_environment.py # Core RL environment โโโ models.py # Pydantic Action/Observation/State โโโ client.py # OpenEnv WebSocket client โโโ inference.py # Baseline inference script โโโ dashboard.html # Interactive visual dashboard โโโ openenv.yaml # OpenEnv spec manifest โโโ Dockerfile # Container config โโโ README.md # This file ---
Built with โค๏ธ for the Meta x Scaler OpenEnv Hackathon 2026
