Native architecture
Process boundaries
Section titled “Process boundaries”React renderer (sandbox, context isolation, no Node) │ typed window.reges calls + correlated eventsNarrow preload bridge │ validated IPC from the owned main frameElectron main broker ├─ native file dialogs → bounded GGUF inspector ├─ hardware snapshot → memory admission ├─ local settings/conversation store └─ runtime controller ├─ private Lemonade adapter → qualified llama.cpp backend └─ experimental Strata adapter → private JSONL helper → native engineThe renderer draws state and accepts user intent. Main owns paths, native dialogs, network credentials and child processes. A model response is untrusted text; it cannot turn into shell execution or grant a tool permission.
Source map
Section titled “Source map”| Source | Responsibility |
|---|---|
desktop/src/shared/contracts.ts |
Typed snapshots, options, results and events |
desktop/src/main/main.ts |
IPC validation, serialization, lifecycle and exports |
desktop/src/main/artifacts.ts |
GGUF inspection and coarse fit planning |
desktop/src/main/hardware.ts |
Captured host/GPU availability |
desktop/src/main/runtime.ts |
Owned private Lemonade runtime and streaming adapter |
desktop/src/main/runtime-controller.ts |
Explicit engine dispatch and ownership across both adapters |
desktop/src/main/strata-runtime.ts / strata-config.ts |
Experimental private Strata protocol, exact artifact guard and memory admission |
desktop/native/ |
Private tokenizer/template and token-stream helper |
desktop/src/main/store.ts |
Local atomic JSON persistence |
desktop/src/renderer/ |
Functional native interface and optional presentation |
The Strata adapter completed installed functional qualification for the exact reference profile; the controller dispatches to one explicit model engine and does not silently substitute one on failure. Lemonade remains the fresh/legacy default.
The public REST API proposed elsewhere is not this bridge. The current preload is an internal desktop boundary, not a supported general-purpose SDK for arbitrary web pages.
State and concurrency
Section titled “State and concurrency”Runtime phases distinguish stopped, starting, ready, installing, loading, loaded, generating and error. The host serializes mutating actions and tracks one active generation. Request IDs correlate chunks and cancellation. Completion must settle owned work before a conflicting operation is accepted.
Settings and conversations use atomic replacement in a per-user profile. Models remain in their selected locations. A future durable agent system needs a richer run store, recovery model and permissions; it should not be represented by adding imaginary tool events to the current chat stream.
Packaging and presentation
Section titled “Packaging and presentation”The Windows shell packages compiled code in ASAR and verified runtime resources beside it. ASAR is packaging, not encryption or a security boundary. Native security depends on the sandbox, isolated preload, validation and ownership rules.
The startup and About nebula are disposable presentation components. Chat must not retain their WebGL contexts or animation loops. This keeps decorative work separate from inference; it does not by itself make the inference engine faster.