Libraries
QVAC
Upstream local model SDK and inference engines.
Verified 19 October 2026
Add streaming chat or a shopping assistant that answers questions about your app's catalog.
Status in Unstoppable Stack
This project integrates selected text-generation workflows. QVAC's broader upstream capabilities are not all implemented or validated here. Keep native inference in the worker.
How it works
QVAC loads a model and performs inference on the device running the SDK. Your application supplies prompts and decides which actions a model may request.
The Node example uses the SDK's event stream. It downloads a model on first use, prints generated text and unloads the model while retaining its cached files.
Desktop scaffolds use a worker adapter and private lifecycle helpers. The renderer should call the worker rather than import native inference packages.
Run an example
Before you run
Native example: model and platform requirements apply. This documentation change does not revalidate real inference. For the desktop UI path, use the Local AI guide.
Use Node 22.17+ and npm for installation. Start in a new directory for this example so its ./data storage cannot collide with another example. Save each file below with the exact filename shown, then run the commands in order.
mkdir qvac-demo
cd qvac-demo
npm init -y
npm install @qvac/sdk@'0.21.0'Save as example.mjs:
import { loadModel, completion, unloadModel, QWEN3_600M_INST_Q4 } from '@qvac/sdk'
let modelId
try {
modelId = await loadModel({ modelSrc: QWEN3_600M_INST_Q4 })
const run = completion({
modelId,
history: [{ role: 'user', content: 'Explain local-first apps in one sentence.' }],
stream: true
})
for await (const event of run.events) {
if (event.type === 'contentDelta') process.stdout.write(event.text)
}
await run.final
console.log()
} finally {
if (modelId !== undefined) await unloadModel({ modelId, clearStorage: false })
}
Run from this example directory:
node example.mjsExpected result
A generated sentence about local-first apps. Text varies by model; the first run downloads model files.
Example verification
Setup and API instructions were reviewed against the repository and upstream references. This docs update did not rerun the desktop/mobile native build or real-model acceptance flow.
API essentials
- loadModel({ modelSrc }): prepare a model and obtain its identifier.
- completion({ modelId, history, stream }): start generation; consume events for incremental content and await final for completion.
- unloadModel({ modelId, clearStorage: false }): release the model while preserving downloaded files.
Troubleshooting and limits
- A first run needs model-download connectivity, disk space and compatible hardware. No universal memory requirement is implied.
- Check the installed SDK version before copying upstream snippets; this example uses the repository's Node SDK profile.
- Mock output does not establish native inference, cancellation or cached offline startup. Validate those independently on your target.