A small language model fine-tuned to turn plain-English instructions into a structured control program for the Arduino UNO Q and its Modulino modules. It runs fully on-device through llama.cpp — no cloud, no API keys, works offline.
This is the model behind HatchAgent: you say "if the knob goes above 60, turn the lights red" and the board does it, with the model running locally on the UNO Q's Qualcomm MPU.
What it does
Given a natural-language instruction, it emits a compact JSON "program" — a small domain-specific language describing effects, conditions, and rules — which a rule engine on the board then executes.
json
1{"instruction":"blink the lights red really fast",2"program":{"effect":"blink","color":"red","rate":"fast"}}
json
1{"instruction":"if the knob is between 40 and 60, glow yellow",2"program":{"rule":{"src":"knob","op":"between","lo":40,"hi":60},3"effect":{"type":"solid","color":"yellow"}}}
Training
Base model: Qwen2.5-1.5B-Instruct
Method: LoRA fine-tuning
Data: a synthetic dataset of ~2,800 instruction → program pairs covering single commands, sensor-triggered rules, numeric ranges, AND/OR conditions, animations, and saved scenes
Then call the OpenAI-compatible endpoint at http://<host>:8080/v1/chat/completions.
Tip: include chat_template_kwargs: {"enable_thinking": false} in your request — the base model can otherwise spend its turn "thinking" and return empty content.
Files
hatch-q25-1.5b-Q4_K_M.gguf — Q4_K_M quantization (~0.9 GB), CPU-friendly for edge devices
Intended use
On-device natural-language control of microcontroller hardware (lights, buzzers, sensors). Designed for the Arduino UNO Q + Modulino ecosystem, but the instruction→program pattern is reusable.