Agent Skills › cheaper-inference/OmniRoute › omni-resilience

omni-resilience

GitHub

监控AI服务提供者健康、熔断状态及延迟指标,实时检查连接冷却和模型锁定。提供系统健康、压缩统计等API接口,用于保障服务稳定性和可观测性。

skills/omni-resilience/SKILL.md cheaper-inference/OmniRoute

触发场景

需要查看AI服务或提供商的健康状态 排查熔断器状态或连接问题 监控系统延迟和预算告警

安装

npx skills add cheaper-inference/OmniRoute --skill omni-resilience -g -y
更多选项

不安装直接使用

npx skills use cheaper-inference/OmniRoute@omni-resilience

指定 Agent (Claude Code)

npx skills add cheaper-inference/OmniRoute --skill omni-resilience -a claude-code -g -y

安装 repo 全部 skill

npx skills add cheaper-inference/OmniRoute --all -g -y

预览 repo 内 skill

npx skills add cheaper-inference/OmniRoute --list

SKILL.md

Frontmatter
{
    "name": "omni-resilience",
    "description": "Monitor provider health, circuit-breaker states, p50\/p95\/p99 latency metrics, and budget guard alerts. Inspect connection cooldowns and model lockouts in real time."
}

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
  • block — return 429 when limit is hit
  • alert — continue but add X-Budget-Warning header

MCP audit log

OmniRoute logs every MCP tool call to mcp_audit table. Query via API:

curl "$OMNIROUTE_URL/api/mcp/status" \
  -H "Authorization: Bearer $OMNIROUTE_KEY"

Returns: server status, heartbeat, recent audit activity summary.

Errors

  • 503 on health endpoint → OmniRoute is starting up; retry in 5s
  • Circuit breaker OPEN → provider is temporarily blocked; check resetAt to know when it auto-recovers
  • 429 budget_exceeded → budget guard limit reached; raise limit or wait for reset

版本历史

  • 5dbd2eb 当前 2026-11-03 07:32

    新增 GET /api/monitoring/model-health 接口,用于获取按模型划分的详细健康状态报告(如AUTH_FAILED、MODEL_LOCKED等)。

  • d804179 2026-10-19 14:22

    修复技能链接引用,确保所有SKILL.md参考正确解析并符合lint检查要求。

  • ba597b6 2026-09-09 13:21

    新增 /api/monitoring/compression 接口以暴露压缩结果缓存的命中率统计,增强可观测性;修复因OOM优化导致的流载荷解包回归问题。

  • 1cafd32 2026-07-25 11:48

同 Skill 集合

config/quality/skill-templates/green-prs/SKILL.md
config/quality/skill-templates/merge-batch/SKILL.md
config/quality/skill-templates/merge-prs/SKILL.md
config/quality/skill-templates/quality-scan/SKILL.md
config/quality/skill-templates/sweep-reds/SKILL.md
config/quality/skill-templates/validate-release-green/SKILL.md
skills/cli-a2a/SKILL.md
skills/cli-backup-sync/SKILL.md
skills/cli-batches/SKILL.md
skills/cli-chat/SKILL.md
skills/cli-compression/SKILL.md
skills/cli-contexts/SKILL.md
skills/cli-cost-usage/SKILL.md
skills/cli-eval/SKILL.md
skills/cli-health/SKILL.md
skills/cli-keys/SKILL.md
skills/cli-mcp/SKILL.md
skills/cli-models/SKILL.md
skills/cli-plugins-skills/SKILL.md
skills/cli-policy-audit/SKILL.md
skills/cli-providers/SKILL.md
skills/cli-resilience/SKILL.md
skills/cli-routing/SKILL.md
skills/cli-serve/SKILL.md
skills/cli-setup/SKILL.md
skills/cli-skill-collector/SKILL.md
skills/cli-tunnel/SKILL.md
skills/config-codex-cli/SKILL.md
skills/omni-agents-a2a/SKILL.md
skills/omni-api-keys/SKILL.md
skills/omni-auth/SKILL.md
skills/omni-budget/SKILL.md
skills/omni-cache/SKILL.md
skills/omni-cli-tools/SKILL.md
skills/omni-combos-routing/SKILL.md
skills/omni-compression/SKILL.md
skills/omni-context-rtk/SKILL.md
skills/omni-db-backups/SKILL.md
skills/omni-github-skills/SKILL.md
skills/omni-inference/SKILL.md
skills/omni-mcp/SKILL.md
skills/omni-models/SKILL.md
skills/omni-providers/SKILL.md
skills/omni-proxies/SKILL.md
skills/omni-settings/SKILL.md
skills/omni-sync-cloud/SKILL.md
skills/omni-tunnels/SKILL.md
skills/omni-usage-logs/SKILL.md
skills/omni-version-manager/SKILL.md

元信息

文件数
0
版本
5dbd2eb
Hash
b33d8cb7
收录时间
2026-07-25 11:48

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-07 07:00
浙ICP备14020137号-1