当前位置: 首页 > Skill >

Inference AIops

Inference AIops

Inference AIops

Use this skill whenever the user needs to operate a GPU inference cluster — vLLM (OpenAI API + Prometheus /metrics) and Ray Serve / Ray Jobs (Ray dashboard), plus the single-process serving engines SGLang and TGI (Text Generation Inference): a one-shot cluster overview (deployments + total replicas + queue backpressure), request metrics (TTFT / TPOT / e2e latency + token totals), queue depth, KV-cache stats (utilisation, prefix-cache hit rate, preemptions), the flagship latency root-cause analys

0.13.0 2026.11.22 920
获取Skill文件查看使用说明
作 者:周安 许可证: 更新时间:2026.11.22
本文目录展开

Inference AIops

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. Source at github.com/AIops-tools/Inference-AIops under the MIT license.

Governed GPU-inference operations for vLLM (OpenAI API + Prometheus /metrics) and Ray Serve / Ray Jobs (Ray dashboard), plus the single-process serving engines SGLang and TGI — 39 MCP tools, every one wrapped with the bundled @governed_tool harness: a local unified audit log under ~/.inference-aiops/, policy engine, token/runaway budget guard, undo-token recording, and descriptive risk-tier labels on every audit row. The flagship diagnose_latency_spike folds queue depth + KV-cache pressure + prefix-cache locality into a ranked cause and the specific knob to turn; the engine-agnostic diagnose_engine_latency does the same across whatever signals SGLang/TGI expose. Each engine's Prometheus /metrics is parsed directly — no Prometheus server required.

Standalone: the governance harness is bundled in the package (inference_aiops.governance) — no external skill-family dependency. A bearer token is optional (many stacks run open).

What This Skill Does

Group Tools Count Read or Write
Metrics & RCA (vLLM) request metrics, queue depth, KV-cache stats, diagnose latency spike, diagnose low utilisation 5 5 read
Engine-agnostic (vLLM/SGLang/TGI) engine health, engine inventory, engine request metrics, engine queue depth, diagnose engine latency 5 5 read
Ray Serve (read) deployment list, deployment status, replica list, autoscale config get 4 4 read
Ray Serve (write) scale up (med), scale down (high), scale-to-zero (high), autoscale config update (med), drain replica (high) 5 5 write
Models / vLLM model list, model info, LoRA load (med), LoRA unload (high), base hot-swap (high) 5 2 read / 3 write
Ray cluster / jobs / GPU cluster resources, dashboard status, job list, GPU utilisation, job cancel (med), replica restart (high) 6 4 read / 2 write
Deploy lifecycle deploy (med), undeploy (high), redeploy (high), routing policy update (med) 4 4 write
Cost cost per token 1 1 read

23 read, 16 write, plus undo_list / undo_apply — 39 MCP tools in total. The high-risk writes support dry_run + double-confirm; reversible writes record an undo descriptor. The engine-agnostic reads cover any engine; the Ray Serve / cluster / deploy write groups are vLLM-only and teach-and-refuse on a SGLang/TGI target (single-process engines have no Ray control plane).

Quick Install

uv tool install inference-aiops
inference-aiops init       # interactive wizard: engine (vllm/sglang/tgi) + host + port + scheme (token optional)
inference-aiops doctor     # vLLM: probes Ray + vLLM; SGLang/TGI: engine health + inventory

When to Use This Skill

  • Triage a cluster (overview): Serve deployments, total replicas, queue backpressure
  • Diagnose slow inference (metrics diagnose / diagnose_latency_spike): rank the cause (queue depth vs KV-cache preemption vs prefix-cache locality) and get the knob to turn
  • Find idle GPUs and over-provisioned replicas (diagnose_low_utilization)
  • Scale a Ray Serve deployment up/down, scale-to-zero to stop cost bleed, or update autoscale bounds
  • Drain a replica gracefully before a node reboot (finishes in-flight requests)
  • Load/unload a LoRA adapter; hot-swap a base model (Sleep-Mode swap, captures the prior model)
  • Inspect GPU utilisation per node, list/cancel Ray jobs, restart a stuck replica
  • Compute cost per million tokens from throughput × GPU $/hr
  • Observe an SGLang or TGI server (engine_health, engine_inventory, engine_request_metrics, engine_queue_depth, diagnose_engine_latency) — single-process engines with no Ray control plane

