A home assistant that decides before it writes. Every request first goes through Laya, a small decision model from Tether's QVAC SDK 0.23, which picks a route in about a quarter of a second on a desktop CPU:
| Route | What happens | LLM call |
|---|---|---|
| action | Runs a home command (lights, heating, garage, door, vacuum, reminders) | none |
| document | Searches the user's documents on the same server and answers with the source | local |
| search | Asks the user before anything leaves the house, then searches once | local |
| chat | Answered by the local LLM | local |
| unsure | Below the confidence threshold, BotPsy-0.8B (Tether's tool-calling model, on the same qvac serve) picks the route instead, in about a second. A web search still asks permission first, and a close document passage still wins over search or chat. Without BotPsy, a likely search asks permission, a likely document question searches the local files, anything else goes to the local LLM and nothing is switched | local |
Everything runs on one home server. The phone only opens a web page.
This is a personal demo, not affiliated with Tether. The home is simulated and the documents are fictional samples.
On a home server, the LLM is the slow part: Qwen3 4B on an i7-10700K takes about 0.35 s before its first word, larger models more. Many requests do not need it at all ("dim the kitchen lights"), and some should never leave the house. A decision model answers "what kind of request is this?" in 150–250 ms and returns a probability for each answer, so the app can act fast when it is sure and fall back to the LLM when it is not.
The router settings come from a benchmark of three Laya models and three phrasings on 40 labelled requests (qvac-lab, laya-bench.js): Laya typed decisions 421M with detailed criteria got 34/40 right, and every wrong answer had a confidence of 45% or less. With a 0.45 threshold, about half the requests are routed immediately with no errors; the rest go to the LLM.
Measured on the router itself (npm run eval, i7-10700K, CPU only):
| Metric | Result |
|---|---|
| Correct intent | 34/40 |
| Routed directly | 20/40, 0 wrong |
| Sent to the LLM (confidence below 0.45) | 20/40 |
| Average decision time | 243 ms |
| A home command, question to state change | ~373 ms, no LLM call |
Laya is fast and honest about its confidence, but it was tuned on English: on the same 40 requests in Italian it got 19/40 right and was sure of only 5. BotPsy-0.8B with thinking got 34/40 in Italian and 38/40 in English, at about 1 s per request on an RTX 3060 against Laya's 0.25 s on the CPU (qvac-lab, MEASUREMENTS.md section 11). So Laya decides when it is sure, and BotPsy decides the rest.
Only BotPsy's route and device are used. The operation is still read from the user's words (server/home.js), because BotPsy returned on for "Spegni le luci" in Italian, and a request that names the garage always targets the garage door (it once returned door, which would have unlocked the front door). Its usual mistake is sending a question about the user's own files, or a plain question, to web search; that only costs a permission prompt, and a close document passage is checked first.
BotPsy needs an alias in the qvac serve config, for example:
"botpsy": { "type": "llamacpp-completion", "src": "/path/to/botpsy-0.8b-q8_0.gguf", "preload": true,
"config": { "device": "gpu", "ctx_size": 8192, "tools": true } }If the alias is missing, slow or failing, the router logs it and falls back to Laya's unsure path.
Phone (browser, over Tailscale)
│ HTTPS
▼
home-router (Node, this repo) ── on the home server ──────────────────────────
├─ Laya typed decisions 421M decide(): intent + confidence, then the device for commands
├─ EmbeddingGemma 300M embeds the documents at startup and each question
├─ simulated home state shown in the app
└─ qvac serve (already running) OpenAI-compatible API: Qwen3 4B streams the answers,
BotPsy-0.8B routes the requests Laya is unsure about
server/intents.js: the questions Laya answers (intent, then device).server/router.js: the routing rules and the permission step for web search.server/second.js: the second router (BotPsy through qvac serve: one tool per route, no tool means chat).server/docs.js: passage splitting, embeddings and cosine search overdocs/.server/llm.js: streaming client for the OpenAI-compatible endpoint, strips<think>blocks.server/home.js: the simulated home; this is where a real setup would call Home Assistant.web/: the React app (Vite).web/dist/is the built version served by the router.scripts/route-eval.js: checks the router on the 40 labelled requests (scripts/cases-it.jsonhas them in Italian), Laya alone and with the second router.
POST /api/voice takes a recorded question (16 kHz mono WAV) and returns the spoken answer:
- Whisper small (QVAC SDK) turns speech into text. Each device says which language it speaks (
/api/voice?lang=itorfr): Whisper's own language detection proved unreliable on short phrases such as "che ore sono", so one Whisper instance is loaded per language. - The router above decides what to do, exactly as for typed requests.
- Supertonic 3 (QVAC SDK) reads the answer aloud in the language of the question. Italian and French are loaded by default (
VOICE_LANGS=it,fr).
POST /api/voice/stream does the same but speaks while the LLM is still writing: each sentence goes to Supertonic as soon as it is complete, and the reply arrives as NDJSON lines (transcript, one WAV per sentence, then done with the timings). The satellite uses it by default (--no-stream waits for the whole reply).
Home commands get a short spoken confirmation without any LLM call. Time and date questions ("che ore sono a New York?", "quel jour sommes-nous ?") are answered from the server clock (server/clock.js, home zone TZ_NAME, default Europe/Zurich): a 4B model took about 2.5 s for them and got time zones wrong. Weather, news, prices and scores (server/live.js) go straight to the web-search permission step: without it, the local LLM answered "che tempo fa domani a Ginevra?" with an invented forecast. A web search is still never done silently: the assistant asks out loud, and the next phrase ("sì", "oui", "yes" or "no") answers.
satellite/jarvis_satellite.py turns any computer with a microphone and speakers into a room device. It listens for the wake word "Hey Jarvis" locally with openWakeWord, records until you stop talking, sends that recording only, and plays the reply:
cd satellite
pip install -r requirements.txt
python jarvis_satellite.py --server https://<server>.<tailnet>.ts.net:8443 --lang itVoice settings: STT_MODEL (registry constant or a local Whisper file, default WHISPER_SMALL_Q8_0), STT_LANG (per-device, or auto to let Whisper guess), STT_GPU (1 runs Whisper on the graphics card), STT_THREADS (8), VOICE_LANGS (it,fr), VOICE_IT / VOICE_FR / VOICE_EN (Supertonic voice and speed, e.g. M1:1.2), VOICE=0 to turn voice off.
Requirements: Node ^22.21.0 || >=24.9.0, a running qvac serve --openai with a Qwen3 4B model (named qwen4b here), about 1–1.5 GB of free RAM for Laya and the embedding model.
npm install # installs @qvac/sdk 0.23
npm run eval # first run downloads Laya and EmbeddingGemma from the QVAC registry
npm start # http://127.0.0.1:8090To open it from a phone over Tailscale, publish the port inside the tailnet only:
sudo tailscale serve --bg --https=8443 http://127.0.0.1:8090
# then open https://<server>.<tailnet>.ts.net:8443 on the phoneSearXNG is an open-source metasearch engine you host yourself: it queries several engines and returns JSON, with no API key. Run it with Docker on any machine of the home network:
mkdir -p ~/searxng
docker run -d --name searxng --restart unless-stopped -p 8888:8080 -v ~/searxng:/etc/searxng searxng/searxng
# wait a few seconds, then enable JSON output and restart
sed -i 's/^ formats:$/ formats:\n - json/' ~/searxng/settings.yml
docker restart searxng
curl -s 'http://127.0.0.1:8888/search?q=geneva+weather&format=json' | head -c 300Then start the router with SEARCH=searxng SEARXNG_URL=http://<that-machine>:8888 npm start. Only the question is sent to the search engines, and only after the user allows it.
Try it without any model (keyword rules and fake answers stand in for Laya and the LLM):
npm run mockRebuild the web app after changing it: npm run web:build.
| Variable | Default | Meaning |
|---|---|---|
THRESHOLD |
0.45 |
Minimum confidence to act on a route |
ONE_CALL |
0 |
1 asks intent and device in one decide() call; measured at the same ~373 ms per command as two calls |
ROUTER_MODEL |
LAYA_TYPED_DECISIONS_421M_Q8_0 |
Laya checkpoint |
EMBED_MODEL |
EMBEDDINGGEMMA_300M_Q8_0 |
Embedding model for documents |
ROUTER_FALLBACK_SRC / EMBED_FALLBACK_SRC |
none | Local file or HTTP URL the SDK loads from when the QVAC registry is unreachable (checked against the model checksum). Each model load is also retried up to 3 times |
LLM_URL |
http://127.0.0.1:11434/v1 |
OpenAI-compatible endpoint |
LLM_MODEL |
qwen4b |
Model name on that endpoint |
LLM_KEY / LLM_KEY_FILE |
~/qvac-lab/api-key.txt |
API key for the endpoint |
AUDIO_URL |
none | e.g. http://127.0.0.1:11434/v1: transcribe and speak through qvac serve's OpenAI-compatible audio endpoints (same key as the LLM) instead of loading Whisper and Supertonic in the router. The models are shared with qvac serve, which frees their VRAM (~1.4 GB), but both services then depend on qvac serve; STT_MODEL, STT_GPU, TTS_MODEL and VOICE_IT/VOICE_FR/VOICE_EN are then set in the qvac serve config instead |
STT_ALIAS |
whisper-{lang} |
With AUDIO_URL: qvac serve alias of the transcription model; {lang} is the device language |
TTS_VOICE |
{lang} |
With AUDIO_URL: voice sent to /audio/speech, mapped to a tts-* alias by serve.openai.audio.speech.voices |
SEARCH |
mock |
mock (labelled placeholder), searxng (self-hosted SearXNG) or ddg (DuckDuckGo Instant Answer API, facts only) |
SEARXNG_URL |
http://127.0.0.1:8888 |
SearXNG instance used when SEARCH=searxng |
DOCS_DIR |
./docs |
Folder of Markdown documents |
SECOND_ROUTER |
1 (0 in MOCK mode) |
0: no second router; unsure requests go to the LLM and nothing is switched |
SECOND_MODEL |
botpsy |
qvac serve alias of the tool-calling model used when Laya is unsure |
SECOND_THINK |
1 |
0 turns BotPsy's thinking off: about 0.5 s instead of 1 s, but 25/40 instead of 34/40 in Italian |
SECOND_TIMEOUT_MS |
8000 |
After this, Laya's unsure path is used |
DOC_SCORE |
0.5 |
When Laya is unsure, a document passage at least this similar (cosine) is used to answer; the [router] log line prints the best match |
PORT / HOST |
8090 / 127.0.0.1 |
Where the router listens |
deploy/home-router.service is a systemd user unit with the settings above. Check the node path in it (nvm puts the
version in the path), then:
cp deploy/home-router.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now home-router
sudo loginctl enable-linger "$USER" # keep user services running without a login session
journalctl --user -u home-router -f # follow the logs- The routers were measured on 40 hand-written requests, in English and Italian, one run each: an indication, not a guarantee. French is not measured.
- With the second router, an unsure command is acted on (BotPsy got every command's device right in both languages, after the garage check); set
SECOND_ROUTER=0to keep the old rule that nothing is switched below the threshold. - Thresholds depend on the Laya checkpoint: the multilingual 322M was often confidently wrong in the benchmark, so it needs a different strategy.
- The home is simulated. Web search is a placeholder unless
SEARCH=searxngorSEARCH=ddg; live data such as train delays depends on what the search engines return. - Single user, no authentication: publish it only inside a private network such as a tailnet.
MIT