Self-hosted local AI runtime · Sovereign Operating Layer
Reuse the AI subscriptions you already pay for.
You host everything. Heiwa ships software, not a hosted operator app. Claude Max, ChatGPT Plus, Google AI Pro, API-key providers, and local Ollama all unify under one self-hosted operator surface. Routing, receipts, approvals, and evidence stay on the machine you install on. Tokens are counted locally. Currency conversion is a presentation overlay you choose — CAD, USD, off, anything.
curl -fsSL https://heiwa.ltd/install | sh
01 · Why Heiwa
NOT A HOSTED ROUTER · A LOCAL OPERATING LAYERCentralises traffic, secrets, and inference behind a vendor surface. Useful for remote model access, not a sovereign runtime.
Your data, memory, and operator state live on the vendor's machine.
Centralises operator control on the machine you host. Routing, sandboxes, evidence, and approvals run locally; provider runtimes stay provider-owned.
The public site ships software. Your machine runs the runtime.
02 · Three Provider Lanes
OAUTH CLI · API KEY · LOCALLocal
PRIVATE · CHEAPOllama and machine-owned models. Inference stays on the operator machine. Default for sovereign work.
recommendedOAuth CLI
SUB-BACKEDClaude Max, ChatGPT Plus, Google AI Pro — reuse subscriptions you already pay for through provider-owned CLIs.
no extra spendAPI Key
METEREDOpenAI, Anthropic, Google, OpenRouter, and more. Brought into the same runtime when remote APIs are the right escalation path.
metered · $CAD03 · Cost Attribution
ENV · PROVIDER · MODEL · AGENTEvery receipt carries four facts: where it ran, who served it, which model, and which agent requested it. Most of the daily token count is free — sub-backed or local. The metered API lane is the only one that turns tokens into currency.
| Env | Provider | Model | Agent | Tokens | Cost |
|---|---|---|---|---|---|
| local | ollama |
qwen3.5:9b |
coding | 92.4k | 0.00 CAD |
| oauth | claude-code |
claude-sonnet-4-6 |
strategy | 47.1k | 0.00 CAD |
| oauth | codex |
gpt-5-codex |
refactor | 28.9k | 0.00 CAD |
| api | openrouter |
claude-3.7-sonnet |
trading | 12.0k | 1.84 CAD |
| local | ollama |
qwen3.5:4b |
summarise | 4.2k | 0.00 CAD |
| Total · today | 184.6k | 1.84 CAD | |||
If the same 184.6k tokens had run entirely on the metered API lane, the workload would have cost
28.34 CAD.
Sub-backed routing kept it at 1.84 CAD. The delta is the value of Heiwa.
OAuth lanes have rate windows, not bills. Claude Max sits at 47% of its 5-hour window with 47 minutes to reset. When a window pinches, Heiwa escalates to API only with your approval.
04 · Operator Flow
INSTALL · CONNECT · RUNOne-line installer or tagged GitHub Release. Runtime lands at ~/.heiwa/.
curl -fsSL https://heiwa.ltd/install | sh
Authorise provider CLIs, add API keys, discover local runtimes. Heiwa normalises the lanes.
heiwa auth
Use the REPL or open the local app with heiwa app. Receipts written to local evidence + STDB.
heiwa doctor
05 · Public Backbone
CLOUDFLARE · GITHUB · SPACETIMEDBStatic shell for heiwa.ltd — install path, docs front, identity exchange. Zero operator work runs here.
Source of truth for the repo, tagged Releases for binaries, Actions for build, Pages for docs.heiwa.ltd.
WASM-reducer adjudication plane. Receipts, leases, and licence state mirror here when the runtime is online.
backend authoritySee docs.heiwa.ltd/publishing for the full pipeline.
06 · Doctrine
NON-NEGOTIABLESSmallest sufficient model. Shortest sufficient context. Richest sufficient evidence. The runtime runs where the operator runs.
No completeness theatre. Where a lane is partial, the surface says so. Maturity is described, never implied.
"Rust proposes, SpacetimeDB adjudicates, heiwa presents."
07 · Shop Window Only
heiwa.ltd DELIVERS SOFTWARE
The public site ships software. Your machine runs Heiwa.
The public surface exists for install, docs, release delivery, and identity exchange. Operator work, memory, sessions, and provider secrets stay with the runtime you host.
| Surface | Role |
|---|---|
heiwa.ltd | install, marketing, identity exchange |
docs.heiwa.ltd | doctrine, runbooks, references |
~/.heiwa/app/Heiwa.app | installed user input/display |
status.heiwa.ltd | read-only WebSocket health |