Use this skill whenever the user needs to observe or govern on-endpoint local LLMs running on Ollama, llama.cpp (llama-server), LM Studio, or a local single-node vLLM — inventory installed/running models with an allow/deny verdict (shadow-AI detection), inspect VRAM residency, model license/params/capabilities and server version, view the model policy, detect model provenance/digest drift (re-pulled or tampered weights; strong for Ollama/llama.cpp, id-only and honestly weaker for LM Studio/vLLM), scan a prompt for secrets / PII / source-code / jailbreak with a weighted risk band, route a prompt THROUGH a guard that scans + policy-gates + records + runs-if-allowed (guarded_generate / observe_chat), query the observed-usage log, and roll up anomalies (shadow models, digest drift, high-risk + blocked prompts). Always use this skill for "what local models are installed", "find shadow / unsanctioned AI models", "which model is loaded in VRAM", "scan this prompt for secrets/PII before sendin
记忆
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 analysis (diagnose_latency_spike / diagnose_engine_latency) and low-utilisation RCA, engine-agnostic health + running-model inventory across vLLM/SGLang/TGI, Ray Serve autoscaling and scaling (scale up/down, scale-to-zero, drain a replica), LoRA load/unload, base-model hot-swap, deploy/undeploy/redeploy, prefix-aware routing, GPU utilisation, Ray jobs, and cost per million tokens. Always use this skill for "why is inference slow", "TTFT spike", "latency spike", "GPU underutilised", "scale down the dep
它能做什么
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 analysis (diagnose_latency_spike / diagnose_engine_latency) and low-utilisation RCA, engine-agnostic health + running-model inventory across vLLM/SGLang/TGI, Ray Serve autoscaling and scaling (scale up/down, scale-to-zero, drain a replica), LoRA load/unload, base-model hot-swap, deploy/undeploy/redeploy, prefix-aware routing, GPU utilisation, Ray jobs, and cost per million tokens. Always use this skill for "why is inference slow", "TTFT spike", "latency spike", "GPU underutilised", "scale down the deployment", "scale to zero", "drain a replica before a reboot", "hot-swap the base model", "load a LoRA adapter", "KV cache pressure", "prefix cache hit rate", "queue backpressure", "autoscale config", "SGLang health", "TGI metrics", or "cost per token" when the context is a vLLM / SGLang / TGI / Ray Serve inference cluster. Do NOT use for non-inference infrastructure (hypervisors, storage appliances, backup products, general container/cluster workloads, network devices, or OT/industrial equipment) — those belong to other AIops-tools; this skill is scoped to GPU inference serving (vLLM + Ray). Governed vLLM + Ray inference operations with a built-in governance harness (audit, policy, token budget, undo, risk-tiers).
技能文档
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)
inference-aiops doctor→ confirm the vLLM endpoint and Ray dashboard are actually reachable before blaming the modelinference-aiops overview→ Serve deployments, total replicas, and whether queue backpressure is cluster-wide or one deploymentinference-aiops metrics diagnose(MCP:diagnose_latency_spike) → a ranked cause with the measured numbers: iswaitingqueue depth high (backpressure)? Are there KV-cache preemptions (kv_cache_stats)? Has the prefix-cache hit rate dropped (routing lost locality)?- Turn the knob the RCA names, not a guess:
- backpressure →
inference-aiops serve scale --replicas N(scale_replicas_up, reversible, prior count captured) - KV-cache preemption →
autoscale_config_updateto lower the concurrent-request cap (reversible, prior config captured) - lost locality →
routing_policy_updateto prefix-aware / session-affinity (reversible)
- backpressure →
- Re-check
inference-aiops metrics requests(TTFT / TPOT / e2e) andinference-aiops metrics queueto confirm the p99 actually moved - Failure branch: if the fix makes it worse,
inference-aiops undo list→inference-aiops undo applyrestores the exact prior replica count / autoscale config / routing policy. Ifdiagnose_latency_spikereports no clear cause, the bottleneck is likely upstream of serving — checkgpu_utilizationfor a throttling or shared-GPU problem before scaling anything.
2. Off-peak cost save: scale a deployment down to zero and bring it back
inference-aiops metrics requests→ confirm traffic really is idle, not just briefly quietdiagnose_low_utilization→ the deployments actually burning GPU for nothing, with the measured utilisationcost_per_token→ quantify the bleed ($/1M tokens at the current throughput) so the change is justifiable in the audit trail- (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 inference-aiops serve scale-to-zero --dry-run, then re-run without--dry-run→ high risk, double confirmation.scale_to_zerostops the bleed but strands ingress — requests will queue or fail until replicas return- To restore:
inference-aiops undo apply(replays the captured prior replica count) orinference-aiops serve scale --replicas N - Failure branch: if traffic arrives while at zero, restore immediately via undo — do not wait for autoscale, since
scale_to_zeromay have been applied outside the autoscaler's floor. If the restore fails,serve statuswill show the deployment unhealthy;deployment_redeployis the last resort (high risk, disruptive).
3. Drain a replica before a node reboot
inference-aiops serve list/replica_list→ identify the replicas pinned to the node you are about to rebootqueue_depth→ confirm the remaining replicas can absorb the load; if not,scale_replicas_upfirst so draining does not cause a brownoutdrain_replica --dry-run, then confirm → high risk; the drain finishes in-flight requests before removing the replica- Watch
replica_listuntil the replica is gone andrequest_metricsshows no error spike, then reboot the node - Failure branch: if the drain hangs on a long-running request,
replica_restartforcibly 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 (seedocs/VERIFICATION.md).
4. Free GPU memory between bursts with Sleep Mode, then resume
model_is_sleeping→ is the engine already suspended?nullmeans the engine did not report it — that is UNKNOWN, not awake, so resolve it before writingrequest_metrics/queue_depth→ confirm the engine is actually idle; sleeping a busy engine drops live trafficmodel_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- Verify:
model_is_sleepingreports true, and GPU memory has been released (gpu_utilization) - Resume with
model_wake(medium risk), orinference-aiops undo applyto replay the recorded inverse.model_wakeitself 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 - 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 uselora_load(reversible) andlora_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 viaINFERENCE_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_RATIONALEare 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=Trueand 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 referencereferences/cli-reference.md— CLI command referencereferences/setup-guide.md— onboarding, optional token, and connectivity
相关技能
Use this skill whenever the user needs to operate or troubleshoot a PostgreSQL server/cluster as a DBA — a one-shot cluster health overview; server reads (version/uptime, settings, extensions, databases, roles); activity (sessions, idle-in-transaction, long-running queries, locks); query stats (pg_stat_statements top-N, EXPLAIN a statement); index health (unused indexes, missing-index hints, bloat, invalid/duplicate); table health (sizes, dead-tuple bloat, autovacuum status); replication (standby lag, replication slots, WAL); three flagship analyses — slow-query RCA (worst pg_stat_statements entry + EXPLAIN → cause/action), bloat & vacuum analysis (dead tuples + autovacuum lag → recommendation), and blocking lock-chain RCA (build the wait-for tree, name the root blocker); and guarded writes (terminate a backend, cancel a query, VACUUM/ANALYZE, create/drop an index, REINDEX, ALTER SYSTEM SET a parameter, reset query stats). Always use this skill for "postgres health check", "why is this
Use this skill whenever the user needs to operate or diagnose a Ceph cluster via its ceph-mgr Dashboard REST API — decode a HEALTH_WARN/ERR state into cause + action (cluster_health), read the cluster status, inspect OSDs (tree/df/perf), placement groups (summary/stuck/scrub), pools (list/usable capacity), RBD images and snapshots, CephFS/MDS and RGW status, monitors/managers, slow ops and capacity forecast — plus governed writes (set cluster flags, reweight/mark-in/mark-out/purge OSDs, trigger scrubs, set pool quota/pg_num/autoscale/size, create/delete pools, create/delete RBD images and snapshots, throttle recovery/backfill). Always use this skill for "ceph health", "what does this HEALTH_WARN mean", "PG_DEGRADED / OSD_NEARFULL / SLOW_OPS / MON_DOWN", "ceph -s", "which OSD is most full", "drain an OSD", "purge an OSD", "stuck PGs", "overdue scrub", "pool usable capacity", "set pool size / quota", "rebalance is too slow / throttle backfill", "RBD image or snapshot", "MDS behind on tri
Use this skill whenever the user needs to operate a Kubernetes cluster — list/inspect pods, deployments, statefulsets, daemonsets, replicasets, jobs, cronjobs, services, ingresses, endpoints, configmaps, secrets (names/keys only), PVCs/PVs/storageclasses, nodes, namespaces, and events; read pod logs; describe pods/nodes; pod/node top (metrics); read-only diagnostics / RCA (pod-health, workload-readiness); scale deployments/statefulsets; rollout status/history/undo/pause/resume and set image; delete pods/deployments/jobs; create/delete namespaces; and cordon/uncordon/drain nodes. Works with any kubeconfig-reachable cluster (standard Kubernetes, k3s, EKS, GKE, AKS). Always use this skill for "list k8s pods", "scale deployment", "kubernetes pod logs", "describe pod", "why is my pod crashing", "diagnose pods", "which deployments are unhealthy", "rollout undo", "set image", "top pods", "drain node", "cordon node", "restart deployment", "k3s", or "kubectl"-style tasks when the context is exp
Use this skill whenever the user needs to operate or diagnose MinIO object storage — explain why the cluster is filling up or refusing writes (capacity_rca), find publicly exposed buckets and hygiene gaps (bucket_exposure_audit), find storage that lifecycle/ILM should be reclaiming but isn't, including noncurrent versions and incomplete multipart uploads (lifecycle_gap_analysis), check heal backlog and erasure-set write-quorum risk (healing_health), read service health / cluster status / per-bucket config (policy, versioning, lifecycle, encryption, quota, tags) — plus governed writes (set or delete bucket policy, enable/suspend versioning, set or delete lifecycle rules, set bucket quota, purge incomplete uploads, delete an empty bucket). Always use this skill for "minio health", "why is my object storage full", "which bucket is biggest", "is any bucket public / anonymous access", "versioning / noncurrent versions piling up", "incomplete multipart uploads", "lifecycle / ILM rules", "buc
Use this skill whenever the user needs to operate a self-hosted observability stack on Prometheus (HTTP API + PromQL), Alertmanager, Grafana, or Grafana Loki (logs) — a one-shot overview, PromQL instant/range queries, label + series metadata, scrape-target health (up/down + why) and dropped targets, recording/alerting rule health, firing/pending alerts, Alertmanager alerts + silences, Grafana dashboards/datasources/folders, bounded Loki LogQL log reads (labels, query, error-tail), five flagship analyses (firing-alert RCA, target-scrape-health, alert-noise/flap, log-error-burst RCA, log-volume/cardinality) plus an alert->log cross-signal, and guarded writes (create/expire silence, create annotation, update/delete dashboard, reload Prometheus config). Always use this skill for "Prometheus", "PromQL", "Alertmanager", "Grafana", "Loki", "LogQL", "logs", "which targets are down", "scrape failing", "why is this alert firing", "root cause this alert", "firing alerts", "silence this alert", "n