archietans/cloud-finops-agent
Cloud FinOps & Cost Optimization Agent (OpenEnv)
Environment Description and Motivation
The Cloud FinOps Agent is an OpenEnv native simulation of a critical real-world enterprise task: optimizing cloud computing infrastructure efficiently. Companies waste millions of dollars annually on overprovisioned or completely idle cloud instances. This environment challenges reinforcement learning agents and LLMs to identify "zombie" infrastructure and dynamically "right-size" instances, strictly balancing cost savings against hard operational limits (such as max CPU constraints and High-Availability SLAs).
This is NOT a toy environment. It perfectly mathematically maps to actual FinOps challenges faced by AWS/GCP engineers daily.
Setup and Usage Instructions
- Install OpenEnv & Requirements
pip install -r requirements.txt- Validate the Environment Spec
openenv validate- Run the Baseline Agent Locally
export OPENAI_API_KEY="your-key"
python inference.py- Build and Test the Docker Container
docker build -t finops_agent .
docker run -e OPENAI_API_KEY="dummy" finops_agentAction and Observation Space
- Observation Space: A list of active Cloud
Instanceobjects (metadata:id,type,cpu_utilization,is_mission_critical,cost_per_hour). - Action Space:
terminate(turn off the instance),resize(downgrade or upgrade the instance to another tier), orwait(end the optimization cycle).
Tasks
We have defined 3 deterministic tasks escalating in complexity:
- The Zombie Slayer (Easy):
- Goal: Terminate only the instances with 0.0% CPU utilization.
- Penalty: High penalty for terminating active workloads.
- The Right Sizer (Medium):
- Goal: Resize severely overprovisioned instances (e.g., M5.XLARGE running at 4% capacity) to smaller, cheaper instances (e.g., T3.MICRO) to maximize dollar savings.
- Penalty: Auto-fails if any instance breaches 85% simulated CPU load.
- The SLA Defender (Hard):
- Goal: Optimize a complex web application stack containing "mission_critical" databases.
- Penalty: Instant
0.0score if the agent touches amission_criticalinstance, requiring precision planning.
Baseline Scores
Our provided inference.py achieves perfect scores (1.0) on all 3 tasks natively by correctly adhering to the grading thresholds and avoiding SLA breaches.
Deploying to HuggingFace
Because we've fully containerized this application and correctly defined openenv.yaml, deploying to Hugging Face Spaces requires simply uploading this repository and selecting "Docker" space type.
