ShubhamBuchwani/META-Hackathon
0
FinOps Cloud Optimizer — OpenEnv Environment
A production-grade RL environment for cloud infrastructure cost optimization. Evaluates AI agents on multi-step reasoning, numerical analysis, constraint-aware planning, and safety-first decision-making.
Problem
Cloud waste costs enterprises $17.6B/year (Flexera 2024). Traditional FinOps tools are rule-based and miss context-dependent decisions. This environment challenges AI agents to perform real-world FinOps:
- Analyze resource utilization (average vs. p95 traps)
- Identify waste across multi-account, multi-region infrastructure
- Propose safe optimizations (rightsize, terminate, schedule, reserve, migrate)
- Maintain production SLAs — breaking prod is heavily penalized
No existing RL/AI benchmark covers this domain.
Why It Matters
- Direct dollar-value outcomes — not proxy metrics
- Tests investigation-first reasoning — agents must ANALYZE before acting
- Safety-aware optimization — production incidents reduce score by 40% each
- Multi-step planning — 15–60 step episodes with dependency chains and traps
- Real-world deployable — companies could use this to evaluate their FinOps AI tools today
Environment API
The environment runs as a FastAPI server:
Action Space
Observation Space
Partial observability: Detailed utilization metrics (p95, memory, IOPS) for each resource are hidden until the agent calls ANALYZE on that resource.Tasks
Task 1 — Sandbox Cleanup (Easy)
- Scope: 1 AWS account, 1 region, 8 resources
- Spend: $4,200/month | Target: -15% ($630)
- Optimal savings: $890
- Max steps: 15
- Trap: Staging EC2 has low average CPU but high p95 from CI/CD — don't terminate it, rightsize it.
Task 2 — Cross-Account Right-Sizing (Medium)
- Scope: 3 AWS accounts, 2 regions, 20 resources
- Spend: $28,500/month | Target: -20% ($5,700)
- Optimal savings: $7,200
- Max steps: 30
- Traps: (1) Production RDS looks idle on average but p95 is 78% during nightly batch. (2) Two reserved instances expire in 30 days — proactively identify and renew.
Task 3 — Enterprise Transformation (Hard)
- Scope: 5 AWS accounts, 3 regions, 45 resources
- Spend: $142,000/month | Target: -25% ($35,500)
- Optimal savings: $48,000
- Max steps: 60
- Traps: (1) Mislabeled "development" account serves production tools. (2) GPU instances need scheduling, not termination. (3) NAT Gateway can be replaced with VPC endpoints. (4) Circular dependency between cross-account resources.
Reward Design
Dense per-step reward:
R = R_savings + R_investigation + R_safety + R_efficiencyGrading
Each episode is scored 0.0–1.0:
Score = 0.40×Coverage + 0.30×Safety + 0.15×Efficiency + 0.15×DiligenceTask-specific bonus modifiers reward proactive optimization (RI renewal, architectural flags, trap avoidance).
Setup
Prerequisites
- Python 3.11+
- Docker (for containerized deployment)
Local Setup
git clone <repo>
cd finops-env
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 7860Docker
docker build -t finops-env .
docker run -p 7860:7860 finops-envRunning the Baseline Agent
export API_BASE_URL=https://api.openai.com/v1
export OPENAI_API_KEY=sk-...
export MODEL_NAME=gpt-4o-mini
export ENV_URL=http://localhost:7860
python run_baseline.py --task sandbox_cleanup
python run_baseline.py --task cross_account_rightsizing
python run_baseline.py --task enterprise_transformationBaseline Results
Hugging Face Space Deployment
Set environment variables in Space settings:
API_BASE_URL— LLM inference endpointMODEL_NAME— Model identifierHF_TOKEN— HuggingFace tokenOPENENV_TASK— Task to run
Space type: Docker | Port: 7860
Validation
# Validate openenv.yaml
openenv validate openenv.yaml
# Quick smoke test
curl http://localhost:7860/health
curl -X POST http://localhost:7860/reset -H "Content-Type: application/json" -d '{"task_id":"sandbox_cleanup"}'
curl -X POST http://localhost:7860/step -H "Content-Type: application/json" -d '{"action_type":"analyze","target_resource":"ec2-sandbox-dev-01","parameters":{}}'
curl http://localhost:7860/grade- All 3 tasks run in < 3.5 minutes total
- Environment memory: < 160MB RAM (pure Python, no ML models)
- Runs comfortably on 2 vCPU / 8GB RAM
