English · 한국어
A fine-tuned decision model that turns a spoken or typed home command, in English or Korean ("주방 불 켜줘", "turn on 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.
322M parameters (mmBERT-base encoder, 307M, plus the Laya decision head). In Gantry it answers requests containing Hangul; English requests go to the English model, nohaah/laya-home-fine-tune-en, which scores higher on English.
Option ids stay in English (kitchen, front); only the requests are Korean. Gantry's hub maps Korean room and door names (주방/부엌 → kitchen, 현관문 → front) with the same table used in training (src/korean.cpp, training/korean.py).
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-ko.int8.onnx |
int8 ONNX export: what Gantry runs (925 MB) |
model.safetensors |
PyTorch weights, fp16 (644 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 and training/korean.py: 9,897 training questions after splitting each command into its action, room and door questions. The data covers varied home layouts, follow-ups, requests that aren't device commands, and common Korean speech-to-text slips. Published as nohaah/laya-home-fine-tune-ko-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-kr", local_dir="gantry-laya-en-ko")
agent = ONNXAgent("gantry-laya-en-ko", onnx_path="gantry-laya-en-ko/laya-home-ko.int8.onnx")
answer = agent.predict(
'Latest request: "주방 불 켜줘"',
{"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-ko").
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-ko --onnx gantry-laya-en-ko/laya-home-ko.int8.onnx.
| Measure (held-out phrasings never seen in training) | Result |
|---|---|
| All questions (action, room, door), English and Korean, fp16, before → after fine-tuning | 59.1% → 94.2% correct (291 questions) |
| Calibration error (ECE), before → after | 0.271 → 0.055 |
| Action question, Korean, int8 ONNX as deployed | 95.5% correct (66 requests) |
| Action question, English, int8 ONNX | 88.1% correct (126 requests) |
| Speed, int8, Apple M1 Pro, 4 threads | ~33 ms per question |
| Speed, int8, Apple M1 Pro confined to 2 efficiency cores | ~0.6–1.4 s per question |
Not yet measured on a Raspberry Pi.
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 | 13 | 84.4% | 33 ms |
| English | 1 | 42 | 77.1% | 43 ms |
| English | 2 | 59 | 78.1% | 49 ms |
| English | 3 | 82 | 82.3% | 58 ms |
| Korean | 0 | 16 | 94.1% | 33 ms |
| Korean | 1 | 45 | 88.2% | 43 ms |
| Korean | 2 | 64 | 88.2% | 51 ms |
| Korean | 3 | 90 | 72.5% | 61 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 license of the base model convaiinnovations/laya. Its encoder, jhu-clsp/mmBERT-base, is MIT-licensed; that license is reproduced in NOTICE. See LICENSE and NOTICE.
laya-home-ko.int8.onnx 925 MBmodel.safetensors 644 MBconvaiinnovations/laya