Inference AIops

io.github.AIops-tools由 GitHub 账号 AIops-tools 发布v0.13.0更新于 Oct 30, 2026

Governed GPU inference ops (vLLM + Ray Serve): latency RCA, scaling, drain, 39 tools.

概览

AI 生成的概览

面向 GPU 推理集群(vLLM、Ray Serve、SGLang、TGI)的受治理 AI 运维 MCP 服务器,提供延迟根因分析、扩缩容、排空与部署工具,并带审计日志。

可以做什么
  • 读取 vLLM 指标并做排序式延迟根因分析(队列深度、KV 缓存压力、前缀缓存局部性),以及低利用率诊断
  • 跨 vLLM、SGLang、TGI 查看引擎健康、清单、请求指标与队列深度
  • 读取 Ray Serve 部署、副本列表、自动扩缩配置以及 Ray 集群、作业与 GPU 状态
  • 写入 Ray Serve 控制面:扩容、缩容、缩到零、更新自动扩缩配置、排空副本、重启副本、取消作业
  • 管理模型:列出与查看模型、加载与卸载 LoRA 适配器、休眠与唤醒模型、部署、取消部署、重新部署与更新路由策略
  • 估算每 token 成本,并把每次调用连同风险等级与撤销描述记录到本地审计数据库
适用场景
适合自建 GPU 推理栈的运维场景:让助手诊断推理变慢、找出闲置 GPU,并在有审计记录的前提下执行受控的扩缩容或部署变更。主要面向 vLLM 与 Ray Serve,对 SGLang 和 TGI 提供只读可观测能力。
运行要求
以 PyPI 包形式通过 stdio 在本地运行(uv tool install 或 pipx),插件方式安装还需 PATH 中有 uvx。需要能访问引擎的 OpenAI API 与 Prometheus /metrics 端点以及 Ray 仪表盘;用 init 向导配置引擎、主机、端口与协议。bearer token 可选,若已保存则需用 INFERENCE_AIOPS_MASTER_PASSWORD 解锁。休眠模式工具要求服务端以 VLLM_SERVER_DEV_MODE=1 启动。
安装前请注意
39 个工具中有 16 个会写入集群,包括高风险的缩容、缩到零、排空、重启、取消部署、重新部署、卸载 LoRA 与模型休眠;虽有 dry-run 与二次确认,但没有只读开关、策略文件或审批门,权限需靠限制网络访问来落实。每次调用都会写入本地审计数据库。以导出变量形式设置的 INFERENCE_AIOPS_MASTER_PASSWORD 对子进程可见并会留在 shell 历史中。行为仅在模拟环境中测试,未在真实生产集群验证。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Inference AIops,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Inference AIops

Audit availability: Real writes require a committed pending audit row and stop before contacting the platform if storage is unavailable. Reads and previews may continue with a warning; new audit rows store outcome summaries rather than full responses.

Disclaimer: Community-maintained open-source project. Not affiliated with, endorsed by, or sponsored by the vLLM or Ray projects or any inference-serving vendor. Product and trademark names belong to their owners. MIT licensed.

Governed AI-ops for GPU inference clusters — vLLM (OpenAI API + Prometheus /metrics) and Ray Serve / Ray Jobs (Ray dashboard), plus the single-process serving engines SGLang and TGI (Text Generation Inference) — with a built-in governance harness: unified audit log, policy engine, token/runaway budget guard, undo-token recording, and descriptive risk-tier labels on every audit row. It parses each engine's Prometheus /metrics directly (no Prometheus server required) and probes the Ray dashboard independently. A bearer token is optional (many stacks run open).

Serving engines. vLLM is the flagship (full Ray Serve control plane: scale, drain, autoscale, LoRA, hot-swap). SGLang and TGI are supported for engine-agnostic observability — health, running-model identity, request-latency metrics, queue depth, and latency RCA — read from each engine's own endpoints and metric names. Being single-process servers, they have no Ray-shaped scale/drain API: those writes return a teaching error pointing you at a real horizontal-scale layer (Ray Serve / Kubernetes / a load balancer).

What it does

