Kelly llm gateway
Generic, brand-free App-in-Skill dashboard for a shared LLM gateway's cost and model governance — daily spend trend, cost breakdown by service/model, a canary-rollout status board, and a deterministic cost/error anomaly list. Use when the user invokes $kelly-llm-gateway or /kelly-llm-gateway, or wants to review LLM gateway spend, model routing, canary rollouts, rollback readiness, or cost/error anomalies for services routed through one shared gateway to multiple LLM providers/models. Human actions (promote/rollback/hold a rollout, acknowledge an anomaly) write only local handoff files — this skill never changes a real routing config.From its SKILL.md
npx -y skills add mr-kelly/skills --skill kelly-llm-gatewayAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.2 KB, ~1.9k tokens by cl100k_base, as published. Nobody here has run it
LLM Gateway Cost & Governance Desk
Overview
Use this skill as a platform team's local operator dashboard over a shared LLM gateway: several consuming services (e.g. Support Bot, Search Ranking, Content Summarizer, Internal Copilot) routed through one gateway to a mix of internal and external models. It aggregates per-service/per-model call volume, cost, and error rate into one file-backed App-in-Skill: an Overview (spend trend, allocation-style rollout/anomaly summaries), a Cost Breakdown table, a Canary Rollout status board, and an Anomaly list.
This is deliberately generic and brand-free: no real company, product, or model name appears anywhere in the code, config, or seed data — only role-based service names ("Support Bot") and generic provider/model labels ("Provider A / Model Large", "Internal Model v2").
Default interaction mode: App UI. Unless the user explicitly asks for chat-only
handling, check onboarding/config, seed or refresh the local snapshot, start/
reuse the local app with app/start.sh, and give the actual local URL. Use
chat-only mode only when the user says "纯聊天", "chat only", "不要打开 UI", or
similar.
App UI Screenshots
<table> <tr> <td width="50%"><img src="assets/screenshots/overview.webp" alt="Gateway overview"></td> <td width="50%"><img src="assets/screenshots/cost-breakdown.webp" alt="Gateway cost breakdown"></td> </tr> <tr> <td><strong>Overview</strong><br>Total daily spend trend, a canary-rollout summary, and a top anomalies preview.</td> <td><strong>Cost Breakdown</strong><br>Sortable service × model table: calls, cost, error rate, canary %, status.</td> </tr> <tr> <td width="50%"><img src="assets/screenshots/rollouts.webp" alt="Gateway rollouts"></td> <td width="50%"><img src="assets/screenshots/anomalies.webp" alt="Gateway anomalies"></td> </tr> <tr> <td><strong>Rollouts</strong><br>Canary-rollout status board with rollback readiness and promote/rollback/hold actions.</td> <td><strong>Anomalies</strong><br>Deterministic cost/error spikes vs each route's own rolling baseline, with acknowledgement.</td> </tr> </table>Boundary
- Local dashboard over a local snapshot only. The skill may read a gateway
usage/cost API (via
lib/data-provider/), normalize it, and write local handoff files. - Human actions here (
promote,rollback,hold, anomaly acknowledgement) write ONLY toapp/.data/decisions.json. NEVER change a real routing config, a real gateway, or any live traffic split. There is no execution/merge path in this skill by design — a human still applies the decision in the real system of record. - The app reads and writes local files only. It must not call a live gateway; it only renders the normalized snapshot and the demo payload.
- Treat cost/usage data as sensitive. Do not commit
config.local.json, env files,app/.data/, or raw gateway exports.
First Run And Onboarding
On invocation, check app/.data/onboarding.json and private config readiness.
If onboarding is absent/incomplete, guide setup before syncing real gateway
data; the seeded demo dataset works with no configuration at all.
Private config priority:
KELLY_LLM_GATEWAY_CONFIG=/absolute/path/to/config.jsonskills/kelly-llm-gateway/config.local.json~/.config/kelly-llm-gateway/config.jsonskills/kelly-llm-gateway/config.example.jsonas template only
Env priority:
- Existing environment variables
KELLY_LLM_GATEWAY_ENV_FILE=/absolute/path/to/.env- Repository root
.env skills/kelly-llm-gateway/.env.local~/.config/kelly-llm-gateway/.env
Ask for non-secret setup details only: region, base URL, base currency, and
which env var name holds the gateway API key (api_key_env). Never ask the
user to paste secret values into chat.
When setup is complete and the user confirms, write app/.data/onboarding.json:
{
"completed": true,
"completed_at": "ISO timestamp",
"config_version": "1"
}
Local App
Start the dashboard with:
skills/kelly-llm-gateway/app/start.sh
The app uses local HTTP on 127.0.0.1, preferring port 3000 through 4000,
or KELLY_LLM_GATEWAY_UI_PORT when set. First run installs hono and
@hono/node-server; the frontend is zero-build vanilla.
Seed a deterministic local snapshot before first use (no config required):
node skills/kelly-llm-gateway/scripts/seed_snapshot.ts
Demo Mode
?demo=1opens a deterministic, fully offline mock gateway (4 services, 5 models, 8 service/model routes, 14 days of history) with computed spend trend, rollout status, and anomalies for documentation and screenshots.?demo=spend,?demo=rollouts, and?demo=anomaliesselect named mock scenes (their initial route).lang=enorlang=zhforces UI chrome language for screenshots.- Demo API responses never read or write live gateway data or local private
files; rollout/ack actions in demo mode only update in-memory state in the
browser, never
app/.data/decisions.json.
UI language: support English and Chinese chrome with Auto default.
Data Provider
The skill reads a gateway usage/cost API; the app only ever reads the normalized snapshot.
- Provider selector env:
KELLY_LLM_GATEWAY_DATA_PROVIDER=local(default). Reservepostgres,aitable,notion,busabasefor future cloud-backed providers (seelib/data-provider/provider-interface.ts). - The seed dataset lives in
lib/data-provider/seed-data.ts— pure, noMath.random, so re-seeding is byte-identical. Wire a real gateway adapter behind the sameDataProviderinterface when one exists; keep it read-only for usage/cost data. - Store secrets only via env; reference env var names in config
(
gateway.api_key_env). Never hardcode credentials.
Read references/gateway-schema.md before editing the app, scripts, or a
future gateway adapter. Primary local files:
app/.data/snapshot.json: canonical normalized gateway snapshot.app/.data/onboarding.json: onboarding completion marker.app/.data/decisions.json: rollout decisions and anomaly acknowledgements (the only human-write handoff file; no execution/merge step).app/.data/agent.lock: temporary lock while a decision is being written.config.local.json: private gateway configuration, ignored by git.
Use scripts/validate_ui_schema.ts app/.data/snapshot.json before relying on a
snapshot in the UI. scripts/seed_snapshot.ts writes a consistent seeded
snapshot to app/.data/snapshot.json.
Views
#/overview: total daily spend trend (14 days), a canary-rollout summary, and a top anomalies preview.#/spend: sortable service × model cost-breakdown table (calls, cost, error rate, canary %, status).#/rollouts: canary rollout status board — canary %, rollback readiness, andpromote to 100%/rollback/holdactions with a note.#/anomalies: cost/error anomalies vs each route's own rolling baseline, with acknowledgement.#/settings: sanitized setup summary — data provider, config path, gateway region/base URL, credential-readiness booleans, and onboarding state. Never expose secret values.
Safety
- This skill has no execution/merge step:
promote/rollback/holdand anomaly acknowledgement only ever updateapp/.data/decisions.json. A human must still apply the decision in the real gateway/routing system — the app is an operator surface, not a control plane. - Anomalies are deterministic and rule-based (rolling baseline comparison), not ML-based or random; the same snapshot always produces the same anomalies.
- Redact credential-like strings in logs, reports, and UI state.
What ships with it: 53 files
159.9 KB alongside SKILL.md, 23 of them executable
agents/
- openai.yaml251 B
app/
- accent-theme.css7.5 KB
- accent-theme.jsruns7.3 KB
- app.jsruns27.9 KB
- i18n/en.json2.7 KB
- i18n/zh-CN.json2.6 KB
- index.html4.3 KB
- server/anomalies.tsruns2.7 KB
- server/decisions.tsruns2.0 KB
- server/demo.tsruns2.3 KB
- server/hono.tsruns4.0 KB
- server/index.tsruns771 B
- server/launcher.tsruns2.9 KB
- server/lock.tsruns508 B
- server/paths.tsruns977 B
- server/setup.tsruns6.3 KB
- server/store.tsruns6.1 KB
- server/types.tsruns3.3 KB
- setup-gate.css4.5 KB
- setup-gate.jsruns8.8 KB
- start.shruns471 B
- styles/layers.css24 B
- styles/shell.css23.9 KB
- styles/workflow.css4.8 KB
assets/
- screenshots/anomalies.webp130 B
- screenshots/anomalies.zh-CN.webp130 B
- screenshots/cost-breakdown.webp130 B
- screenshots/cost-breakdown.zh-CN.webp130 B
- screenshots/overview.webp130 B
- screenshots/overview.zh-CN.webp130 B
- screenshots/rollouts.webp131 B
- screenshots/rollouts.zh-CN.webp130 B
- screenshots/thumbs/anomalies.webp129 B
- screenshots/thumbs/anomalies.zh-CN.webp129 B
- screenshots/thumbs/cost-breakdown.webp130 B
- screenshots/thumbs/cost-breakdown.zh-CN.webp130 B
- screenshots/thumbs/overview.webp130 B
- screenshots/thumbs/overview.zh-CN.webp130 B
- screenshots/thumbs/rollouts.webp130 B
- screenshots/thumbs/rollouts.zh-CN.webp130 B
13 more files not listed here. See all 53 in the repository.