Route to your own hardware — or approved cloud when you choose. Keep sensitive routes off unapproved providers; redact known credentials before dispatch. Refuse anything over budget. Kill loops in seconds. One ~5.5 MB Rust binary that decides before the money is spent, with an embedded control room at /ui so you can watch enforcement happen in real time.
Works with any OpenAI-compatible agent — point base_url at localhost:8787/v1.
Claude Code connects via ANTHROPIC_BASE_URL. Pre-release · MIT · dogfooded daily.
Local nodes can be stranded, cold, or overloaded while a runaway agent turns retries and fan-out into spend. Stoke puts the circuit breaker before the provider call: it rejects loops, clamps fan-out, holds concurrent stream reservations, and only escalates to paid inference when your policy allows it.
Loop detection and rate limits refuse repeated traffic before another provider call is made.
Pre-dispatch ceilings limit how many billed provider calls one request may create.
Concurrent streams reserve their possible cost before dispatch, so a burst cannot overshoot the key's cap.
Use model support, warm state, health, load, and policy to choose a route across your configured capacity.
An embedded panel for your running Stoke gateway: decisions, budget state, routing, and node status in one view.
Illustrative preview. This button simulates panel events in your browser. It does not send traffic to a gateway.
The repository smoke test exercises the pricing gate, PII redaction, loop refusal, streamed spend, in-flight holds, fan-out clamp, cache isolation, and fail-closed boot validation against local mock providers.
Point OpenAI-compatible clients or Claude Code at Stoke. Production integrations stay in place.
Stoke discovers model inventory and health through /v1/nodes, then routes across configured Ollama nodes and gateways without manual topology selection.
Poll each configured Ollama or federated Stoke node for discovered models, warm state, health, and load.
Stoke filters by route policy, then prefers a healthy warm node with the lowest live load—without asking the client to map topology.
The response and logs identify the selected node and model; GET /v1/nodes remains the operator's live inventory view.
Keep Ollama private on each machine. Add the second Stoke gateway as an authenticated remote provider; both machines then sit behind the same client URL.
OPENAI_BASE_URL=http://localhost:8787/v1 stays unchanged for the client; Stoke discovers the remote inventory and chooses the eligible node.
See the two-machine Ollama walkthrough.
Task-shaped walkthroughs for spend, loops, routing, and security.
Configuration, endpoints, and the operational contract.
Open source, MIT licensed, and local by default. No hosted control plane or account required.
Read the docs →No. Stoke is a self-hosted Rust gateway that runs on infrastructure you control.
Yes. Stoke accepts OpenAI-compatible clients and the Anthropic Messages API. Point the client at Stoke, then configure the upstream provider or local node.
Yes. Connect and configure the nodes or gateways, then Stoke can route across their discovered model and health state.
No. It is a browser-only preview of the panel's event shape. A running gateway exposes the real authenticated panel at GET /ui and the repeat-request demo at POST /ui/demo.
Start with the guides, then read the README and architecture notes.
A route can be pinned to the tiers you approve. When no approved provider is available, Stoke fails closed with 403 rather than silently escalating to unapproved cloud capacity.
Set allowed_tiers = ["local", "remote"] on a route and cloud fallback is denied before any provider is contacted.
Unknown tier names are rejected at boot; a route with no eligible approved provider returns 403, never an open gateway.
Known credentials are redacted before a request is dispatched to a provider.
Align configured machines behind one policy gateway, then decide what reaches a paid provider.