HEIWA RUNTIME · LOCAL-FIRST

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.

Canonical install path curl -fsSL https://heiwa.ltd/install | sh

01 · Why Heiwa

NOT A HOSTED ROUTER · A LOCAL OPERATING LAYER
HOSTED GATEWAY

Centralises 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.

HEIWA · LOCAL

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 · LOCAL

Local

PRIVATE · CHEAP

Ollama and machine-owned models. Inference stays on the operator machine. Default for sovereign work.

recommended

OAuth CLI

SUB-BACKED

Claude Max, ChatGPT Plus, Google AI Pro — reuse subscriptions you already pay for through provider-owned CLIs.

no extra spend

API Key

METERED

OpenAI, Anthropic, Google, OpenRouter, and more. Brought into the same runtime when remote APIs are the right escalation path.

metered · $CAD

03 · Cost Attribution

ENV · PROVIDER · MODEL · AGENT

Every 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
COUNTERFACTUAL

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.

HEADROOM · NOT JUST COST

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 · RUN
Step 01INSTALL
Step 02CONNECT
Step 03VERIFY
Step 04RUN
Step 05RECEIPT
1 · INSTALL

One-line installer or tagged GitHub Release. Runtime lands at ~/.heiwa/.

curl -fsSL https://heiwa.ltd/install | sh
2 · CONNECT

Authorise provider CLIs, add API keys, discover local runtimes. Heiwa normalises the lanes.

heiwa auth
3 · RUN

Use the REPL or open the local app with heiwa app. Receipts written to local evidence + STDB.

heiwa doctor

05 · Public Backbone

CLOUDFLARE · GITHUB · SPACETIMEDB
CLOUDFLARE PAGES

Static shell for heiwa.ltd — install path, docs front, identity exchange. Zero operator work runs here.

edge static
GITHUB

Source of truth for the repo, tagged Releases for binaries, Actions for build, Pages for docs.heiwa.ltd.

authoritative
SPACETIMEDB

WASM-reducer adjudication plane. Receipts, leases, and licence state mirror here when the runtime is online.

backend authority

See docs.heiwa.ltd/publishing for the full pipeline.

06 · Doctrine

NON-NEGOTIABLES
LOCAL-FIRST

Smallest sufficient model. Shortest sufficient context. Richest sufficient evidence. The runtime runs where the operator runs.

HONEST MATURITY

No completeness theatre. Where a lane is partial, the surface says so. Maturity is described, never implied.

COMPRESSION

"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.

PUBLIC SURFACE · SCOPE
SurfaceRole
heiwa.ltdinstall, marketing, identity exchange
docs.heiwa.ltddoctrine, runbooks, references
~/.heiwa/app/Heiwa.appinstalled user input/display
status.heiwa.ltdread-only WebSocket health

Heiwa · Instrument-Grade · v1.0 · source · support

Local-first · Centre of operator control · Built in Toronto