A fine-tuned decision model that turns a spoken or typed home command ("turn off the kitchen lights") into a device action. Instead of generating text, it answers a multiple-choice question (which action, which room, which door) with a calibrated probability for each option, in a single forward pass. So it can't produce a malformed command, and the hub can ask you to repeat when it isn't sure.
421M parameters (ModernBERT-large encoder, 395M, plus the Laya decision head). In Gantry it answers English requests; Korean requests go to the bilingual model, nohaah/laya-home-fine-tune-kr.
Part of Gantry, a fully offline voice assistant for the home that runs on a Raspberry Pi (source: github.com/noahhps/gantry).
| File | What it is |
|---|---|
laya-home.int8.onnx |
int8 ONNX export: what Gantry runs (598 MB) |
model.safetensors |
PyTorch weights, fp16 (843 MB) |
rl_agent_config.json, encoder/config.json, tokenizer/ |
Model configuration and tokenizer |
questions.json |
The question format it was trained on |
train_report.json |
Training settings and held-out results before and after fine-tuning |
SHA256SUMS |
Checksums for every file |
training/generate_data.py: 5,751 training questions after splitting each command into its action, room and door questions. The data covers varied home layouts, follow-ups, and requests that aren't device commands. Published as nohaah/laya-home-fine-tune-en-training-set.rlcd loss, on an Apple M1 Pro (MPS).The model answers one multiple-choice question at a time and returns a calibrated probability for every option. It is loaded with the laya library from convaiinnovations/laya.
from huggingface_hub import snapshot_download
from laya.onnx_agent import ONNXAgent
snapshot_download("nohaah/laya-home-fine-tune-en", local_dir="gantry-laya-en")
agent = ONNXAgent("gantry-laya-en", onnx_path="gantry-laya-en/laya-home.int8.onnx")
answer = agent.predict(
'Latest request: "turn off the kitchen lights"',
{"action": {"type": "choice", "instructions": "Which action?",
"criteria": ["turn_on_lights", "turn_off_lights", "set_temperature", "raise_temperature",
"lower_temperature", "open_garage", "close_garage", "lock_door", "unlock_door", "none"]}},
)["answers"]["action"]
print(answer["choice"], answer["probabilities"])
The PyTorch weights (model.safetensors) load with laya.load("gantry-laya-en").
The input describes the request, and for follow-ups the earlier commands, exactly as Gantry's hub writes it:
Earlier requests, oldest first:
- "turn on the kitchen lights" -> turn_on_lights {"room":"kitchen"}
Latest request: "turn them off"
It was trained on three short questions with bare option ids:
| Question | Options |
|---|---|
Which action? |
turn_on_lights, turn_off_lights, set_temperature, raise_temperature, lower_temperature, open_garage, close_garage, lock_door, unlock_door, none |
Which room? |
all plus the home's rooms (English ids such as kitchen, living room) |
Which door? |
the home's doors (English ids such as front, back) |
In Gantry, services/laya_server.py serves this folder to the hub: python services/laya_server.py --checkpoint gantry-laya-en --onnx gantry-laya-en/laya-home.int8.onnx.
| Measure (held-out phrasings never seen in training) | Result |
|---|---|
| All questions (action, room, door), fp16, before → after fine-tuning | 87.8% → 97.9% correct (189 questions) |
| Calibration error (ECE), before → after | 0.184 → 0.081 |
| Action question, int8 ONNX as deployed | 95.2% correct (126 requests) |
| Speed, int8, Raspberry Pi 4, 4 threads | ~1.1 s per question |
| Speed, int8, Apple M1 Pro, 4 threads | ~68 ms per question |
Single held-out requests with 0–3 unrelated earlier commands added in front, int8 ONNX, Apple M1 Pro, 4 threads:
| Language | Earlier commands in input | Tokens | Correct action | Time per question |
|---|---|---|---|---|
| English | 0 | 14 | 96.9% | 68 ms |
| English | 1 | 43 | 86.5% | 93 ms |
| English | 2 | 60 | 88.5% | 108 ms |
| English | 3 | 82 | 83.3% | 129 ms |
training/generate_data.py), not recorded from people. Accuracy on real speech, through a speech-to-text model, will be lower.Apache-2.0, the same license as the base model convaiinnovations/laya and its encoder answerdotai/ModernBERT-large. See LICENSE and NOTICE.
model.safetensors 843 MBlaya-home.int8.onnx 598 MBconvaiinnovations/laya