Downloads · 30 days
0
kvdharanish69/IncidentTriage
IncidentTriage is a machine learning model from kvdharanish69. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
OpenEnv-IncidentTriage is a reinforcement-learning benchmark environment that simulates an on-call ML engineer responding to production incidents. An AI agent investigates synthetic logs, metrics, and alerts to diagno…
Downloads · 30 days
0
Access
Public
Updated Apr 8, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py88.2 KB · 65%
From the Hugging Face model README
OpenEnv-IncidentTriage is a reinforcement-learning benchmark environment that simulates an on-call ML engineer responding to production incidents. An AI agent investigates synthetic logs, metrics, and alerts to diagnose issues, and then writes a diagnosis, fix plan, and postmortem — all within a specified step budget. It provides partial-credit rewards and features varied difficulties for evaluating agentic reasoning.
+-------------------+ +---------------------+ +-----------------------+
| Agent (LLM) | <---> | FastAPI Server | <---> | IncidentTriageEnv |
| (inference.py) | | (app.py) | | (environment.py) |
+-------------------+ +---------------------+ | |
| - Rate Limiter | | - Step Budget |
| - Secure Validation | | - Tool Dispatch |
| - State Management | | - Score Grader |
+---------------------+ +-----------------------+
| |
+-------------------------+ |
| |
+-------v-------+ +-------v-------+
| Tasks | | Signals |
| (task_easy, | | (JSON logs, |
| task_medium, | | metrics, |
| task_hard) | | alerts) |
+---------------+ +---------------+
| ID | Difficulty | Max Steps | Optimal Steps | Reward Threshold |
|---|---|---|---|---|
task_easy | Easy | 10 | 4 | 0.60 |
task_medium | Medium | 20 | 8 | 0.55 |
task_hard | Hard | 35 | 14 | 0.50 |
| Tool | Args | Description |
|---|---|---|
read_log | {"signal_id": "str"} | Retrieve a server or application log file by signal ID. |
read_metric | {"signal_id": "str"} | Retrieve a time-series metric by signal ID. |
read_alert | {"signal_id": "str"} | Retrieve an alert notification by signal ID. |
query_runbook | {"keyword": "str"} | Search all runbooks for a keyword. |
write_diagnosis | {"text": "str"} | Submit your root-cause diagnosis. |
write_fix | {"text": "str"} | Submit your fix plan with concrete actions. |
write_postmortem | {"text": "str"} | Submit your postmortem report. |
done | {} | End the episode and trigger final grading. |
| Field | Type | Description |
|---|---|---|
task_id | string | The active task configuration. |
step | integer | Number of steps taken (≥ 0). |
budget_remaining | integer | Steps remaining in the episode (≥ 0). |
available_signals | list[string] | List of signal IDs the agent can query. |
last_tool_result | string | Output from the previous action. |
incident_summary | string | High-level summary of the incident event. |
done | boolean | Indicates if the episode has ended. |
The reward function relies on the quality of the submitted diagnosis, fix and postmortem, and penalises inefficiency. Total reward formula bounded in [0.0, 1.0]:
## Weights:
## diagnostic_accuracy = 0.40
## fix_correctness = 0.25
## postmortem_quality = 0.20
## step_efficiency = 0.15
raw = sum(weight * getattr(breakdown, key) for key, weight in REWARD_WEIGHTS.items())
penalty = max(-0.30, -0.01 * max(0, steps_taken - optimal_steps))
total = max(0.0, min(1.0, raw + penalty))
Install locally:
pip install -r requirements.txt
Docker Build:
docker build -t openenv-incident-triage .
Docker Run:
docker run -p 7860:7860 openenv-incident-triage
The backend API will now be available on port 7860.
The inference.py provides the baseline LLM execution path solving all three tasks sequentially. Output adheres precisely to the standardized hackathon [START]/[STEP]/[END] format.
Environment Variables:
| Variable | Default Value | Description |
|---|---|---|
API_BASE_URL | https://router.huggingface.co/v1 | OpenAI API compatible endpoint. |
MODEL_NAME | Qwen/Qwen2.5-72B-Instruct | Model identifier to use. |
HF_TOKEN | None (Required) | Access token for Hugging Face inference. |
ENV_BASE_URL | http://localhost:8000 | The deployed OpenEnv FastAPI server URL. |
TASK_NAME | task_easy | Task ID to run individually (though inference.py runs all). |
MAX_STEPS | 20 | Override to set max steps in the inference wrapper. |
Example Command:
export HF_TOKEN="hf_yourtokenhere"
export ENV_BASE_URL="http://localhost:7860"
python inference.py
To evaluate environment compliance against OpenEnv specifications, ensure your backend server is deployed and run:
validate-submission.sh <your-hf-space-url>
You can also run validation using the openenv CLI tool if installed:
openenv validate
Verify environment integrity and high coverage with:
pytest tests/ -v --cov=openenv_incident_triage --cov-report=term
OpenEnv-IncidentTriage employs strict runtime boundaries to execute safely:
;&|()), path traversal (../), null bytes, and excessively large payloads.extra="forbid").appuser with a read-only signals/ store.You can expand this environment by authoring new scenarios:
signals/.BaseTask in a new file (e.g., tasks/task_custom.py):
signal_ids matching your new signal file IDs.grade_diagnosis, grade_fix, and get_ground_truth.tasks/__init__.py.pytest tests/ to confirm your grading criteria executes securely.TO RUN $env:HF_TOKEN="your_working_token"; $env:ENV_BASE_URL="http://localhost:7860"; .\venv\Scripts\activate; python inference.py