Browser-deployable smart-home GPT-2: WebGPU demo, v2/v3 SFT, retrieval pre-rank, JSON-constrained decoding.
0
stars
87
commits
Python
primary language
May 29, 2026
updated
Turn natural-language smart-home commands into structured JSON tool calls — with a 124M model that runs entirely in your browser. No server, no cloud, nothing leaves your device.
🍴 Fork. Builds on barometech/smart-home-gpt2 by Pavel D. Popovich (barometech) — the original GPT-2 smart-home fine-tune, dataset and training pipeline. This repo continues it with in-browser inference, the v6→v9 cascade, long-context
v14, and voice. See Acknowledgments.🇷🇺 Описание на русском — в TUTORIAL.md.
"dim the living room lights to 20%"
↓ GPT-2 124M (smart-home fine-tune, in your browser)
{ "name": "dim_light", "arguments": { "room": "living room", "brightness_pct": 20 } }
Nothing to install — the model runs in your browser via WebGPU and is cached after the first load.
Built-in command presets, voice input (in-browser Whisper), and an fp16 / fp32 / q8 precision switch.
{"name", "arguments"} with correctly typed arguments — every time.v14) so dozens of full tool schemas fit in one prompt.A single 124M decoder plateaus around 57% exact-match, so accuracy comes from composition and decoding tricks, not a bigger model:
v6 predicts the function name, v9 (an arguments specialist) fills the arguments, a clean-gate picks the final call. Runs entirely in the browser."gym" → "basement gym").v14-ctx4096 extends the context window to 4096 tokens for long tool lists, with no short-prompt accuracy tax.Full design and rationale: ARCHITECTURE.md.
Use the hosted demos above, or run the browser app locally:
git clone https://github.com/lifeart/smart-home-gpt2-tool
cd smart-home-gpt2-tool/web
npm install
npm run dev # → http://localhost:5173/
To wire the output into a real smart-home stack, follow INTEGRATION.md.
It's a 124M model with a real, honest ceiling — the numbers are not oversold.
| Configuration | Metric | Score |
|---|---|---|
| v6→v9 cascade (in-browser, no external API) | exact-match, n=300 | 59.3% |
v14-ctx4096 (default model) | name accuracy, short prompts | 83.3% |
v14-ctx4096 | name accuracy, ~3500-token prompts | 89.5% |
| Research synthesis pipeline (needs external Llama-70B) | exact-match | 81.7% |
The in-browser app ships the 59.3% cascade; the 81.7% figure needs an external Llama endpoint and is research-only. Full tables, the 124M-ceiling analysis, dtype trade-offs, and how to reproduce the headline number: BENCHMARKS.md.
web/tool_schemas.js and data/tool_registry.json. Names close to ones the model already knows work right away; brand-new functions need re-training (training/).task: 'translate' handles 99 languages automatically; nothing to change.| Doc | What's in it |
|---|---|
| TUTORIAL.md | From clone to your own function set (RU + EN) |
| ARCHITECTURE.md | The cascade, constrained decoding, enum-snap, retrieval, long context, fp16, the voice pipeline |
| BENCHMARKS.md | Full accuracy tables, the 124M-ceiling analysis, limitations, reproduction |
| INTEGRATION.md | Plugging the model into Home Assistant, Zigbee2MQTT, ESPHome, HomeKit, MQTT |
| QUANTIZATION.md | CPU / server-side quantization options |
| HANDOFF.md · PLAN.md | The full iteration log — source of every number |
Streamed from the HF Hub on first load, then cached by the browser:
lifeart/smart-home-gpt2-v14-ctx4096 — default, 4096-token window.lifeart/smart-home-gpt2-v9 — 1024-token window.MIT — see LICENSE. Fork freely.
@misc{popovich_smart_home_gpt2_2026,
title = {Smart-Home GPT-2: in-browser tool-calling on a 124M model},
author = {Popovich, Pavel D.},
year = {2026},
url = {https://github.com/lifeart/smart-home-gpt2-tool}
}
This project is a fork of barometech/smart-home-gpt2 by Pavel D. Popovich (barometech / Tekhnozhrets) — the original GPT-2 smart-home fine-tune, dataset and training pipeline, released under the MIT License (see LICENSE). The upstream repository is linked as a git remote in this fork.
87 commits
Python
75.1%
JavaScript
21.6%
CSS
2.2%
HTML
1.2%
Browser-deployable smart-home GPT-2: WebGPU demo, v2/v3 SFT, retrieval pre-rank, JSON-constrained decoding.
0
stars
87
commits
Python
primary language
May 29, 2026
updated
Turn natural-language smart-home commands into structured JSON tool calls — with a 124M model that runs entirely in your browser. No server, no cloud, nothing leaves your device.
🍴 Fork. Builds on barometech/smart-home-gpt2 by Pavel D. Popovich (barometech) — the original GPT-2 smart-home fine-tune, dataset and training pipeline. This repo continues it with in-browser inference, the v6→v9 cascade, long-context
v14, and voice. See Acknowledgments.🇷🇺 Описание на русском — в TUTORIAL.md.
"dim the living room lights to 20%"
↓ GPT-2 124M (smart-home fine-tune, in your browser)
{ "name": "dim_light", "arguments": { "room": "living room", "brightness_pct": 20 } }
Nothing to install — the model runs in your browser via WebGPU and is cached after the first load.
Built-in command presets, voice input (in-browser Whisper), and an fp16 / fp32 / q8 precision switch.
{"name", "arguments"} with correctly typed arguments — every time.v14) so dozens of full tool schemas fit in one prompt.A single 124M decoder plateaus around 57% exact-match, so accuracy comes from composition and decoding tricks, not a bigger model:
v6 predicts the function name, v9 (an arguments specialist) fills the arguments, a clean-gate picks the final call. Runs entirely in the browser."gym" → "basement gym").v14-ctx4096 extends the context window to 4096 tokens for long tool lists, with no short-prompt accuracy tax.Full design and rationale: ARCHITECTURE.md.
Use the hosted demos above, or run the browser app locally:
git clone https://github.com/lifeart/smart-home-gpt2-tool
cd smart-home-gpt2-tool/web
npm install
npm run dev # → http://localhost:5173/
To wire the output into a real smart-home stack, follow INTEGRATION.md.
It's a 124M model with a real, honest ceiling — the numbers are not oversold.
| Configuration | Metric | Score |
|---|---|---|
| v6→v9 cascade (in-browser, no external API) | exact-match, n=300 | 59.3% |
v14-ctx4096 (default model) | name accuracy, short prompts | 83.3% |
v14-ctx4096 | name accuracy, ~3500-token prompts | 89.5% |
| Research synthesis pipeline (needs external Llama-70B) | exact-match | 81.7% |
The in-browser app ships the 59.3% cascade; the 81.7% figure needs an external Llama endpoint and is research-only. Full tables, the 124M-ceiling analysis, dtype trade-offs, and how to reproduce the headline number: BENCHMARKS.md.
web/tool_schemas.js and data/tool_registry.json. Names close to ones the model already knows work right away; brand-new functions need re-training (training/).task: 'translate' handles 99 languages automatically; nothing to change.| Doc | What's in it |
|---|---|
| TUTORIAL.md | From clone to your own function set (RU + EN) |
| ARCHITECTURE.md | The cascade, constrained decoding, enum-snap, retrieval, long context, fp16, the voice pipeline |
| BENCHMARKS.md | Full accuracy tables, the 124M-ceiling analysis, limitations, reproduction |
| INTEGRATION.md | Plugging the model into Home Assistant, Zigbee2MQTT, ESPHome, HomeKit, MQTT |
| QUANTIZATION.md | CPU / server-side quantization options |
| HANDOFF.md · PLAN.md | The full iteration log — source of every number |
Streamed from the HF Hub on first load, then cached by the browser:
lifeart/smart-home-gpt2-v14-ctx4096 — default, 4096-token window.lifeart/smart-home-gpt2-v9 — 1024-token window.MIT — see LICENSE. Fork freely.
@misc{popovich_smart_home_gpt2_2026,
title = {Smart-Home GPT-2: in-browser tool-calling on a 124M model},
author = {Popovich, Pavel D.},
year = {2026},
url = {https://github.com/lifeart/smart-home-gpt2-tool}
}
This project is a fork of barometech/smart-home-gpt2 by Pavel D. Popovich (barometech / Tekhnozhrets) — the original GPT-2 smart-home fine-tune, dataset and training pipeline, released under the MIT License (see LICENSE). The upstream repository is linked as a git remote in this fork.
87 commits
Python
75.1%
JavaScript
21.6%
CSS
2.2%
HTML
1.2%