QVAC
Intermediate

NL to SQL

30 min · Desktop

Ask your database in plain English, fully on-device

Turn plain-English questions into read-only SQL against your own database, with a local model that never lets your row data leave the machine.

quick-start.sh
git clone https://github.com/tetherto/qvac-examples
cd qvac-examples/qvac-natural-language-to-sql
npm install
npm start

QVAC Natural Language to SQL is an illustrative example that turns plain-English questions into SQL queries using a local Qwen3 4B model. It reads only your database schema - never your row data - to build each query, and enforces read-only execution so a generated query can't modify anything. No API keys, no cloud service, no per-token cost.

Prerequisites

  • Node.js 22.17 or later

  • GPU recommended (NVIDIA/AMD/Intel via Vulkan, Apple Silicon via Metal) - CPU works too

  • 16 GB RAM comfortable, 8 GB workable with the smaller 1.7B model

  • ~3 GB disk for the cached model

  • A database to point it at (schema access only)

Run the diagnostic tool to see which model size fits your hardware.

doctor.sh
npx -y @qvac/cli doctor

Clone qvac-examples and install the natural-language-to-sql demo. Alternatively, start fresh in your own project with npm install @qvac/sdk.

setup.sh
git clone https://github.com/tetherto/qvac-examples
cd qvac-examples/qvac-natural-language-to-sql
npm install

Final result

  • Database schema read locally, row data never touched during query generation

  • Plain-English question converted to SQL by an on-device Qwen3 model

  • Generated query enforced as read-only before execution

  • No API keys, cloud calls, or per-token billing involved

This is an illustrative example, not a production QVAC product, provided "as is" - you're responsible for ensuring compliance with applicable laws and for reviewing generated queries before running them against real data. Fork it from github.com/tetherto/qvac-examples and adapt it to your own schema or model size.

Build this

Build this with the QVAC SDK

Everything here runs on-device. Grab the SDK and ship your own version.

npm install @qvac/sdk