GauravSethi22/oncall-engineer-env
GitHub: GauravSethi22/oncall-engineer-env
一个用于训练AI代理扮演值班工程师诊断和处理生产环境故障的强化学习模拟环境。
Stars: 0 | Forks: 0
title: 值班工程师环境
emoji: 🚨
colorFrom: red
colorTo: yellow
sdk: docker
pinned: false
tags:
- openenv
# OnCall 工程师环境
一个 OpenEnv 强化学习环境,其中 AI 代理扮演值班工程师的角色,
诊断并解决生产环境软件故障。
## 任务
| 任务 | 难度 | 场景 | 最大步数 |
| ----------------- | ------ | ---------------------------------------- | -------- |
| `easy_crash` | 简单 | 错误部署后支付服务崩溃 | 15 |
| `medium_cascade` | 中等 | 数据库连接耗尽级联故障 | 20 |
| `hard_corruption` | 困难 | 静默数据损坏,无告警 | 25 |
## 基线分数
| 任务 | 随机代理 | 基线 LLM | 我们的代理最佳分数 |
| ----------------- | ------- | -------- | ------------------ |
| `easy_crash` | 0.05 | 0.72 | **0.93** |
| `medium_cascade` | 0.04 | 0.51 | **0.92** |
| `hard_corruption` | 0.02 | 0.38 | **0.83** |
## 设置
```
git clone https://github.com/GauravSethi22/oncall-engineer-env.git
cd oncall-engineer-env
pip install -e .
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reload
```
## 环境变量
| 变量 | 描述 |
| -------------- | ------------------------ |
| `HF_TOKEN` | 您的 Hugging Face / API 密钥 |
| `API_BASE_URL` | LLM API 端点 |
| `MODEL_NAME` | 模型标识符 |
| `ENV_URL` | 环境 URL |
## 运行推理
```
export HF_TOKEN=your_api_key
export API_BASE_URL=https://api.groq.com/openai/v1
export MODEL_NAME=llama-3.3-70b-versatile
export ENV_URL=https://Gaurav206-oncall-engineer-env.hf.space
python inference.py
```
## 动作空间
| 动作 | 必需字段 |
| --------------- | ----------------------------------- |
| `query_logs` | `target_service`, `log_filter`(可选)|
| `check_metrics` | `target_service`, `metric_name` |
| `check_deps` | `target_service` |
| `apply_fix` | `target_service`, `fix_type` |
| `escalate` | `team` |
| `write_summary` | `summary_text` |
## 观察空间
| 字段 | 描述 |
| -------------------- | -------------------------- |
| `alerts` | 当前触发的告警 |
| `services` | 所有 5 个服务的健康状态 |
| `last_action_result` | 上一个动作返回的结果 |
| `elapsed_minutes` | 故障发生以来的时间 |
| `unlocked_hints` | 逐步解锁的提示 |
## API 端点
| 端点 | 方法 | 描述 |
| ------- | --------- | ------------------ |
| `/health` | GET | 健康检查 |
| `/reset` | POST | 开始新 episode |
| `/step` | POST | 执行动作 |
| `/state` | GET | 当前 episode 状态 |
| `/ws` | WebSocket | 持久连接 |
## 项目结构
```
oncall-engineer-env/
├── models.py ← typed Action, Observation, State
├── client.py ← what the agent imports
├── inference.py ← baseline agent script
├── openenv.yaml ← hackathon manifest
├── pyproject.toml ← dependencies
├── README.md
├── oncall_env/
│ └── __init__.py
└── server/
├── app.py ← FastAPI server
├── environment.py ← main game logic
├── simulator.py ← fake production system
├── tasks.py ← 3 incident scenarios
├── graders.py ← scoring functions
└── Dockerfile
```
标签:AIOps, Apex, DLL 劫持, Docker, Hugging Face, LLM, Python, SRE, Unmanaged PE, Uvicorn, 事件管理, 事故响应, 人工智能, 偏差过滤, 大语言模型, 安全防御评估, 容错, 开源, 强化学习, 故障诊断, 无后门, 智能代理, 服务可用性, 服务网格, 机器学习, 模块化设计, 生产环境, 用户模式Hook绕过, 系统恢复, 自动化修复, 请求拦截, 运维自动化, 逆向工具