examples/electron/RunAnywhereAI/README.md
The shipping desktop app built on @runanywhere/electron. Everything runs
on-device — chat, reasoning, your own knowledge base (RAG), voice, and vision.
No prompt, document, or audio leaves the machine.
This is the app we package and publish; examples/electron/RunAnywhereAI remains
the SDK's example/demo.
Double-click the RunAnywhere AI desktop shortcut, or:
"examples\electron\RunAnywhereAI\RunAnywhere AI.cmd"
"examples\electron\RunAnywhereAI\RunAnywhere AI (GPU).cmd"
or from a terminal:
cd examples/electron/RunAnywhereAI
npm start :: CPU
npm run start:gpu :: CUDA
Prerequisites: the SDK must be built (cd sdk/runanywhere-electron && npm install && npm run build)
and a native prebuild present under sdk/runanywhere-electron/prebuilds/.
If the window never appears, check that
ELECTRON_RUN_AS_NODEisn't set — it makeselectron.exerun as plain Node. The.cmdlauncher clears it.
| File | Purpose |
|---|---|
main.js | Electron main: forks the utility host (native addon), owns the window + local JSON store |
preload.js | Loads the SDK preload (window.runanywhere) and exposes window.appStore |
renderer.js / index.html | The UI — Chat, Models, Settings, Structured, Tools, Vision, Embeddings, Knowledge, Voice, VAD |
assets/make-icon.js | Regenerates assets/icon.ico + icon.png (zero deps) — npm run icon |
Conversations, settings, and custom models persist as JSON under
%APPDATA%\RunAnywhere AI\.
CPU by default. The CUDA prebuild is used only when explicitly requested
(--gpu / RA_GPU=1) and present — loading it without an NVIDIA driver stack
fails, so it is never the silent default. The active device is shown in the header.
Runs the real code paths headlessly and exits 0/1:
set RA_SELFTEST=1 && npx electron .
Publishing to the Microsoft Store goes through a Win32 NSIS installer built with
electron-builder. When that lands, the native .node and its sidecar DLLs must be
asarUnpacked — native modules cannot be loaded from inside app.asar.