omni-resilience
它能做什么
这项技能展示如何检查 AI 提供商是否健康、响应是否及时。适合想快速发现缓慢或故障的提供商以及预算警告的管理员。
适用场景
- ✓当用户想知道提供商或网关现在是否健康的时候。
- ✓当用户想查看提供商的延迟数据的时候。
- ✓当用户想检查某个模型或连接为什么被锁定的时候。
技能链接
https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/omni-resilience/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“现在哪些提供商运行缓慢或出现故障?有没有模型被锁定?”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能列出系统健康、单个模型健康、压缩统计和韧性数据的监控端点。它会报告熔断器、冷却时间、模型锁定,以及 p50、p95 和 p99 等延迟百分位。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Overview
Monitor provider health, circuit-breaker states, p50/p95/p99 latency metrics, and budget guard alerts. Inspect connection cooldowns and model lockouts in real time.
Authentication
All requests require a valid Bearer token or session cookie. Obtain a token via POST /api/auth/login or configure REQUIRE_API_KEY=false for local development.
Endpoints
GET /api/monitoring/health
System health check
Returns system health including uptime, memory, circuit breakers, rate limits
curl http://localhost:20128/api/monitoring/health \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
GET /api/monitoring/model-health
Get per-model health states
Management-only report that classifies every synced model on every provider connection as HEALTHY, DEGRADED, RATE_LIMITED, AUTH_FAILED, PROVIDER_DOWN, CONNECTION_BLOCKED, MODEL_LOCKED or UNKNOWN, from the connection state, the provider circuit breaker and the per-model lockout. Includes connection ids and names, so it requires a management principal.
curl http://localhost:20128/api/monitoring/model-health \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
GET /api/monitoring/compression
Get compression result-memo statistics
In-process compression result-memo observability snapshot — size, capacity, lifetime hits/misses/hitRate plus 1m/5m/15m/1h windowed rates. Lightweight (no DB, no provider reads) companion to GET /api/monitoring/health intended for frequent polling. Sent with Cache-Control: no-store, no-cache, must-revalidate. Counters reset on process restart.
curl http://localhost:20128/api/monitoring/compression \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
GET /api/provider-metrics
GET provider metrics
curl http://localhost:20128/api/provider-metrics \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
Payloads
See the full OpenAPI specification at GET /api/openapi/spec or docs/openapi.yaml for detailed request/response schemas.
OmniRoute — Monitoring & Health
Requires OMNIROUTE_URL and OMNIROUTE_KEY. See entry-point SKILL for setup.
System health
curl $OMNIROUTE_URL/api/health \
-H "Authorization: Bearer $OMNIROUTE_KEY"
Returns: uptime, memory, active connections, circuit breaker states, rate limit status, cache stats.
Unauthenticated quick check:
curl $OMNIROUTE_URL/api/health
# → {"ok":true}
Provider circuit breakers
Circuit breakers prevent traffic from hitting failing providers.
States: CLOSED (normal), OPEN (blocked), HALF_OPEN (probe mode — auto-recovers).
curl $OMNIROUTE_URL/api/monitoring/health \
-H "Authorization: Bearer $OMNIROUTE_KEY"
Response includes circuitBreakers array with per-provider state and resetAt timestamp.
Per-provider metrics (p50/p95/p99)
curl $OMNIROUTE_URL/api/providers/metrics \
-H "Authorization: Bearer $OMNIROUTE_KEY"
Response shape per provider:
{
"provider": "anthropic",
"requests": 1247,
"successRate": 0.994,
"latency": { "p50": 820, "p95": 2100, "p99": 3800 },
"circuitState": "CLOSED",
"tokensUsed": 2847000
}
Via MCP (if OmniRoute is your MCP server)
omniroute_get_health → full system health snapshot
omniroute_get_provider_metrics → p50/p95/p99 + circuit state per provider
omniroute_get_session_snapshot → cost, tokens, errors for current session
omniroute_check_quota → quota balance + percent remaining + reset time
omniroute_db_health_check → diagnose + auto-repair database drift
Quota check
curl $OMNIROUTE_URL/api/quota \
-H "Authorization: Bearer $OMNIROUTE_KEY"
Returns used/total tokens and requests per provider/account, with resetAt timestamps.
Budget guard (spend limit)
Set a session spending limit that degrades or blocks requests when hit:
curl -X POST $OMNIROUTE_URL/api/budget/guard \
-H "Authorization: Bearer $OMNIROUTE_KEY" \
-H "Content-Type: application/json" \
-d '{
"limitUsd": 5.00,
"action": "degrade",
"degradeTo": "openai/gpt-4o-mini"
}'
action options:
degrade— switch to a cheaper model when limit is hit- `b
常见问题
每个模型的状态是什么意思?
模型健康报告会把每个模型归类为正常、降级、受速率限制、身份验证失败或提供商宕机等状态,还有其他状态。
模型健康报告敏感吗?
敏感。它包含连接 ID 和名称,所以这项技能说明需要管理员登录。
它会显示预算警报吗?
会。这项技能把预算守卫警报列为监控的一部分。
详情
作者的原始描述
Monitor provider health, circuit-breaker states, p50/p95/p99 latency metrics, and budget guard alerts. Inspect connection cooldowns and model lockouts in real time.
热度
- GitHub 星标
- 84k
- 排名
- #1434
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …