Spaces:
Sleeping
Sleeping
| """ | |
| SRE Agent β Gradio Web Interface | |
| A production-grade SRE (Site Reliability Engineering) Agent system | |
| powered by smolagents with multi-agent orchestration. | |
| Features: | |
| - 16 specialized SRE tools across 6 categories | |
| - Multi-agent architecture (Manager + 4 specialist agents) | |
| - Time-series anomaly detection (Z-score, Isolation Forest) | |
| - Root cause analysis with multi-signal correlation | |
| - Log analysis with pattern extraction | |
| - SLO checking, alert management, runbook search | |
| - Full incident report generation | |
| """ | |
| import os | |
| import gradio as gr | |
| from smolagents import GradioUI | |
| from sre_agent import create_sre_agent | |
| def main(): | |
| model_id = os.environ.get("MODEL_ID", "Qwen/Qwen2.5-Coder-32B-Instruct") | |
| verbose = int(os.environ.get("VERBOSE", "1")) | |
| print(f"π Initializing SRE Agent with model: {model_id}") | |
| print("π¦ Creating multi-agent system...") | |
| agent = create_sre_agent(model_id=model_id, verbose=verbose) | |
| print("β SRE Agent ready!") | |
| print(f" - Manager: CodeAgent (planning_interval=3, max_steps=20)") | |
| print(f" - Sub-agents: metrics_analysis, log_analysis, rca, infrastructure") | |
| print(f" - Tools: 16 specialized SRE tools") | |
| # Use smolagents' built-in GradioUI | |
| ui = GradioUI(agent) | |
| ui.launch( | |
| server_name="0.0.0.0", | |
| server_port=7860, | |
| share=False, | |
| ) | |
| if __name__ == "__main__": | |
| main() | |