Do NOT use for non-inference infrastructure (hypervisors, storage appliances, backup products, general container workloads, network devices, or OT/industrial equipment) — those belong to other AIops-tools. This skill is scoped to GPU inference serving (vLLM + Ray).

Related Skills — Skill Routing

If the user wants… Use
vLLM / Ray Serve inference: latency RCA, autoscale, drain, LoRA, cost/token inference-aiops (this skill)
SGLang / TGI serving: health, running-model inventory, request metrics, queue depth, latency RCA inference-aiops (this skill — engine-agnostic reads)
Any non-inference infrastructure (hypervisor, storage, backup, general clusters, network, OT) the appropriate other AIops-tools line

Common Workflows

1. "Inference got slow this afternoon" (flagship RCA → the right knob)

  1. inference-aiops doctor → confirm the vLLM endpoint and Ray dashboard are actually reachable before blaming the model
  2. inference-aiops overview → Serve deployments, total replicas, and whether queue backpressure is cluster-wide or one deployment
  3. inference-aiops metrics diagnose (MCP: diagnose_latency_spike) → a ranked cause with the measured numbers: is waiting queue depth high (backpressure)? Are there KV-cache preemptions (kv_cache_stats)? Has the prefix-cache hit rate dropped (routing lost locality)?
  4. Turn the knob the RCA names, not a guess:
    • backpressure → inference-aiops serve scale <app> <deployment> --replicas N (scale_replicas_up, reversible, prior count captured)
    • KV-cache preemption → autoscale_config_update to lower the concurrent-request cap (reversible, prior config captured)
    • lost locality → routing_policy_update to prefix-aware / session-affinity (reversible)
  5. Re-check inference-aiops metrics requests (TTFT / TPOT / e2e) and inference-aiops metrics queue to confirm the p99 actually moved
  6. Failure branch: if the fix makes it worse, inference-aiops undo list → inference-aiops undo apply <id> restores the exact prior replica count / autoscale config / routing policy. If diagnose_latency_spike reports no clear cause, the bottleneck is likely upstream of serving — check gpu_utilization for a throttling or shared-GPU problem before scaling anything.

2. Off-peak cost save: scale a deployment down to zero and bring it back

  1. inference-aiops metrics requests → confirm traffic really is idle, not just briefly quiet
  2. diagnose_low_utilization → the deployments actually burning GPU for nothing, with the measured utilisation
  3. cost_per_token → quantify the bleed ($/1M tokens at the current throughput) so the change is justifiable in the audit trail
  4. (optional) export INFERENCE_AUDIT_APPROVED_BY=you INFERENCE_AUDIT_RATIONALE="off-peak cost save" → annotates the audit row with who/why; recorded when set, never required
  5. inference-aiops serve scale-to-zero <app> <deployment> --dry-run, then re-run without --dry-run → high risk, double confirmation. scale_to_zero stops the bleed but strands ingress — requests will queue or fail until replicas return
  6. To restore: inference-aiops undo apply <id> (replays the captured prior replica count) or inference-aiops serve scale <app> <deployment> --replicas N
  7. Failure branch: if traffic arrives while at zero, restore immediately via undo — do not wait for autoscale, since scale_to_zero may have been applied outside the autoscaler's floor. If the restore fails, serve status will show the deployment unhealthy; deployment_redeploy is the last resort (high risk, disruptive).

