QVAC
Recipe5 min read

Built With QVAC: Local AI In Arduino App Lab

A custom Brick for Arduino App Lab, built on the QVAC SDK, lets an App's Python code ask a local language model a question with no API key. The example code is open source and ready to adapt.

Thomas Blanc
Built With QVAC: Local AI In Arduino App Lab

A custom Brick for Arduino App Lab packages the QVAC SDK, an open-source toolkit for running AI models on your own hardware. Bricks are the reusable building blocks Arduino Apps are made of, and this one lets an App's Python code ask a local language model a question, with no API key and no cloud AI service. The code is in qvac-examples.

Arduino And App Lab

Arduino puts its community at more than 33 million people, and plenty of them wrote their first program to blink an LED on one of its boards. Arduino also shows its boards at events such as Maker Faire Rome and ROSCon, and hosts Arduino Days, a free online event.

App Lab is the tool Arduino makes for building Apps on the UNO Q and the VENTUNO Q. The UNO Q pairs a quad-core Arm processor running Debian Linux with an STM32 microcontroller for real-time control, and has 2 GB or 4 GB of memory. Each Brick packages a feature, such as a machine learning model or a web interface, that an App uses through a few lines of Python. A custom Brick can run any service in a Docker container.

Arduino App Ideas

On the UNO Q the microcontroller handles real-time control, such as reading sensors, and the Linux side runs the App. The QVAC SDK publishes Linux on Arm builds of its engines, from language models to speech and vision. With those engines inside a Brick like this one, you could build:

  • A sensor station that explains its readings in plain words and says what to check next.
  • A project you talk to, where speech recognition writes down your command and the App sends the action to the microcontroller.
  • A device that speaks a status or a warning out loud with text to speech.
  • A camera project that reads a label or a sign and translates it into your language.
  • A robot arm that follows an instruction in plain language, with QVAC's vision-language-action engine turning what its camera sees into movements.

The Greenhouse Demo

The demo is a greenhouse version of the first idea. You pick a sample reading such as "Hot afternoon", and Qwen3 1.7B tells you in simple words whether the air is too hot or too dry and what to check. In the video it runs on a computer and answers in under four seconds. Community member EmmanuelHaggai also ran it on a 4 GB UNO Q with a real temperature and humidity sensor, where each answer took about a minute on the board's CPU.

Inside The Brick

The Brick has two halves: a short Python class in the App, and a Node.js service in a Docker container that runs the QVAC SDK. The service loads the model once with loadModel and answers each request with completion, and a JSON schema keeps every reply to the same two fields, explanation and next_step. After setup, the App asks the model with one method call:

from qvac import QVAC

qvac = QVAC()
qvac.wait_ready()
answer = qvac.explain_reading(34, 25)  # 34°C, 25% humidity
print(answer["explanation"])
print(answer["next_step"])

App Lab builds the Brick's container and starts it with the App. The Brick has run in Arduino's App Lab runtime on a Linux Arm virtual machine and on EmmanuelHaggai's UNO Q. On the board, the QVAC service used about 1.6 GB of memory and kept answering with Wi-Fi turned off.

Your Own App

To reuse the Brick, copy the app/bricks/qvac folder into your App and send a prompt to its complete() method instead of explain_reading(). Its system prompt, in app/bricks/qvac/runtime/server.mjs, is written for greenhouse readings, so rewrite it for what your App measures, such as soil moisture or the CO2 level in a classroom.

Without a board, you can run the demo on a laptop with Node.js 22 or newer, and the laptop version has been tested on an Apple Silicon Mac. Its first run downloads a model of about 1 GB.

git clone https://github.com/tetherto/qvac-examples
cd qvac-examples/qvac-arduino-brick-demo
npm run setup
npm start

Open http://127.0.0.1:8765 when the terminal says QVAC ready. To run it in App Lab, connect a supported board and import the example's app folder as a ZIP, following the App Lab guide in the example. If you build an Arduino App with QVAC, tag @qvac on X.

FAQ

You do not need one to run the demo on a laptop. Importing it into the App Lab desktop app needs a supported board, such as a UNO Q. App Lab's runtime has also run the Brick in a Linux Arm virtual machine, with no board attached.

About This Example

This demo is an illustrative example, provided "as is", to show what you can build with the QVAC SDK. It is neither a QVAC product nor an official Arduino integration, and its targets are examples, not growing advice for any crop. The Arduino name belongs to its rights holder. You are responsible for what you build with it, including ensuring it complies with applicable laws and is appropriately safeguarded. The SDK documentation is at docs.qvac.tether.io.

Share

Latest articles

View all articles

Stay updated

Never miss a release

New versions, breaking changes and migration notes - straight to your inbox. No spam, unsubscribe anytime.