Install the QVAC SDK, run a language model on your own machine, then read text from an image. No API key, no account.
In fifteen minutes you will run two models on your own machine: a small language model that answers a question, and an OCR model that reads an image.
Nothing you send leaves the computer, and there is no key to paste.This is the smallest possible QVAC program.
Every project on this site grows from the same four calls: loadModel, an inference call, unloadModel, and close.
import { loadModel, completion, unloadModel, close, LLAMA_3_2_1B_INST_Q4_0,} from "@qvac/sdk";let modelId;try { // Downloads the model on the first run, then loads it into memory. modelId = await loadModel({ modelSrc: LLAMA_3_2_1B_INST_Q4_0, modelType: "llm", }); const run = completion({ modelId, history: [{ role: "user", content: "In one sentence, why run AI locally?" }], stream: true, }); for await (const token of run.tokenStream) process.stdout.write(token); const stats = await run.stats; console.log(`\n\n${stats?.tokensPerSecond?.toFixed(1)} tokens/s on ${stats?.backendDevice}`);} finally { if (modelId) await unloadModel({ modelId }); await close();}
Run it twice:
node chat.mjsnode chat.mjs
The first run downloads the model, so it is slow.
The second reuses the cached file and starts much faster.
That difference is the lifecycle from AI is not one box: downloaded is not loaded.
Turn off Wi-Fi and run it a third time.
It still answers.
Each block carries the recognised text, where it sits in the image, and a confidence score.
Compare a few of them with the image.
Some will be imperfect, and that is the point: model output is evidence, and your application decides what to do with it.