docs/wayfinder.md
Wayfinder is a self-hosted, deterministic
local/cloud LLM router. Its gateway runs on the user's machine (default
http://127.0.0.1:8088) and scores each prompt offline — no model call — to decide whether
the cheap/local or the dearer/cloud tier serves it. CodexBar polls the gateway's read-only
JSON endpoints and shows whether the gateway is up, how traffic split across the configured
routes, what that saved versus routing everything to the dearest tier, and the average routing
decision time.
The integration is read-only. CodexBar never sends prompts through the gateway, never calls its chat endpoints, and the endpoints it polls return accounting metadata only — Wayfinder's API never exposes prompt text.
Wayfinder's read-only endpoints are unauthenticated on loopback, so there is nothing to log in to: enable the provider in CodexBar Settings → Providers → Wayfinder. The default gateway URL is used unless you override it:
http://127.0.0.1:8088
If your gateway listens elsewhere, set the Gateway URL in Settings or export
WAYFINDER_GATEWAY_URL. Overrides must be HTTPS, or plain HTTP for loopback addresses only
(localhost, 127.0.0.0/8, ::1) — the gateway is a local service and remote plain-HTTP
endpoints are rejected.
ok or degraded (with the number of models missing API keys), plus
offline-mode and dry-run markers.cost_per_1k); unpriced gateways report a relative percentage only./metrics endpoint. Decisions are computed offline, so this is typically well under a
millisecond.| Endpoint | Purpose |
|---|---|
GET /healthz | Gateway status, configured models, offline flag, missing keys. |
GET /router/models | Configured model count and dry-run flag. |
GET /v1/savings?period=30d | Requests, tokens, realized/baseline cost, savings, per-route split. |
GET /metrics | Decision-latency histogram for the average routing time (best effort). |
| Variable | Description |
|---|---|
WAYFINDER_GATEWAY_URL | Optional gateway URL override (HTTPS, or loopback HTTP). |
If the gateway is not running, CodexBar reports that it could not be reached and suggests
starting it with wayfinder-router serve.