[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75A508CNEAFY31JRC060N3S":3,"skill-same:01M75A508CNEAFY31JRC060N3S":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M75A508CNEAFY31JRC060N3S","omniroute-gateway",null,"OmniRoute install, MCP, Hermes on WSL. Load on issues.","publieople\u002Fhermes-config-kit","publieople","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F90119344?v=4","01M759EPK59NZG525VKS4VRNC2","po","01M759EPM4EMVEY5JNV2549JQ1",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fdevops\u002Fomniroute-gateway\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: omniroute-gateway\ndescription: OmniRoute install, MCP, Hermes on WSL. Load on issues.\nversion: 1.0.0\nauthor: Hermes Agent + Publieople\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [omniroute, gateway, mcp, providers, llm-router, wsl, systemd]\n    related_skills: [hermes-agent, hermes-bootstrap]\n---\n\n# OmniRoute Gateway — Install, Configure, Integrate\n\nOmniRoute is a **local AI gateway**: a Node.js HTTP server (`http:\u002F\u002Flocalhost:20128`) exposing an OpenAI-compatible API at `\u002Fv1` that proxies to 290+ upstream AI providers with auto-failover, 12-factor scoring, and 15-95% token compression. Goal: replace direct provider API calls with one local endpoint so any AI coding tool (Claude Code, Codex, Cursor, OpenCode, Hermes, etc.) gains provider-agnostic resilience.\n\nThis skill captures the **operational** knowledge needed to install OmniRoute, expose its MCP server to external agents (Hermes), and integrate it as a model provider — knowledge that repeats every time someone sets this up fresh.\n\n## When to load this skill\n\n- \"install OmniRoute\" \u002F \"set up OmniRoute\"\n- \"route Claude Code \u002F Codex \u002F Cursor through OmniRoute\"\n- \"expose OmniRoute's MCP tools to Hermes\"\n- \"OmniRoute is detected but Hermes isn't\" \u002F \"OmniRoute 500 errors\"\n- \"switch Hermes default to OmniRoute\"\n- \"set up an AI gateway \u002F LLM router\"\n- Troubleshooting MCP connection failures to localhost:20128\n- **\"opencode-go 400 MissingSessionID \u002F x-opencode-session\"** — opencode.ai 自 2026-09-06 强制该头；3.8.49 默认只透传不合成，**3.8.50 起默认合成**（`OPENCODE_SYNTHESIZE_CLI_HEADERS` 反转为 opt-out）。升级到 ≥3.8.50 即修复，勿设 false。\n- **npm 自更新跳过 install scripts** — `npm install -g omniroute@latest` 报 \"install scripts not yet covered by allowScripts\"（better-sqlite3 等 native 包静默跳过 → 500）。重跑带完整 allow-scripts CSV，再 `omniroute doctor` 验证 native binary OK。\n- **\"omniroute.service restarting loop\" \u002F \"exit-code 203 EXEC\"** — unit pointing at wrong binary path\n- **\"AppImage \u002F AUR omniroute-bin failed\" \u002F \"sqlite driver unavailable on AppImage\"**\n- **\"Missing X server or $DISPLAY\" \u002F \"platform failed to initialize\"** in omniroute service log\n- **\"PATCH \u002Fapi\u002Fsettings returns 200 but does nothing on languageConfig\"** → real endpoint is `PUT \u002Fapi\u002Fsettings\u002Fcompression`\n- **\"compression_status MCP tool does not show languageConfig\"** → schema intentionally partial; use `GET \u002Fapi\u002Fsettings\u002Fcompression` to see `languageConfig`\n- **\"key value masked in API response\" \u002F \"reveal disabled\"** — API key not recoverable; ask user to Dashboard-copy\n- **\"Too many failed attempts on \u002Fapi\u002Fauth\u002Flogin\"** → restart service to clear\n\n## The 7-step install procedure on Linux\u002FWSL\n\n```bash\n# 1. Install (background — ~5 min, 1176 packages)\nnpm install -g omniroute\n\n# 2. CRITICAL: re-install with native-binding scripts allowed.\n#    Without this, better-sqlite3\u002Fsharp\u002Fonnxruntime-node are silently skipped\n#    and the CLI launches but every endpoint returns HTTP 500 (\"better-sqlite3\n#    native binary was not found\"). The full allow-scripts CSV:\nnpm install -g --allow-scripts=omniroute,better-sqlite3,keytar,tls-client-node,onnxruntime-node,sharp,core-js,esbuild,@parcel\u002Fwatcher,@swc\u002Fcore,protobufjs,koffi omniroute\n\n# 3. Verify native binary\nomniroute doctor\n#   → \"OK  Native binary: better-sqlite3 native binary is compatible\"\n\n# 4. systemd unit at ~\u002F.config\u002Fsystemd\u002Fuser\u002Fomniroute.service\n#    ⚠️ MUST have ProtectHome=false AND ProtectSystem=false.\n#    The default templates ship with ProtectHome=read-only, which makes SQLite\n#    writes silently fail (storage.sqlite created at install but never\n#    updated post-startup) → \u002Fv1\u002Fmodels and \u002Fapi\u002Fhealth return HTTP 500 with\n#    no log error. The \"OmniRoute is running!\" banner lies — it only proves\n#    the HTTP server bound the port, not that requests work. Verify with curl:\ncurl http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fmodels\n#   → 200 + JSON catalog. If 500, fix ProtectHome\u002FProtectSystem and restart.\n\n# 5. Enable + start\nsystemctl --user daemon-reload\nsystemctl --user enable --now omniroute.service\n\n# 6. Wait ~8s for \"OmniRoute is running!\" then verify with curl.\n# 7. Add providers via Dashboard (http:\u002F\u002Flocalhost:20128) — or use the\n#    OmniRoute Agent Skills catalog at \u002Fapi\u002Fagent-skills for automation.\n```\n\n**Reference systemd unit (tested, works):**\n\n```ini\n[Unit]\nDescription=OmniRoute AI Gateway\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=\u002Fhome\u002Fpo\nExecStart=\u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002Fomniroute\nRestart=on-failure\nRestartSec=5\nTimeoutStartSec=30\n# CRITICAL: these two must be false for OmniRoute to write ~\u002F.omniroute\u002F\nProtectSystem=false\nProtectHome=false\nPrivateTmp=true\n\n[Install]\nWantedBy=default.target\n```\n\n### AUR \u002F AppImage variant (`omniroute-bin`)\n\n`omniroute-bin` (AUR) packages the OmniRoute Electron AppImage at `\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage` and a 68-byte `\u002Fusr\u002Fbin\u002Fomniroute` wrapper (`exec \u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage \"$@\"`). The package ships **no systemd unit** and **no AppArmor\u002Fsystemd integration**, so you must author your own — and on WSL you must also work around three defects the npm build path does not expose (see Pitfall 8 and `references\u002For-appimage-wsl-quirks.md`):\n\n```ini\n[Unit]\nDescription=OmniRoute AI Gateway (AppImage)\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=\u002Fhome\u002Fpo\n# Electron app needs a display server; xvfb-run resolves the ozone\u002Fx11 crash.\n# AppRun locates APPDIR by readlink-ing itself, so we run it from the\n# extracted dir, NOT directly (FUSE unavailable on WSL2).\nExecStart=\u002Fusr\u002Fbin\u002Fxvfb-run -a \u002Fhome\u002Fpo\u002Fsquashfs-root\u002FAppRun\nRestart=on-failure\nRestartSec=5\nTimeoutStartSec=30\nProtectSystem=false\nProtectHome=false\nPrivateTmp=true\n\n[Install]\nWantedBy=default.target\n```\n\nTo seed the `squashfs-root\u002F` directory:\n```bash\ncd \u002Fhome\u002Fpo                       # AppImage must write somewhere user-writable\n\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage --appimage-extract\n```\n\n## Enabling the MCP server (4 prerequisites)\n\nDefault `mcpEnabled: false` and `mcpTransport` unset. External agents (Hermes, Claude Desktop) hitting `\u002Fapi\u002Fmcp\u002Fstream` will get `{\"error\":\"MCP server is disabled. Enable it from the Endpoints page.\"}` until all four are set:\n\n1. **Enable MCP via settings API** (management auth required — login cookie from `\u002Fapi\u002Fauth\u002Flogin` with the initial admin password from logs):\n   ```bash\n   curl -X PATCH http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fsettings \\\n     -H \"Content-Type: application\u002Fjson\" \\\n     -H \"Cookie: auth_token=$COOKIE\" \\\n     -d '{\"mcpEnabled\":true,\"mcpTransport\":\"streamable-http\",\"a2aEnabled\":true}'\n   ```\n2. **Create a dedicated API key** for the agent (not the admin cookie):\n   ```bash\n   curl -X POST http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fkeys \\\n     -H \"Content-Type: application\u002Fjson\" -H \"Cookie: auth_token=$COOKIE\" \\\n     -d '{\"name\":\"hermes-mcp\",\"scopes\":[\"admin\"]}'\n   ```\n   → returns `{\"key\":\"sk-XX...YY\",\"id\":\"...\"}`. **`sk-…` value is masked on the wire** (response shape `{\"key\":\"sk-41a4c****37f1\",…}`); the `reveal` endpoint is **disabled in v3.8.49** by default (`{\"error\":\"API key reveal is disabled\"}`). The full key is shown exactly once, only when the operator clicks \"copy\" in the Dashboard. CLI\u002FAPI users cannot recover it. Plan: ask the user to create the key in Dashboard and paste it; do **not** rely on the API as the source of full keys. See `or-compression-config.md` § \"API key creation returns masked value\". `manage` scope is sufficient for `PUT \u002Fapi\u002Fsettings\u002Fcompression`; only `\u002Fapi\u002Fkeys` admin and `\u002Fapi\u002Fauth\u002Flogin` revocation need `admin`.\n3. **The `Authorization: Bearer \u003Ckey>` header works for both chat completions and MCP** if the key has admin scope. No cookie needed from external clients.\n4. **MCP session handshake requires session ID**: first call `initialize` returns `Mcp-Session-Id` response header → pass it as `Mcp-Session-Id` on every subsequent `tools\u002Flist` \u002F `tools\u002Fcall` within the same session. Server returns SSE format (`event: message\\ndata: {json}\\n\\n`).\n\nVerify with `hermes mcp test omniroute` → should show `✓ Connected (~500ms)` and `✓ Tools discovered: 99`.\n\n## Adding OmniRoute as Hermes' model provider\n\nHermes supports any OpenAI-compatible endpoint via `provider: custom` (NOT `provider: openai` — that errors at startup with `Unknown provider 'openai'`):\n\n```bash\nhermes config set model.default \"minimax-cn\u002FMiniMax-M3\"     # or auto\u002Fcoding\nhermes config set model.provider \"custom\"\nhermes config set model.base_url \"http:\u002F\u002Flocalhost:20128\u002Fv1\"\nhermes config set model.api_key \"sk-...\"                       # the OR gateway key from step 2\nhermes config set model.context_length 1048576                # match the model's context window\nhermes chat -q \"test\"                                          # verify end-to-end\n```\n\nThe `auto\u002F*` virtual models (no combo creation needed) make Hermes pick the best model across all providers OR has connected — `auto\u002Fcoding`, `auto\u002Ffast`, `auto\u002Fcheap`, `auto\u002Fcoding:fast`, `auto\u002Freasoning:pro` etc. Validated against `GET \u002Fv1\u002Fmodels`; the `combo` owned_by group in that list IS the auto catalog.\n\n## Provider model-id prefix format\n\nEach provider has an `alias` field in `src\u002Fshared\u002Fconstants\u002Fproviders.ts` (or registry files). The model ID format is `\u003Calias>\u002F\u003Cmodel-id>`:\n\n| Provider | Prefix | Example |\n|---|---|---|\n| `minimax-cn` (China, Token Plan) | `minimax-cn\u002F` | `minimax-cn\u002FMiniMax-M3` |\n| `minimax` (Global) | `minimax\u002F` | — |\n| `github` (Copilot OAuth) | `gh\u002F` or `github\u002F` | `github\u002Fclaude-sonnet-5` |\n| `auggie` | `aug\u002F` | `aug\u002Fclaude-sonnet-4.6` |\n| `opencode` (free tier) | `oc\u002F` | `oc\u002Fminimax-m3-free` |\n| `duckduckgo-web` | `ddgw\u002F` | `ddgw\u002Fgpt-5-mini` |\n| `theoldllm` | `tllm\u002F` | `tllm\u002FCLAUDE_4_6_OPUS` |\n| `veoaifree-web` | `veo-free\u002F` | `veo-free\u002Fveo` |\n| `mimocode` (Xiaomi) | `mcode\u002F` | `mcode\u002Fmimo-auto` |\n| `chipotle` | `pepper\u002F` | `pepper\u002Fpepper-1` |\n\nTo verify what each provider exposes: `curl http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fmodels -H \"Authorization: Bearer $KEY\" | python3 -c \"import sys,json; d=json.load(sys.stdin); [print(m['owned_by'], m['id']) for m in d['data']]\"`.\n\n## Common pitfalls (all observed, all reproducible)\n\n### Pitfall 1: \"Installed but every endpoint returns 500\"\n\nBanner shows \"running\" but `\u002Fv1\u002Fmodels` and `\u002Fapi\u002Fhealth` return HTTP 500 with no log error. **Root cause: `ProtectHome=read-only` in systemd unit blocking SQLite writes.** Fix: edit the unit to set `ProtectHome=false ProtectSystem=false`, then `systemctl --user daemon-reload && systemctl --user restart omniroute`. Verify with `stat -c '%y' ~\u002F.omniroute\u002Fstorage.sqlite` — mtime should advance past the service restart time after the first request.\n\n### Pitfall 2: `npm install` succeeds but `native binary was not found`\n\nPEP 668-like mechanism silently blocked 12 native-binding install scripts (better-sqlite3, sharp, onnxruntime-node, koffi, esbuild, @parcel\u002Fwatcher, @swc\u002Fcore, keytar, tls-client-node, core-js, protobufjs, omniroute itself). Re-install with the explicit `--allow-scripts` CSV above. **Applies to ANY npm package using node-gyp** (electron tools, SQLite drivers, ONNX, image-processing CLIs).\n\n### Pitfall 3: MCP endpoint returns \"MCP server is disabled\"\n\n`mcpEnabled` is false by default. Fix requires PATCH `\u002Fapi\u002Fsettings` (not just toggling in UI if API-only). Confirms MCP is exposed: `curl -X POST http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fmcp\u002Fstream` should return `event: message\\ndata: {\"result\":{\"serverInfo\":{\"name\":\"omniroute\"}}}`, not the disabled error.\n\n### Pitfall 4: Hermes `Unknown provider 'openai'`\n\n`model.provider` is the **dispatcher name**, not the upstream API name. For ANY OpenAI-compatible endpoint (OmniRoute, LiteLLM, vLLM, Ollama, LM Studio), use `provider: custom`. The skill-level fix is in SKILL.md at `## Providers` → add an explicit note. (Bundled skill; cannot edit. Carry the rule in this skill.)\n\n### Pitfall 5: OmniRoute CLI agent detector misses Hermes on Linux\u002FWSL\n\nOmniRoute's `src\u002Flib\u002Fcli-helper\u002Ftool-detector.ts` uses `getCachedLoginShellPath()` which **returns null on any non-darwin platform** (line 60: `if (platform !== \"darwin\") return null`). On Linux\u002FWSL, detector only sees systemd's truncated PATH (typically `\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fbin`), missing `~\u002F.npm-global\u002Fbin\u002F` and `~\u002F.local\u002Fbin\u002F`. Hermes installs to `~\u002F.local\u002Fbin\u002Fhermes` (Python venv wrapper). Workaround: symlink to a path in the truncated PATH:\n```bash\nln -sf \u002Fhome\u002Fpo\u002F.local\u002Fbin\u002Fhermes \u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002Fhermes\n```\n\n### Pitfall 6: \"OmniRoute detects openclaw but I uninstalled it\"\n\nOR detector checks for binary in PATH (not config dir). If you only deleted `~\u002F.openclaw\u002F` config but didn't run `npm uninstall -g openclaw`, the binary is still in `\u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002F` and detector reports \"installed\". Fix: `npm uninstall -g openclaw`. Detector then returns installed=false.\n\n### Pitfall 7: Token Plan with OmniRoute — cost\u002Fbilling path\n\nOmniRoute's `minimax-cn` provider hardcodes `https:\u002F\u002Fapi.minimaxi.com\u002Fanthropic\u002Fv1\u002Fmessages` as the base URL (Anthropic-compatible surface), NOT the `\u002Fv1\u002Fcoding_plan\u002F...` path used by the `mmx` CLI. **The same API key works for both** — Token Plan quota IS consumed when calling through OmniRoute's `minimax-cn\u002FMiniMax-M3` (verified by `x-mm-request-id` response header in the request back to minimaxi.com). If the user wants the dedicated Token Plan endpoint instead, that requires an OmniRoute provider plugin (custom baseUrl).\n\n### Pitfall 8: AUR `omniroute-bin` (AppImage) on WSL — three stacked defects\n\nThe AUR package works on native Linux but fails on WSL across three layers; each layer masks the next, so users typically only see `HTTP 500` on `\u002Fv1\u002Fmodels` and assume it's a config bug. **All three fixes are needed.**\n\n1. **No systemd unit.** `omniroute-bin` ships only `\u002Fusr\u002Fbin\u002Fomniroute` (AppImage launcher) and `\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage`. There is no unit file. An orphan user unit pointing at the old npm path (`\u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002Fomniroute`) will silently keep restarting with `status=203\u002FEXEC` (\"no such file\"). Symptom: `Restart counter is at N`, port 20128 never opens.\n\n2. **FUSE unavailable in WSL2 kernel.** Running `\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage` directly fails: `Cannot mount AppImage, please check your FUSE setup`. WSL2's kernel is sealed\u002Fsigned-readonly; userspace `apt install fuse` only gives userspace helpers, not `fuse.ko`. AppImage itself has a fallback: `AppImage --appimage-extract` writes `squashfs-root\u002F` to cwd and exits. Then point systemd at `\u003Cextracted>\u002FAppRun`.\n\n3. **Electron ozone\u002Fx11 crash under systemd.** Even after extraction, `.\u002FAppRun` runs Electron directly. Without `$DISPLAY`, Chromium-ozone dies: `Missing X server or $DISPLAY` → `The platform failed to initialize. Exiting` → SIGSEGV. systemd user manager does not export `$DISPLAY`. Wrap with `xvfb-run -a`: it spawns a background `Xvfb :99` and provides `$DISPLAY=:99` to AppRun. xvfb-run is normally already installed (`\u002Fusr\u002Fbin\u002Fxvfb-run`).\n\nAfter wrapping with xvfb-run, OmniRoute starts and binds 20128 — but **a fourth issue then surfaces**:\n\n4. **SQLite driver availability on AppImage.** The npm install chain populates `better-sqlite3` native binary via `--allow-scripts`. The AUR\u002FAppImage build skips that, the embedded Electron Node is **22.2.10** (≤22.4), so `node:sqlite` (≥22.5 stdlib) is also unavailable. Only sql.js WASM remains, and its lazy `warmUpRuntimes()` may not finish before the first HTTP request lands, yielding `[DB] Nenhum driver SQLite disponível ... sql.js WASM ainda não foi pré-inicializado` on every `\u002Fv1\u002F*` call. This is a packaging defect in `omniroute-bin`, not a misconfiguration. The recommended fix is to revert to the npm install path on WSL; the AUR\u002FAppImage install should be considered unsupportable on WSL2 until upstream bundles a portable SQLite layer.\n\n**Decision matrix:**\n\n| Choice | SQL guaranteed? | WSL2 cost | Recommended for |\n|---|---|---|---|\n| `npm i -g omniroute --allow-scripts=...` | ✅ bundled better-sqlite3 | low | **Yes — default** |\n| `yay -S omniroute-bin` + AppImage + xvfb | ⚠️ only sql.js, may 500 | medium | Native Arch on bare metal |\n| Docker | ✅ | low | Hermetic \u002F cross-machine |\n| Source build (`git clone && npm i`) | ✅ | high | Customization \u002F patch dev |\n\nBottom line: **on WSL stay on the npm install path.** The AUR\u002FAppImage install is not viable there without upstream changes.\n\n→ Full reproduction transcript + exact logs at `references\u002For-appimage-wsl-quirks.md`.\n\n## The MCP tool catalog (99 tools)\n\n`hermes mcp test omniroute` should report 99 tools. The notable ones for agent automation:\n\n- `omniroute_get_health` — uptime, memory, circuit breakers, cache stats\n- `omniroute_list_combos` — all configured combos\n- `omniroute_route_request` — send a chat completion through OR routing\n- `omniroute_simulate_route` — predict routing without firing request\n- `omniroute_check_quota` — remaining quota per provider\n- `omniroute_cost_report` — cost by period (session\u002Fday\u002Fweek\u002Fmonth)\n- `omniroute_list_models_catalog` — all available models\n- `omniroute_set_routing_strategy` — change routing strategy at runtime\n- `omniroute_set_resilience_profile` — aggressive\u002Fbalanced\u002Fconservative\n- `omniroute_set_budget_guard` — USD cap per session\n- `omniroute_test_combo` — live-fire all providers in a combo\n- `omniroute_compression_status` — RTK\u002FCaveman engine state\n- `omniroute_cache_stats` — semantic + prompt cache hit rate\n- `omniroute_sync_pricing` — refresh pricing from LiteLLM\n- `omniroute_db_health_check` — repair broken combo references\n- `omniroute_pick_fastest_model` — best latency combo across providers\n- `omniroute_set_compression_engine` — switch RTK\u002FCaveman\u002FLite\u002Fstacked\u002Fetc.\n- `omniroute_agent_skills_list` \u002F `_get` \u002F `_coverage` — 42 SKILL.md catalog\n- `omniroute_web_search` \u002F `omniroute_web_fetch` — web gateway tools\n- `omniroute_oneproxy_*` — proxy pool management\n- `omniroute_omniroute_skills_*` — agent skills discovery\n\nPlus per-feature clusters: memory, eval, a2a, gamification, webhooks.\n\n## Auto-routing via `auto\u002F*` model IDs\n\nOmniRoute's 12-factor scoring (`health` 0.20, `quota` 0.15, `costInv` 0.15, `latencyInv` 0.12, `taskFit` 0.08, etc.) means Tier 1 subscription (cost = 0) wins over Tier 2 API key over Tier 3 free. With Token Plan minimax-cn connected, `auto\u002Fcoding` defaults to M3. Pre-defined weight profiles override: `X-OmniRoute-Mode: fast|cheap|quality|reliable|offline`.\n\nPer-request controls:\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"X-OmniRoute-Mode: fast\" \\\n  -H \"X-OmniRoute-Budget: 0.05\" \\\n  -H \"X-OmniRoute-Budget-Fallback: strict\" \\\n  -d '{\"model\":\"auto\",...}'\n```\n\n## Compression — what configures what\n\nCompression has **two orthogonal persist surfaces**; setting either alone gives a half-configured pipeline. See `references\u002For-compression-config.md` for the full three-surface table.\n\n| Surface | Persists via | What it writes |\n|---|---|---|\n| Engine pipeline (which engines + intensities) | MCP `omniroute_set_compression_engine`, or in the `PUT \u002Fapi\u002Fsettings\u002Fcompression` body | `stackedPipeline`, `engines.*.enabled`, `rtkConfig`, `cavemanConfig` |\n| Trigger layer (when, how much, hard guards) | MCP `omniroute_compression_configure`, or in the `PUT \u002Fapi\u002Fsettings\u002Fcompression` body | `defaultMode`, `autoTriggerMode`, `autoTriggerTokens`, `strategy`, `targetRatio`, `preserveSystemPrompt`, `languageConfig` |\n\n**Rule of thumb**: call engine first (decides WHAT pipeline runs), then trigger (decides WHEN + HOW MUCH). Doing only one yields half-configured compression that may or may not fire.\n\n`PATCH \u002Fapi\u002Fsettings` (i.e. the root settings endpoint) accepts the body, returns 200, and **silently drops** every compression-namespace key — including `languageConfig`. That's why dashboard toggles survive a refresh but PATCH scripts have no effect. Real entrypoint is `PUT \u002Fapi\u002Fsettings\u002Fcompression` (Zod-validated schema `compressionSettingsUpdateSchema`).\n\n`MCP omniroute_compression_status` returns the **trigger** state but **not** `languageConfig`. To see \u002F change `languageConfig` you must use `GET\u002FPUT \u002Fapi\u002Fsettings\u002Fcompression`.\n\n**Language packs** in v3.8.49: `[\"en\",\"zh\",\"pt-BR\",\"es\",\"de\",\"fr\",\"ja\",\"id\"]` (8 installed). The wiki `Compression-Language-Packs` page lists only 6 — outdated; `zh` (16 rules) and `id` exist but are missing from the docs. To enable:\n```bash\ncurl -X PUT http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fsettings\u002Fcompression \\\n  -H \"Authorization: Bearer $KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"languageConfig\":{\"enabled\":true,\"enabledPacks\":[\"en\",\"zh\"],\"defaultLanguage\":\"zh\",\"autoDetect\":true}}'\n```\n\n## How much context do OmniRoute skills cost?\n\nWhen a system prompt enumerates external SKILL.md directories (e.g. `~\u002F.hermes\u002Fskills\u002Fdevops\u002Fomniroute-agents\u002F` containing all 44 OR agent-skill files), Hermes's loader (`agent\u002Fprompt_builder.py:1514 build_skills_system_prompt`) parses the YAML **frontmatter** of each one and emits exactly one index line per skill:\n\n```text\n- omni-inference: The core OpenAI-compatible inference endpoints: chat completions, embeddings, …\n```\n\nIt does **not** emit the SKILL.md body. The body is only loaded when the model explicitly calls `skill_view(name='omni-inference')`. So the 44 SKILL.md files (avg ~10 KB body each) cost roughly **2 K tokens \u002F 8.5 KB** in the system prompt — average description length is ~172 chars. This is small enough to install them all at once (option `B` is acceptable) rather than cherry-picking. Confirmed by frontmatter scan, not estimated.\n\n→ If the model **needs full skill prose**, ask it to call `skill_view(name='omni-inference')` first rather than guessing from the description line.\n\n## Verifying end-to-end\n\n```bash\n# Service alive\ncurl -sS -o \u002Fdev\u002Fnull -w \"%{http_code}\\n\" http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fmodels    # → 200\n\n# Provider active\ncurl -sS -X POST http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $KEY\" \\\n  -d '{\"model\":\"minimax-cn\u002FMiniMax-M3\",\"messages\":[{\"role\":\"user\",\"content\":\"1+1\"}],\"max_tokens\":10}'\n# → 200 with x-mm-request-id header (proves minimaxi.com was called)\n\n# MCP for external agents\nhermes mcp test omniroute\n# → ✓ Connected + ✓ Tools discovered: 99\n\n# Auto routing\ncurl -sS -X POST http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $KEY\" \\\n  -d '{\"model\":\"auto\u002Fcoding\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}],\"max_tokens\":10}'\n# → 200, model field shows which provider won\n```\n\n## See also\n\n- Bundled `hermes-agent` skill — Hermes configuration, MCP server commands, providers\n- `references\u002For-provider-prefix-table.md` — verified alias\u002Fmodel-id mapping for OR 3.8.x\n- `references\u002For-mcp-curl-smoke.sh` — reproducible smoke test for MCP enable + 99-tool discovery\n- `references\u002For-appimage-wsl-quirks.md` — full transcript of the 4-layer failure chain when running `omniroute-bin` on WSL2 (FUSE → xvfb → SQLite) and why the npm path is the only stable one\n- `references\u002For-compression-config.md` — the three persistence surfaces (`PATCH \u002Fapi\u002Fsettings` vs `PUT \u002Fapi\u002Fsettings\u002Fcompression` vs MCP `compression_configure`), the 8 actually-installed language packs (incl. `zh`\u002F`id`, not 6 like the wiki claims), the verified \"standard\" recipe, and the API key reveal gotcha\"","# OmniRoute Gateway — Install, Configure, Integrate\n\nOmniRoute is a **local AI gateway**: a Node.js HTTP server (`http:\u002F\u002Flocalhost:20128`) exposing an OpenAI-compatible API at `\u002Fv1` that proxies to 290+ upstream AI providers with auto-failover, 12-factor scoring, and 15-95% token compression. Goal: replace direct provider API calls with one local endpoint so any AI coding tool (Claude Code, Codex, Cursor, OpenCode, Hermes, etc.) gains provider-agnostic resilience.\n\nThis skill captures the **operational** knowledge needed to install OmniRoute, expose its MCP server to external agents (Hermes), and integrate it as a model provider — knowledge that repeats every time someone sets this up fresh.\n\n## When to load this skill\n\n- \"install OmniRoute\" \u002F \"set up OmniRoute\"\n- \"route Claude Code \u002F Codex \u002F Cursor through OmniRoute\"\n- \"expose OmniRoute's MCP tools to Hermes\"\n- \"OmniRoute is detected but Hermes isn't\" \u002F \"OmniRoute 500 errors\"\n- \"switch Hermes default to OmniRoute\"\n- \"set up an AI gateway \u002F LLM router\"\n- Troubleshooting MCP connection failures to localhost:20128\n- **\"opencode-go 400 MissingSessionID \u002F x-opencode-session\"** — opencode.ai 自 2026-09-06 强制该头；3.8.49 默认只透传不合成，**3.8.50 起默认合成**（`OPENCODE_SYNTHESIZE_CLI_HEADERS` 反转为 opt-out）。升级到 ≥3.8.50 即修复，勿设 false。\n- **npm 自更新跳过 install scripts** — `npm install -g omniroute@latest` 报 \"install scripts not yet covered by allowScripts\"（better-sqlite3 等 native 包静默跳过 → 500）。重跑带完整 allow-scripts CSV，再 `omniroute doctor` 验证 native binary OK。\n- **\"omniroute.service restarting loop\" \u002F \"exit-code 203 EXEC\"** — unit pointing at wrong binary path\n- **\"AppImage \u002F AUR omniroute-bin failed\" \u002F \"sqlite driver unavailable on AppImage\"**\n- **\"Missing X server or $DISPLAY\" \u002F \"platform failed to initialize\"** in omniroute service log\n- **\"PATCH \u002Fapi\u002Fsettings returns 200 but does nothing on languageConfig\"** → real endpoint is `PUT \u002Fapi\u002Fsettings\u002Fcompression`\n- **\"compression_status MCP tool does not show languageConfig\"** → schema intentionally partial; use `GET \u002Fapi\u002Fsettings\u002Fcompression` to see `languageConfig`\n- **\"key value masked in API response\" \u002F \"reveal disabled\"** — API key not recoverable; ask user to Dashboard-copy\n- **\"Too many failed attempts on \u002Fapi\u002Fauth\u002Flogin\"** → restart service to clear\n\n## The 7-step install procedure on Linux\u002FWSL\n\n```bash\n# 1. Install (background — ~5 min, 1176 packages)\nnpm install -g omniroute\n\n# 2. CRITICAL: re-install with native-binding scripts allowed.\n#    Without this, better-sqlite3\u002Fsharp\u002Fonnxruntime-node are silently skipped\n#    and the CLI launches but every endpoint returns HTTP 500 (\"better-sqlite3\n#    native binary was not found\"). The full allow-scripts CSV:\nnpm install -g --allow-scripts=omniroute,better-sqlite3,keytar,tls-client-node,onnxruntime-node,sharp,core-js,esbuild,@parcel\u002Fwatcher,@swc\u002Fcore,protobufjs,koffi omniroute\n\n# 3. Verify native binary\nomniroute doctor\n#   → \"OK  Native binary: better-sqlite3 native binary is compatible\"\n\n# 4. systemd unit at ~\u002F.config\u002Fsystemd\u002Fuser\u002Fomniroute.service\n#    ⚠️ MUST have ProtectHome=false AND ProtectSystem=false.\n#    The default templates ship with ProtectHome=read-only, which makes SQLite\n#    writes silently fail (storage.sqlite created at install but never\n#    updated post-startup) → \u002Fv1\u002Fmodels and \u002Fapi\u002Fhealth return HTTP 500 with\n#    no log error. The \"OmniRoute is running!\" banner lies — it only proves\n#    the HTTP server bound the port, not that requests work. Verify with curl:\ncurl http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fmodels\n#   → 200 + JSON catalog. If 500, fix ProtectHome\u002FProtectSystem and restart.\n\n# 5. Enable + start\nsystemctl --user daemon-reload\nsystemctl --user enable --now omniroute.service\n\n# 6. Wait ~8s for \"OmniRoute is running!\" then verify with curl.\n# 7. Add providers via Dashboard (http:\u002F\u002Flocalhost:20128) — or use the\n#    OmniRoute Agent Skills catalog at \u002Fapi\u002Fagent-skills for automation.\n```\n\n**Reference systemd unit (tested, works):**\n\n```ini\n[Unit]\nDescription=OmniRoute AI Gateway\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=\u002Fhome\u002Fpo\nExecStart=\u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002Fomniroute\nRestart=on-failure\nRestartSec=5\nTimeoutStartSec=30\n# CRITICAL: these two must be false for OmniRoute to write ~\u002F.omniroute\u002F\nProtectSystem=false\nProtectHome=false\nPrivateTmp=true\n\n[Install]\nWantedBy=default.target\n```\n\n### AUR \u002F AppImage variant (`omniroute-bin`)\n\n`omniroute-bin` (AUR) packages the OmniRoute Electron AppImage at `\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage` and a 68-byte `\u002Fusr\u002Fbin\u002Fomniroute` wrapper (`exec \u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage \"$@\"`). The package ships **no systemd unit** and **no AppArmor\u002Fsystemd integration**, so you must author your own — and on WSL you must also work around three defects the npm build path does not expose (see Pitfall 8 and `references\u002For-appimage-wsl-quirks.md`):\n\n```ini\n[Unit]\nDescription=OmniRoute AI Gateway (AppImage)\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=\u002Fhome\u002Fpo\n# Electron app needs a display server; xvfb-run resolves the ozone\u002Fx11 crash.\n# AppRun locates APPDIR by readlink-ing itself, so we run it from the\n# extracted dir, NOT directly (FUSE unavailable on WSL2).\nExecStart=\u002Fusr\u002Fbin\u002Fxvfb-run -a \u002Fhome\u002Fpo\u002Fsquashfs-root\u002FAppRun\nRestart=on-failure\nRestartSec=5\nTimeoutStartSec=30\nProtectSystem=false\nProtectHome=false\nPrivateTmp=true\n\n[Install]\nWantedBy=default.target\n```\n\nTo seed the `squashfs-root\u002F` directory:\n```bash\ncd \u002Fhome\u002Fpo                       # AppImage must write somewhere user-writable\n\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage --appimage-extract\n```\n\n## Enabling the MCP server (4 prerequisites)\n\nDefault `mcpEnabled: false` and `mcpTransport` unset. External agents (Hermes, Claude Desktop) hitting `\u002Fapi\u002Fmcp\u002Fstream` will get `{\"error\":\"MCP server is disabled. Enable it from the Endpoints page.\"}` until all four are set:\n\n1. **Enable MCP via settings API** (management auth required — login cookie from `\u002Fapi\u002Fauth\u002Flogin` with the initial admin password from logs):\n   ```bash\n   curl -X PATCH http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fsettings \\\n     -H \"Content-Type: application\u002Fjson\" \\\n     -H \"Cookie: auth_token=$COOKIE\" \\\n     -d '{\"mcpEnabled\":true,\"mcpTransport\":\"streamable-http\",\"a2aEnabled\":true}'\n   ```\n2. **Create a dedicated API key** for the agent (not the admin cookie):\n   ```bash\n   curl -X POST http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fkeys \\\n     -H \"Content-Type: application\u002Fjson\" -H \"Cookie: auth_token=$COOKIE\" \\\n     -d '{\"name\":\"hermes-mcp\",\"scopes\":[\"admin\"]}'\n   ```\n   → returns `{\"key\":\"sk-XX...YY\",\"id\":\"...\"}`. **`sk-…` value is masked on the wire** (response shape `{\"key\":\"sk-41a4c****37f1\",…}`); the `reveal` endpoint is **disabled in v3.8.49** by default (`{\"error\":\"API key reveal is disabled\"}`). The full key is shown exactly once, only when the operator clicks \"copy\" in the Dashboard. CLI\u002FAPI users cannot recover it. Plan: ask the user to create the key in Dashboard and paste it; do **not** rely on the API as the source of full keys. See `or-compression-config.md` § \"API key creation returns masked value\". `manage` scope is sufficient for `PUT \u002Fapi\u002Fsettings\u002Fcompression`; only `\u002Fapi\u002Fkeys` admin and `\u002Fapi\u002Fauth\u002Flogin` revocation need `admin`.\n3. **The `Authorization: Bearer \u003Ckey>` header works for both chat completions and MCP** if the key has admin scope. No cookie needed from external clients.\n4. **MCP session handshake requires session ID**: first call `initialize` returns `Mcp-Session-Id` response header → pass it as `Mcp-Session-Id` on every subsequent `tools\u002Flist` \u002F `tools\u002Fcall` within the same session. Server returns SSE format (`event: message\\ndata: {json}\\n\\n`).\n\nVerify with `hermes mcp test omniroute` → should show `✓ Connected (~500ms)` and `✓ Tools discovered: 99`.\n\n## Adding OmniRoute as Hermes' model provider\n\nHermes supports any OpenAI-compatible endpoint via `provider: custom` (NOT `provider: openai` — that errors at startup with `Unknown provider 'openai'`):\n\n```bash\nhermes config set model.default \"minimax-cn\u002FMiniMax-M3\"     # or auto\u002Fcoding\nhermes config set model.provider \"custom\"\nhermes config set model.base_url \"http:\u002F\u002Flocalhost:20128\u002Fv1\"\nhermes config set model.api_key \"sk-...\"                       # the OR gateway key from step 2\nhermes config set model.context_length 1048576                # match the model's context window\nhermes chat -q \"test\"                                          # verify end-to-end\n```\n\nThe `auto\u002F*` virtual models (no combo creation needed) make Hermes pick the best model across all providers OR has connected — `auto\u002Fcoding`, `auto\u002Ffast`, `auto\u002Fcheap`, `auto\u002Fcoding:fast`, `auto\u002Freasoning:pro` etc. Validated against `GET \u002Fv1\u002Fmodels`; the `combo` owned_by group in that list IS the auto catalog.\n\n## Provider model-id prefix format\n\nEach provider has an `alias` field in `src\u002Fshared\u002Fconstants\u002Fproviders.ts` (or registry files). The model ID format is `\u003Calias>\u002F\u003Cmodel-id>`:\n\n| Provider | Prefix | Example |\n|---|---|---|\n| `minimax-cn` (China, Token Plan) | `minimax-cn\u002F` | `minimax-cn\u002FMiniMax-M3` |\n| `minimax` (Global) | `minimax\u002F` | — |\n| `github` (Copilot OAuth) | `gh\u002F` or `github\u002F` | `github\u002Fclaude-sonnet-5` |\n| `auggie` | `aug\u002F` | `aug\u002Fclaude-sonnet-4.6` |\n| `opencode` (free tier) | `oc\u002F` | `oc\u002Fminimax-m3-free` |\n| `duckduckgo-web` | `ddgw\u002F` | `ddgw\u002Fgpt-5-mini` |\n| `theoldllm` | `tllm\u002F` | `tllm\u002FCLAUDE_4_6_OPUS` |\n| `veoaifree-web` | `veo-free\u002F` | `veo-free\u002Fveo` |\n| `mimocode` (Xiaomi) | `mcode\u002F` | `mcode\u002Fmimo-auto` |\n| `chipotle` | `pepper\u002F` | `pepper\u002Fpepper-1` |\n\nTo verify what each provider exposes: `curl http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fmodels -H \"Authorization: Bearer $KEY\" | python3 -c \"import sys,json; d=json.load(sys.stdin); [print(m['owned_by'], m['id']) for m in d['data']]\"`.\n\n## Common pitfalls (all observed, all reproducible)\n\n### Pitfall 1: \"Installed but every endpoint returns 500\"\n\nBanner shows \"running\" but `\u002Fv1\u002Fmodels` and `\u002Fapi\u002Fhealth` return HTTP 500 with no log error. **Root cause: `ProtectHome=read-only` in systemd unit blocking SQLite writes.** Fix: edit the unit to set `ProtectHome=false ProtectSystem=false`, then `systemctl --user daemon-reload && systemctl --user restart omniroute`. Verify with `stat -c '%y' ~\u002F.omniroute\u002Fstorage.sqlite` — mtime should advance past the service restart time after the first request.\n\n### Pitfall 2: `npm install` succeeds but `native binary was not found`\n\nPEP 668-like mechanism silently blocked 12 native-binding install scripts (better-sqlite3, sharp, onnxruntime-node, koffi, esbuild, @parcel\u002Fwatcher, @swc\u002Fcore, keytar, tls-client-node, core-js, protobufjs, omniroute itself). Re-install with the explicit `--allow-scripts` CSV above. **Applies to ANY npm package using node-gyp** (electron tools, SQLite drivers, ONNX, image-processing CLIs).\n\n### Pitfall 3: MCP endpoint returns \"MCP server is disabled\"\n\n`mcpEnabled` is false by default. Fix requires PATCH `\u002Fapi\u002Fsettings` (not just toggling in UI if API-only). Confirms MCP is exposed: `curl -X POST http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fmcp\u002Fstream` should return `event: message\\ndata: {\"result\":{\"serverInfo\":{\"name\":\"omniroute\"}}}`, not the disabled error.\n\n### Pitfall 4: Hermes `Unknown provider 'openai'`\n\n`model.provider` is the **dispatcher name**, not the upstream API name. For ANY OpenAI-compatible endpoint (OmniRoute, LiteLLM, vLLM, Ollama, LM Studio), use `provider: custom`. The skill-level fix is in SKILL.md at `## Providers` → add an explicit note. (Bundled skill; cannot edit. Carry the rule in this skill.)\n\n### Pitfall 5: OmniRoute CLI agent detector misses Hermes on Linux\u002FWSL\n\nOmniRoute's `src\u002Flib\u002Fcli-helper\u002Ftool-detector.ts` uses `getCachedLoginShellPath()` which **returns null on any non-darwin platform** (line 60: `if (platform !== \"darwin\") return null`). On Linux\u002FWSL, detector only sees systemd's truncated PATH (typically `\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fbin`), missing `~\u002F.npm-global\u002Fbin\u002F` and `~\u002F.local\u002Fbin\u002F`. Hermes installs to `~\u002F.local\u002Fbin\u002Fhermes` (Python venv wrapper). Workaround: symlink to a path in the truncated PATH:\n```bash\nln -sf \u002Fhome\u002Fpo\u002F.local\u002Fbin\u002Fhermes \u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002Fhermes\n```\n\n### Pitfall 6: \"OmniRoute detects openclaw but I uninstalled it\"\n\nOR detector checks for binary in PATH (not config dir). If you only deleted `~\u002F.openclaw\u002F` config but didn't run `npm uninstall -g openclaw`, the binary is still in `\u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002F` and detector reports \"installed\". Fix: `npm uninstall -g openclaw`. Detector then returns installed=false.\n\n### Pitfall 7: Token Plan with OmniRoute — cost\u002Fbilling path\n\nOmniRoute's `minimax-cn` provider hardcodes `https:\u002F\u002Fapi.minimaxi.com\u002Fanthropic\u002Fv1\u002Fmessages` as the base URL (Anthropic-compatible surface), NOT the `\u002Fv1\u002Fcoding_plan\u002F...` path used by the `mmx` CLI. **The same API key works for both** — Token Plan quota IS consumed when calling through OmniRoute's `minimax-cn\u002FMiniMax-M3` (verified by `x-mm-request-id` response header in the request back to minimaxi.com). If the user wants the dedicated Token Plan endpoint instead, that requires an OmniRoute provider plugin (custom baseUrl).\n\n### Pitfall 8: AUR `omniroute-bin` (AppImage) on WSL — three stacked defects\n\nThe AUR package works on native Linux but fails on WSL across three layers; each layer masks the next, so users typically only see `HTTP 500` on `\u002Fv1\u002Fmodels` and assume it's a config bug. **All three fixes are needed.**\n\n1. **No systemd unit.** `omniroute-bin` ships only `\u002Fusr\u002Fbin\u002Fomniroute` (AppImage launcher) and `\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage`. There is no unit file. An orphan user unit pointing at the old npm path (`\u002Fhome\u002Fpo\u002F.npm-global\u002Fbin\u002Fomniroute`) will silently keep restarting with `status=203\u002FEXEC` (\"no such file\"). Symptom: `Restart counter is at N`, port 20128 never opens.\n\n2. **FUSE unavailable in WSL2 kernel.** Running `\u002Fopt\u002Fomniroute-bin\u002FOmniRoute.AppImage` directly fails: `Cannot mount AppImage, please check your FUSE setup`. WSL2's kernel is sealed\u002Fsigned-readonly; userspace `apt install fuse` only gives userspace helpers, not `fuse.ko`. AppImage itself has a fallback: `AppImage --appimage-extract` writes `squashfs-root\u002F` to cwd and exits. Then point systemd at `\u003Cextracted>\u002FAppRun`.\n\n3. **Electron ozone\u002Fx11 crash under systemd.** Even after extraction, `.\u002FAppRun` runs Electron directly. Without `$DISPLAY`, Chromium-ozone dies: `Missing X server or $DISPLAY` → `The platform failed to initialize. Exiting` → SIGSEGV. systemd user manager does not export `$DISPLAY`. Wrap with `xvfb-run -a`: it spawns a background `Xvfb :99` and provides `$DISPLAY=:99` to AppRun. xvfb-run is normally already installed (`\u002Fusr\u002Fbin\u002Fxvfb-run`).\n\nAfter wrapping with xvfb-run, OmniRoute starts and binds 20128 — but **a fourth issue then surfaces**:\n\n4. **SQLite driver availability on AppImage.** The npm install chain populates `better-sqlite3` native binary via `--allow-scripts`. The AUR\u002FAppImage build skips that, the embedded Electron Node is **22.2.10** (≤22.4), so `node:sqlite` (≥22.5 stdlib) is also unavailable. Only sql.js WASM remains, and its lazy `warmUpRuntimes()` may not finish before the first HTTP request lands, yielding `[DB] Nenhum driver SQLite disponível ... sql.js WASM ainda não foi pré-inicializado` on every `\u002Fv1\u002F*` call. This is a packaging defect in `omniroute-bin`, not a misconfiguration. The recommended fix is to revert to the npm install path on WSL; the AUR\u002FAppImage install should be considered unsupportable on WSL2 until upstream bundles a portable SQLite layer.\n\n**Decision matrix:**\n\n| Choice | SQL guaranteed? | WSL2 cost | Recommended for |\n|---|---|---|---|\n| `npm i -g omniroute --allow-scripts=...` | ✅ bundled better-sqlite3 | low | **Yes — default** |\n| `yay -S omniroute-bin` + AppImage + xvfb | ⚠️ only sql.js, may 500 | medium | Native Arch on bare metal |\n| Docker | ✅ | low | Hermetic \u002F cross-machine |\n| Source build (`git clone && npm i`) | ✅ | high | Customization \u002F patch dev |\n\nBottom line: **on WSL stay on the npm install path.** The AUR\u002FAppImage install is not viable there without upstream changes.\n\n→ Full reproduction transcript + exact logs at `references\u002For-appimage-wsl-quirks.md`.\n\n## The MCP tool catalog (99 tools)\n\n`hermes mcp test omniroute` should report 99 tools. The notable ones for agent automation:\n\n- `omniroute_get_health` — uptime, memory, circuit breakers, cache stats\n- `omniroute_list_combos` — all configured combos\n- `omniroute_route_request` — send a chat completion through OR routing\n- `omniroute_simulate_route` — predict routing without firing request\n- `omniroute_check_quota` — remaining quota per provider\n- `omniroute_cost_report` — cost by period (session\u002Fday\u002Fweek\u002Fmonth)\n- `omniroute_list_models_catalog` — all available models\n- `omniroute_set_routing_strategy` — change routing strategy at runtime\n- `omniroute_set_resilience_profile` — aggressive\u002Fbalanced\u002Fconservative\n- `omniroute_set_budget_guard` — USD cap per session\n- `omniroute_test_combo` — live-fire all providers in a combo\n- `omniroute_compression_status` — RTK\u002FCaveman engine state\n- `omniroute_cache_stats` — semantic + prompt cache hit rate\n- `omniroute_sync_pricing` — refresh pricing from LiteLLM\n- `omniroute_db_health_check` — repair broken combo references\n- `omniroute_pick_fastest_model` — best latency combo across providers\n- `omniroute_set_compression_engine` — switch RTK\u002FCaveman\u002FLite\u002Fstacked\u002Fetc.\n- `omniroute_agent_skills_list` \u002F `_get` \u002F `_coverage` — 42 SKILL.md catalog\n- `omniroute_web_search` \u002F `omniroute_web_fetch` — web gateway tools\n- `omniroute_oneproxy_*` — proxy pool management\n- `omniroute_omniroute_skills_*` — agent skills discovery\n\nPlus per-feature clusters: memory, eval, a2a, gamification, webhooks.\n\n## Auto-routing via `auto\u002F*` model IDs\n\nOmniRoute's 12-factor scoring (`health` 0.20, `quota` 0.15, `costInv` 0.15, `latencyInv` 0.12, `taskFit` 0.08, etc.) means Tier 1 subscription (cost = 0) wins over Tier 2 API key over Tier 3 free. With Token Plan minimax-cn connected, `auto\u002Fcoding` defaults to M3. Pre-defined weight profiles override: `X-OmniRoute-Mode: fast|cheap|quality|reliable|offline`.\n\nPer-request controls:\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"X-OmniRoute-Mode: fast\" \\\n  -H \"X-OmniRoute-Budget: 0.05\" \\\n  -H \"X-OmniRoute-Budget-Fallback: strict\" \\\n  -d '{\"model\":\"auto\",...}'\n```\n\n## Compression — what configures what\n\nCompression has **two orthogonal persist surfaces**; setting either alone gives a half-configured pipeline. See `references\u002For-compression-config.md` for the full three-surface table.\n\n| Surface | Persists via | What it writes |\n|---|---|---|\n| Engine pipeline (which engines + intensities) | MCP `omniroute_set_compression_engine`, or in the `PUT \u002Fapi\u002Fsettings\u002Fcompression` body | `stackedPipeline`, `engines.*.enabled`, `rtkConfig`, `cavemanConfig` |\n| Trigger layer (when, how much, hard guards) | MCP `omniroute_compression_configure`, or in the `PUT \u002Fapi\u002Fsettings\u002Fcompression` body | `defaultMode`, `autoTriggerMode`, `autoTriggerTokens`, `strategy`, `targetRatio`, `preserveSystemPrompt`, `languageConfig` |\n\n**Rule of thumb**: call engine first (decides WHAT pipeline runs), then trigger (decides WHEN + HOW MUCH). Doing only one yields half-configured compression that may or may not fire.\n\n`PATCH \u002Fapi\u002Fsettings` (i.e. the root settings endpoint) accepts the body, returns 200, and **silently drops** every compression-namespace key — including `languageConfig`. That's why dashboard toggles survive a refresh but PATCH scripts have no effect. Real entrypoint is `PUT \u002Fapi\u002Fsettings\u002Fcompression` (Zod-validated schema `compressionSettingsUpdateSchema`).\n\n`MCP omniroute_compression_status` returns the **trigger** state but **not** `languageConfig`. To see \u002F change `languageConfig` you must use `GET\u002FPUT \u002Fapi\u002Fsettings\u002Fcompression`.\n\n**Language packs** in v3.8.49: `[\"en\",\"zh\",\"pt-BR\",\"es\",\"de\",\"fr\",\"ja\",\"id\"]` (8 installed). The wiki `Compression-Language-Packs` page lists only 6 — outdated; `zh` (16 rules) and `id` exist but are missing from the docs. To enable:\n```bash\ncurl -X PUT http:\u002F\u002Flocalhost:20128\u002Fapi\u002Fsettings\u002Fcompression \\\n  -H \"Authorization: Bearer $KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"languageConfig\":{\"enabled\":true,\"enabledPacks\":[\"en\",\"zh\"],\"defaultLanguage\":\"zh\",\"autoDetect\":true}}'\n```\n\n## How much context do OmniRoute skills cost?\n\nWhen a system prompt enumerates external SKILL.md directories (e.g. `~\u002F.hermes\u002Fskills\u002Fdevops\u002Fomniroute-agents\u002F` containing all 44 OR agent-skill files), Hermes's loader (`agent\u002Fprompt_builder.py:1514 build_skills_system_prompt`) parses the YAML **frontmatter** of each one and emits exactly one index line per skill:\n\n```text\n- omni-inference: The core OpenAI-compatible inference endpoints: chat completions, embeddings, …\n```\n\nIt does **not** emit the SKILL.md body. The body is only loaded when the model explicitly calls `skill_view(name='omni-inference')`. So the 44 SKILL.md files (avg ~10 KB body each) cost roughly **2 K tokens \u002F 8.5 KB** in the system prompt — average description length is ~172 chars. This is small enough to install them all at once (option `B` is acceptable) rather than cherry-picking. Confirmed by frontmatter scan, not estimated.\n\n→ If the model **needs full skill prose**, ask it to call `skill_view(name='omni-inference')` first rather than guessing from the description line.\n\n## Verifying end-to-end\n\n```bash\n# Service alive\ncurl -sS -o \u002Fdev\u002Fnull -w \"%{http_code}\\n\" http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fmodels    # → 200\n\n# Provider active\ncurl -sS -X POST http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $KEY\" \\\n  -d '{\"model\":\"minimax-cn\u002FMiniMax-M3\",\"messages\":[{\"role\":\"user\",\"content\":\"1+1\"}],\"max_tokens\":10}'\n# → 200 with x-mm-request-id header (proves minimaxi.com was called)\n\n# MCP for external agents\nhermes mcp test omniroute\n# → ✓ Connected + ✓ Tools discovered: 99\n\n# Auto routing\ncurl -sS -X POST http:\u002F\u002Flocalhost:20128\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $KEY\" \\\n  -d '{\"model\":\"auto\u002Fcoding\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}],\"max_tokens\":10}'\n# → 200, model field shows which provider won\n```\n\n## See also\n\n- Bundled `hermes-agent` skill — Hermes configuration, MCP server commands, providers\n- `references\u002For-provider-prefix-table.md` — verified alias\u002Fmodel-id mapping for OR 3.8.x\n- `references\u002For-mcp-curl-smoke.sh` — reproducible smoke test for MCP enable + 99-tool discovery\n- `references\u002For-appimage-wsl-quirks.md` — full transcript of the 4-layer failure chain when running `omniroute-bin` on WSL2 (FUSE → xvfb → SQLite) and why the npm path is the only stable one\n- `references\u002For-compression-config.md` — the three persistence surfaces (`PATCH \u002Fapi\u002Fsettings` vs `PUT \u002Fapi\u002Fsettings\u002Fcompression` vs MCP `compression_configure`), the 8 actually-installed language packs (incl. `zh`\u002F`id`, not 6 like the wiki claims), the verified \"standard\" recipe, and the API key reveal gotcha\"",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"description":7},"Hermes Agent + Publieople","1.0.0",{"hermes":27},{"tags":28,"related_skills":36},[29,30,31,32,33,34,35],"omniroute","gateway","mcp","providers","llm-router","wsl","systemd",[37,38],"hermes-agent","hermes-bootstrap","master","2cd115c9a59092e1d0cf18805c164d7a57a7f123","skills\u002Fdevops\u002Fomniroute-gateway","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit","https:\u002F\u002Fgithub.com\u002Fpublieople","https:\u002F\u002Fwww.for-people.cn","Truly provide effective services for the real people","2026-10-11 09:10:19",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add publieople\u002Fhermes-config-kit --skill omniroute-gateway",{"tool":53,"command":54},"bunx","bunx skills add publieople\u002Fhermes-config-kit --skill omniroute-gateway",{"tool":56,"command":57},"pnpm","pnpm dlx skills add publieople\u002Fhermes-config-kit --skill omniroute-gateway","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fdevops\u002Fomniroute-gateway\u002FSKILL.md",true,[61,67,71,75],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002For-appimage-wsl-quirks.md","REFERENCE","参考文档",10228,"https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fdevops\u002Fomniroute-gateway\u002Freferences\u002For-appimage-wsl-quirks.md",{"path":68,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002For-compression-config.md",6443,"https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fdevops\u002Fomniroute-gateway\u002Freferences\u002For-compression-config.md",{"path":72,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002For-provider-prefix-table.md",4413,"https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fdevops\u002Fomniroute-gateway\u002Freferences\u002For-provider-prefix-table.md",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002For-mcp-curl-smoke.sh","SCRIPT","脚本",4912,"https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fdevops\u002Fomniroute-gateway\u002Fscripts\u002For-mcp-curl-smoke.sh",[82,89,96,103,110,117],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M75A845WYE5R2AFVSS7YHBJV","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M75A7QKQZD6YVEJ55KYNBHM1","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M75A7NCY8TJN7BVDV7GKQJNE","simplify-code","Parallel 4-agent cleanup of recent code changes.","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Fsimplify-code\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M75A7JW7JHDNNKYGFQDP4E2M","inspecting-hermes-desktop-dom","Read the live Hermes desktop DOM\u002FCSS over CDP.","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Finspecting-hermes-desktop-dom\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M75A7EP72GHSVHW337XD75CR","hermes-agent-skill-authoring","Author in-repo SKILL.md files: frontmatter and structure.","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Fhermes-agent-skill-authoring\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M75A7BGWRT0453313CJKP4SC","github","GitHub via gh CLI: PRs, issues, reviews, repos, auth.","https:\u002F\u002Fgithub.com\u002Fpublieople\u002Fhermes-config-kit\u002Fblob\u002Fmaster\u002Fskills\u002Fsoftware-development\u002Fgithub\u002FSKILL.md",[],[]]