Skip to content

Build

Local AI

Add on-device inference after the base application works.

Content reviewed 25 September 2026

QVAC-backed inference is optional in the preview. A local model avoids sending prompts to a hosted inference provider, but it still requires compatible hardware, disk space, and an initial model download.

What you can add

Create a desktop app with local AI

With the published CLI beta installed and inside your initialized workspace, generate a new app with the local-ai feature. This creates the integration code; a model still needs to download and load on compatible hardware.

bash
us scaffold app -p pear-desktop -n local-assistant -f local-ai
cd local-assistant
npm install
npm run dev

Expected result: a desktop app with an AI integration path. Verify model loading, a streamed response, Stop, another request after cancellation, and cached startup without external networking. Mock responses only verify the UI and protocol.

Separate UI checks from native inference

On macOS/Linux, close the app and run this from local-assistant to exercise the visibly labelled mock response. Stop a response, then send another message. This checks wiring and the session flow without claiming that a model loaded.

bash
QVAC_MOCK=1 npm run dev

Close mock mode, start again with npm run dev, and use the AI load control for a real model. Verify streamed output, Stop and a subsequent request. After a successful download, close and reopen with external networking unavailable to check cached offline loading. Record your OS, architecture and model; a successful mock run cannot substitute for these results.

Who owns what

QVAC owns inference. Private runtime helpers copied into .unstoppable/runtime-ai/ manage loading, bounded history, cancellation and cleanup. Your app owns prompts, tool schemas, conversation UI and domain actions. Renderer code talks to the worker through IPC.

Integration checklist

  • Keep model initialization in the worker, never the renderer.
  • Report download, loading, ready, and error states separately.
  • Use mock inference for deterministic UI and protocol tests; label it as mock.
  • After a successful model install, test local inference without internet access.
  • Do not publish a universal RAM or download-size claim until the chosen model is pinned and measured.

Go deeper

The upstream QVAC ecosystem includes capabilities beyond this project's text-generation integration. An upstream feature listing does not mean the scaffold implements it. Use the dependency versions recorded by your app and check API compatibility before adopting upstream examples.

Need help? Report an issue with your CLI version, platform, command and first relevant error.