samnitmehandiratta/my-env
<div align="center">
๐จ SRE Incident Triage
Can your AI survive an on-call shift?
An OpenEnv reinforcement learning environment where agents triage real production incidents โ reading noisy alerts, tracing cascading failures, and recommending the right fix under pressure.
-orange?style=for-the-badge)
</div>
๐ง What Is This?
Every company has an on-call rotation. At 3am, an engineer gets paged โ alerts firing, logs streaming, services cascading. They have minutes to find the root cause and act.
This environment turns that into an RL benchmark.
An AI agent receives the same raw signals a human SRE would see: production alerts, service logs, and real-time metrics. It must investigate, diagnose, and resolve โ just like a real engineer would.
Unlike toy environments, this one models a task where reasoning quality directly determines the score. LLMs that have absorbed engineering knowledge genuinely outperform those that haven't.
๐ฏ Three Incident Scenarios
EASY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ HARD
โ โ โ
โผ โผ โผ
cpu_spike cascading_failure memory_leakโก Agent Action Space
The agent speaks JSON โ clean, structured, LLM-native:
// ๐ Drill into a specific service
{"action_type": "investigate", "service": "payment-service"}
// ๐ฉบ Submit your diagnosis
{
"action_type": "diagnose",
"severity": "critical",
"root_cause": "DB connection pool exhausted after v2.3.1 deploy",
"affected_services": ["payment-service", "checkout-service"]
}
// ๐ ๏ธ Recommend the fix (highest scoring action)
{
"action_type": "resolve",
"severity": "critical",
"root_cause": "payment-service v2.3.1 set DB_POOL_SIZE=500, exceeding DB max_connections=100",
"affected_services": ["payment-service", "checkout-service", "order-service"],
"recommended_action": "rollback payment-service to v2.3.0 and restart connection pool"
}
// โ
End episode
{"action_type": "done"}๐๏ธ Observation Space
Every step, the agent sees:
{
"alerts": [
"CRITICAL: payment-service health check failing (0% healthy pods)",
"HIGH: checkout-service error rate at 78%"
],
"logs": [
"16:44:30 INFO deployment: payment-service v2.3.1 rolled out",
"16:44:31 ERROR payment-service: Failed to acquire DB connection (pool exhausted)",
"16:45:02 ERROR checkout-service: payment-service call timed out after 3000ms"
],
"metrics": {
"payment-service": {"cpu_percent": 12, "error_rate": 100, "healthy_pods": 0},
"payment-db": {"cpu_percent": 98, "active_connections": 500, "max_connections": 100}
},
"step": 2,
"additional_info": null // populated after investigate actions
}๐ Reward Function
Scores are partial โ every step provides signal, not just the final answer:
All scores clamped to (0.01, 0.99) โ never binary, always informative.
Strategy that works best: investigate โ investigate โ resolve (2-step exploration before committing)
๐ Baseline Results
Tested with Qwen/Qwen2.5-72B-Instruct via HuggingFace Router:
cpu_spike โโโโโโโโโโโโโโโโโโโโโ 0.92 โ
Success
cascading_failure โโโโโโโโโโโโโโโโโโโโโ 0.96 โ
Success
memory_leak โโโโโโโโโโโโโโโโโโโโโ 0.66 โ
SuccessThe hard task (memory_leak) genuinely challenges frontier models โ the shared component spans 4 services with no obvious single alert.
๐ Quick Start
# Clone and build
git clone https://github.com/samnitmehandiratta/my-openenv
cd my-openenv
docker build -t sre-triage .
# Run
docker run -p 7860:7860 \
-e HF_TOKEN=hf_... \
-e API_BASE_URL=https://router.huggingface.co/v1 \
-e MODEL_NAME=Qwen/Qwen2.5-72B-Instruct \
sre-triage๐ API Endpoints
๐งช Run Inference Locally
HF_TOKEN=hf_... \
API_BASE_URL=https://router.huggingface.co/v1 \
MODEL_NAME=Qwen/Qwen2.5-72B-Instruct \
python inference.py<div align="center">
Built for the Scaler ร HuggingFace OpenEnv Hackathon 2025
Because the best RL environments are the ones where intelligence actually matters.
</div>
