具有 MCP 支持的 PyTorch HUD API
用于与 PyTorch HUD API 交互的 Python 库和 MCP 服务器,提供对 CI/CD 数据、作业日志和分析的访问。
概述
该项目提供了用于 PyTorch CI/CD 分析的工具,包括:
- 工作流、作业和测试运行的数据访问
- 大型 CI 日志的高效日志分析
- ClickHouse 查询集成用于分析
- 资源利用率指标
用途(针对人类)
# Install from GitHub repository
pip install git+https://github.com/izaitsevfb/claude-pytorch-treehugger.git
claude mcp add hud pytorch-hud
发展
# Install dependencies (if not installing with pip)
pip install -r requirements.txt
# Start MCP server
python -m pytorch_hud
主要特点
数据访问
get_commit_summary
:不含作业的基本提交信息get_job_summary
:汇总作业状态计数get_filtered_jobs
:按状态/工作流/名称过滤的作业get_failure_details
:失败的作业,包含详细的失败信息get_recent_commit_status
:包含作业统计信息的最近提交的状态
日志分析
download_log_to_file
:将日志下载到本地存储extract_log_patterns
:查找错误、警告等。extract_test_results
:解析测试执行结果filter_log_sections
:提取特定的日志部分search_logs
:跨多个日志搜索
发展
# Run tests
python -m unittest discover test
# Type checking
mypy -p pytorch_hud -p test
# Linting
ruff check pytorch_hud/ test/
文档
执照
麻省理工学院