The flagship value is root-cause analysis, wrapped in guarded reads and writes:

  • diagnose_latency_spike (flagship RCA) — when TTFT/TPOT/e2e latency climbs, it correlates queue depth (running vs waiting), KV-cache pressure / preemptions, and prefix-cache locality into a ranked cause plus the specific knob to turn (add replicas, raise max-num-seqs, fix routing, enlarge KV cache). Every flag is a number, not a black-box verdict.
  • diagnose_low_utilization — the inverse: idle GPUs, over-provisioned replicas, or routing that strands a cache-warm replica → what to scale down.
  • Prometheus-native — reads vLLM's /metrics endpoint directly; no Prometheus/Grafana deployment needed.
  • Governance-grade — the first governance-grade entrant in this niche: audit + budget + risk-tier approval + undo-token + prompt-injection sanitize, with dry-run + double-confirm on the fragile prod ops (scale-down, scale-to-zero, drain, redeploy, hot-swap) the community reports as dangerous.
  • Laptop self-test — ~80% of the tool self-tests free: vLLM on a single GPU or CPU-mock + Ray in one local container (ray start --head).

What this tool does, and does not, decide

It delivers inference-cluster operations — reads and writes — accurately and efficiently, and records every one of them. It does not decide whether a write is allowed to happen. That is the agent's judgement, or the permission of the environment you connect it with: restrict the network path so it can only reach the read/metrics endpoints, or run the Ray dashboard without its job-submission API, and the writes fail at the server — the place that actually owns the permission.

So there is no read-only switch, no policy file, no approval gate to configure. The one thing the tool guarantees is that nothing is silent: every call, over MCP and over the CLI alike, lands an audit row in ~/.inference-aiops/audit.db, and destructive writes still capture their before-state and record an inverse where one exists.

Each tool declares a risk_level, kept in agreement with its [READ]/[WRITE] documentation tag by a test, and carried into the audit row as a descriptive tier — so a reviewer can see at a glance that a row was a high-risk scale-to-zero. It is a label, not a gate.