3. Drain a replica before a node reboot

  1. inference-aiops serve list / replica_list → identify the replicas pinned to the node you are about to reboot
  2. queue_depth → confirm the remaining replicas can absorb the load; if not, scale_replicas_up first so draining does not cause a brownout
  3. drain_replica <app> <deployment> <replica_id> --dry-run, then confirm → high risk; the drain finishes in-flight requests before removing the replica
  4. Watch replica_list until the replica is gone and request_metrics shows no error spike, then reboot the node
  5. Failure branch: if the drain hangs on a long-running request, replica_restart forcibly cycles it — that drops in-flight requests, so only reach for it once you accept the loss. Multi-node drain has not been verified against a live cluster (see docs/VERIFICATION.md).

4. Free GPU memory between bursts with Sleep Mode, then resume

  1. model_is_sleeping → is the engine already suspended? null means the engine did not report it — that is UNKNOWN, not awake, so resolve it before writing
  2. request_metrics / queue_depth → confirm the engine is actually idle; sleeping a busy engine drops live traffic
  3. model_sleep --dry-run, then confirm → high risk. Level 1 offloads the weights to CPU RAM and wakes fast; level 2 discards them, so waking reloads from disk. The undo descriptor is recorded only if the engine was observed awake first — an already-sleeping engine records none, so an undo can never wake something this call did not suspend
  4. Verify: model_is_sleeping reports true, and GPU memory has been released (gpu_utilization)
  5. Resume with model_wake (medium risk), or inference-aiops undo apply <id> to replay the recorded inverse. model_wake itself records no undo: vLLM reports whether the engine sleeps but never at which level, and guessing between level 1 and level 2 would be inventing a prior state
  6. Failure branch: if any of the three tools reports that the route does not exist, the server was not started with VLLM_SERVER_DEV_MODE=1. That is a server start-up flag, not a fault in the tool and not a stale id — restart vLLM with the flag, or leave Sleep Mode off if this is a production deployment that should not expose it.

vLLM has no in-place base-model swap. Sleep Mode suspends and resumes the same model; serving a different base model means restarting vLLM with a different --model. For adapter-level changes use lora_load (reversible) and lora_unload (high).

Governance & Safety

The skill delivers reads and writes and records them; it does not decide whether a write is permitted. That is your agent's judgement, or the permission of the environment you connect it with (a network path that only reaches the read/metrics endpoints, a Ray dashboard without its job-submission API — writes then fail at the server). There is no read-only switch, policy file, or approval gate.

  • Audit is the guarantee, and it is not bypassable. Every operation — MCP and CLI alike — is logged to ~/.inference-aiops/audit.db (relocatable via INFERENCE_AIOPS_HOME): params, result, status, duration, and the risk tier. The CLI writes the same row the MCP path does.
  • INFERENCE_AUDIT_APPROVED_BY / INFERENCE_AUDIT_RATIONALE are optional annotations recorded on the audit row (who/why); they are never required and never block.
  • Runaway guard — a safety backstop, not authorization: the same call looped in a tight window trips a circuit breaker.
  • The fragile prod writes support --dry-run / dry_run=True and double confirmation at the CLI.
  • Reversible writes (scale, autoscale-config, routing, hot-swap, LoRA load) capture before-state and record an inverse descriptor.

References

  • references/capabilities.md — full tool → backend → endpoint → returns reference
  • references/cli-reference.md — CLI command reference
  • references/setup-guide.md — onboarding, optional token, and connectivity

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Inference AIops
    • What This Skill Does
    • Quick Install
    • When to Use This Skill
    • Related Skills — Skill Routing
    • Common Workflows
      • 1. "Inference got slow this afternoon" (flagship RCA → the right knob)
      • 2. Off-peak cost save: scale a deployment down to zero and bring it back
      • 3. Drain a replica before a node reboot
      • 4. Free GPU memory between bursts with Sleep Mode, then resume
    • Governance & Safety
    • References
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期