Route prompts to local or cloud models by complexity
Wayfinder is a local-first, deterministic model router in Rust that scores each request offline and picks a destination, keyless until delivery.
desktop-v0.1.0Add to Favorites
Why it matters
Wayfinder helps developers optimize LLM costs by deterministically routing each prompt to either a cheap local model or an expensive cloud model based on structural complexity analysis-no extra model calls, no latency, fully offline.
Outcomes
What it gets done
Analyze prompt structure (length, headings, lists, code blocks) to calculate complexity scores in microseconds
Route simple prompts to local models and complex ones to cloud APIs without calling a classifier model
Calibrate routing thresholds on your own traffic patterns and vocabulary
Proxy requests to any OpenAI-compatible endpoint (Anthropic, Gemini, Ollama, local servers) with cost tracking
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Overview
Wayfinder Router
Wayfinder is a Rust-based, local-first model router that scores requests offline and deterministically picks a destination, exposing OpenAI- and Anthropic-compatible endpoints. It embeds into a native macOS chat app and, for network exposure, offers a keyed, fail-closed managed data plane. Use it to route requests to models/providers deterministically without hardcoding provider choice, either embedded in the macOS app or as a standalone gateway; never expose the local surface directly to a network - use the managed data plane instead.
What it does
Wayfinder is a local-first model router and native Apple AI environment. It scores each request locally, chooses an eligible destination model or provider, and keeps delivery policy separate from the application making the request. The production router is implemented in Rust; Wayfinder Desktop embeds that router directly inside the signed macOS application bundle, so no Python runtime, package, or fallback is required. The scored routing decision itself stays offline, deterministic, and keyless - credentials are only resolved afterward, for delivery, once a route has already been chosen.
The native Swift macOS app, Wayfinder Desktop, provides conversation-first chat with locally persisted history, automatic or pinned model selection, Apple Foundation Models delivery on eligible Apple Silicon Macs, opt-in ChatGPT account routing through a separately verified provider, and OpenAI-compatible and Anthropic-compatible local gateway endpoints alongside native setup, connection, routing, privacy, and diagnostic surfaces. Native iPhone and iPad apps are planned for v0.2.0, embedding the same authoritative Rust routing core to run approved on-device or direct cloud providers without requiring a Mac or localhost gateway; optional Mac pairing follows in v0.2.1 as an additional provider.
When to use - and when NOT to
Use the Rust gateway directly when you want an OpenAI-compatible (/v1, including POST /v1/responses) or Anthropic-compatible local endpoint with deterministic, policy-driven model selection rather than hardcoding a provider in your application. Modality support beyond text - embeddings, image, audio, batch - is explicitly gated: those surfaces remain fail-closed until their reviewed adapters are enabled, so don't assume they work by default.
Don't expose the local (default) surface to a network directly. For a network-exposed deployment, mint a virtual key and select the fail-closed managed data plane instead, which serves only inference, authenticated model discovery, and minimal /livez//readyz probes.
Inputs and outputs
The Rust workspace contains the deterministic scoring core, configuration parser, provider clients, a bounded HTTP gateway, service integration, native XPC clients, and a command-line helper (wayfinder-router). A local run exposes http://127.0.0.1:8088/v1 (OpenAI-compatible), http://127.0.0.1:8088 (Anthropic-compatible), and http://127.0.0.1:8088/healthz. The containerized managed data plane requires config/wayfinder-router.toml to define at least one virtual key and model, runs read-only with configuration mounted read-only, and writes audit and savings state beneath /var/lib/wayfinder under an unprivileged UID/GID (10001).
Integrations
Build and run the CLI directly:
cargo build --manifest-path rust/Cargo.toml --package wayfinder-cli --bin wayfinder-router --locked
A Docker image is built from the same Rust workspace and contains only the native gateway plus its runtime certificates. The verification suite spans cargo fmt/test/clippy for the Rust workspace, swift test for the macOS app, and a Node-based parity test for shared client code.
Who it's for
Developers who want a deterministic, offline-scored router in front of OpenAI- and Anthropic-compatible endpoints - whether embedded in a native macOS/iOS app or run as a standalone gateway or managed data-plane service - without hardcoding provider selection into application code.
Source README
Wayfinder
Wayfinder is a local-first model router and native Apple AI environment. It
scores each request locally, chooses an eligible destination, and keeps delivery
policy separate from the application making the request.
The production router is implemented in Rust. Wayfinder Desktop embeds that
router inside the signed application bundle; no Python runtime, package, or
fallback is required.
Products
Wayfinder Desktop
The native Swift macOS app provides:
- conversation-first Chat with locally persisted history;
- automatic or pinned model selection;
- Apple Foundation Models delivery on eligible Apple Silicon Macs;
- opt-in ChatGPT account routing through a separately verified provider;
- OpenAI-compatible and Anthropic-compatible local gateway endpoints;
- native setup, connection, routing, privacy, and diagnostic surfaces.
Desktop releases use SemVer and desktop-v* tags. Seemacos/WayfinderMac/Packaging/RELEASE.md.
Wayfinder for iPhone and iPad
Native standalone iPhone and iPad apps are planned for v0.2.0. They embed the
same authoritative Rust routing core and execute approved on-device or direct
cloud providers without requiring a Mac or localhost gateway. Optional Mac
pairing follows in v0.2.1 as an additional provider.
The governing contracts areWF-ROADMAP-0016,WF-ADR-0047, andWF-ADR-0048.
Mobile conversation persistence is governed byWF-ADR-0049.
The thread-first mobile interaction contract isWF-DESIGN-0020.
Rust gateway
The Rust workspace contains the deterministic scoring core, configuration
parser, provider clients, bounded HTTP gateway, service integration, native XPC
clients, and command-line helper.
Build it with:
cargo build \
--manifest-path rust/Cargo.toml \
--package wayfinder-cli \
--bin wayfinder-router \
--locked
Then run:
rust/target/debug/wayfinder-router route "Summarise this request"
rust/target/debug/wayfinder-router serve --host 127.0.0.1 --port 8088
For a network-exposed deployment, do not publish the local surface. Mint a
virtual key and select the fail-closed managed data plane:
rust/target/debug/wayfinder-router keys new --id team-a
rust/target/debug/wayfinder-router serve \
--surface data-plane --host 0.0.0.0 --port 8088
The managed listener contains inference, authenticated model discovery, and
minimal /livez//readyz probes only. See
Managed gateway deployment.
The gateway exposes:
- OpenAI-compatible:
http://127.0.0.1:8088/v1 - OpenAI Responses compatibility:
POST /v1/responses(bounded text and multi-turn contract) - Modality compatibility: explicit embeddings, image, audio, and batch capability contracts;
non-text surfaces remain fail-closed until their reviewed adapters are enabled - Anthropic-compatible:
http://127.0.0.1:8088 - Health:
http://127.0.0.1:8088/healthz
The scored decision remains offline, deterministic, and keyless. Credentials
are resolved only for delivery after the route is chosen.
Container
docker build -t wayfinder-router .
docker run --rm -p 8088:8088 \
--read-only --tmpfs /tmp --user 10001:10001 \
-v "$PWD/config:/etc/wayfinder:ro" \
-v wayfinder-state:/var/lib/wayfinder \
wayfinder-router
The image is built from the Rust workspace and contains only the native gateway
plus its runtime certificates. It starts the authenticated managed data plane,
so config/wayfinder-router.toml must define at least one virtual key and model.
Configuration remains read-only; audit and savings state are written beneath/var/lib/wayfinder by the unprivileged UID/GID 10001 process.
Verification
cargo fmt --manifest-path rust/Cargo.toml --all -- --check
cargo test --manifest-path rust/Cargo.toml --workspace --all-features --locked
cargo clippy --manifest-path rust/Cargo.toml \
--workspace --all-targets --all-features --locked -- -D warnings
swift test --package-path macos/WayfinderMac
node clients/shared/test/parity.mjs
Repository map
rust/ native router, gateway, providers, and service crates
apple/ planned shared Apple packages after bridge validation
ios/ planned native iPhone and iPad product
macos/WayfinderMac/ native Swift macOS app and release packaging
clients/ retained thin-client contract code and fixtures
decisions/ architecture decisions
designs/ product and interaction contracts
roadmaps/ delivery plans and closeout records
docs/ operational and release documentation
Wayfinder is licensed under Apache-2.0.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.