Running a smaller / local model? See agent-guardrails.md — it lists the guardrails this tool enforces for you (so you don't spend prompt budget restating them) and gives a ready-made system prompt for what's left.

Capability matrix (39 MCP tools)

GroupToolsCountR/W (risk)
Metrics & RCA (vLLM)request_metrics, queue_depth, kv_cache_stats, diagnose_latency_spike, diagnose_low_utilization5read
Engine-agnostic (vLLM / SGLang / TGI)engine_health, engine_inventory, engine_request_metrics, engine_queue_depth, diagnose_engine_latency5read
Ray Serve (read)serve_deployment_list, deployment_status, replica_list, autoscale_config_get4read
Ray Serve (write)scale_replicas_up, scale_replicas_down, scale_to_zero, autoscale_config_update, drain_replica5write (med / high)
Models / vLLMmodel_list, model_info, model_is_sleeping, lora_load, lora_unload5read + write (med)
Sleep Mode / vLLM (needs VLLM_SERVER_DEV_MODE=1)model_sleep, model_wake2write (high / med)
Ray cluster / jobs / GPUray_cluster_resources, ray_dashboard_status, ray_job_list, gpu_utilization, ray_job_cancel, replica_restart6read + write (med / high)
Deploy lifecyclemodel_deploy, model_undeploy, deployment_redeploy, routing_policy_update4write (med / high)
Costcost_per_token1read

The engine-agnostic group works against any supported engine (including vLLM); use it for SGLang/TGI targets or a uniform view across a mixed fleet. The Ray Serve / cluster / deploy write groups are vLLM-only (Ray control plane) — they teach-and-refuse on a SGLang/TGI target.

23 read, 16 write. High-risk writes (scale_replicas_down, scale_to_zero, drain_replica, lora_unload, model_sleep, replica_restart, model_undeploy, deployment_redeploy) all support dry_run + double-confirm; reversible writes record an undo descriptor.

Sleep Mode requires a dev-mode server. vLLM registers /sleep, /wake_up and /is_sleeping only when started with VLLM_SERVER_DEV_MODE=1. Against any other server these three tools report that the route is absent and why, rather than failing vaguely. Sleep Mode suspends the same model; it does not swap base models — serving a different base model means restarting vLLM with a different --model.

Install

bash
uv tool install inference-aiops          # or: pipx install inference-aiops

Quick start

As a Claude Code plugin

One install gives an agent both the skill and the MCP server:

/plugin marketplace add AIops-tools/marketplace/plugin install inference-aiops@aiops-tools

The MCP server is fetched with uv and pinned to the package version this plugin declares, so an audit row can be traced back to the code that wrote it. Credentials are still configured with inference-aiops init — see below.

As an OpenClaw plugin

The same bundle is published on ClawHub, where one install delivers the skill and its MCP server together:

bash
openclaw plugins install clawhub:@zw008/inference-aiopsopenclaw skills info inference-aiops          # expect: Visible to model: yes

Restart the OpenClaw gateway afterwards so it loads the plugin. The MCP server is fetched with uv, pinned to this exact release, so uvx has to be on PATH — without it the skill still installs but reports Visible to model: no. Credentials are configured exactly as below.

As a CLI or standalone MCP server

bash
inference-aiops init                     # wizard: engine (vllm/sglang/tgi) + host + port + schemeinference-aiops doctor                   # vLLM: probes Ray + vLLM; SGLang/TGI: engine health + inventoryinference-aiops overview                 # deployments + total replicas + queue backpressureinference-aiops metrics diagnose         # why is inference slow? ranked RCA + the knob to turninference-aiops serve list               # Ray Serve deployments + replica counts

Run as an MCP server (stdio) for the full 39-tool surface:

bash
export INFERENCE_AIOPS_MASTER_PASSWORD=...   # only if a bearer token is storedinference-aiops mcp

Where that password then lives: an exported variable is readable by every process this shell starts and is recorded by shell history. On a shared or long-lived host, prefer the interactive prompt, or inject it from a secret manager for the life of the one command that needs it.

The CLI is a convenience subset (init, overview, serve …, metrics …, secret …, doctor, mcp); the full 39 tools are exposed via the MCP server.

Governance

Every MCP tool passes through the bundled @governed_tool harness. It does not decide whether a write is permitted — see What this tool does, and does not, decide above — but it records every call:

  • Audit — every call (params, outcome summary, status, duration, risk tier, and any approver/rationale annotation) logged to ~/.inference-aiops/audit.db (relocatable via INFERENCE_AIOPS_HOME).
  • Budget / runaway guard — a safety backstop, not authorization: token and call budgets trip a circuit breaker on tight poll/retry loops.
  • Risk tier — each audit row carries a descriptive tier derived from the tool's risk_level; it is a label, not a gate. INFERENCE_AUDIT_APPROVED_BY / INFERENCE_AUDIT_RATIONALE are optional annotations recorded when set, never required.
  • Undo recording — reversible writes (scale, autoscale-config, routing, hot-swap, LoRA load) record an inverse descriptor.

Supported scope + limitations

Behaviour is exercised by the test suite against mocked vLLM /metrics, vLLM OpenAI API, and Ray dashboard responses. ~80% of the tool self-tests on a laptop — vLLM on a single GPU or CPU-mock plus a local one-node Ray head. It has not been run against a live production cluster; see docs/VERIFICATION.md for the live-verification checklist.

Unverified against real hardware / topology:

  • multi-GPU tensor-parallel / pipeline-parallel deployments,
  • real GPU thermal / throttle telemetry (utilisation is best-effort from the Ray dashboard's /api/nodes),
  • multi-node drain and node-reboot orchestration.

The fastest live check is inference-aiops doctor; the full checklist lives in docs/VERIFICATION.md.

Missing a capability?

This is the GPU-inference member of the AIops-tools family (governed AI-ops with audit + budget + undo + risk tiers). If a vLLM or Ray capability you need is missing, or your stack speaks a dialect these tools don't yet handle — open an issue or a PR. Contributions welcome.

来源:README.md,提交 d7e0e39

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

5
  1. v0.13.0最新Oct 30, 2026
  2. v0.12.0Oct 15, 2026
  3. v0.11.0Oct 15, 2026
  4. v0.10.4Sep 17, 2026
  5. v0.10.3Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分