Back to daily
Side-by-side demo

Rule-based vs on-device Gemma 4 E2B

Same input, both paths, side by side. Both run on this device. The left is the always-on JS template fallback. The right is Google's official Gemma 4 E2B Web .task build running in the browser via MediaPipe LLM Inference and WebGPU.

Aqta ADHD fine-tune: 420 coaching dialogues × LoRA on Gemma 4 E2B, taught to keep replies under ten words and use permission language ("you can stop here", "that counts"). Notebook, dataset, and validator in finetune/. The Vercel env var NEXT_PUBLIC_GEMMA_E2B_URL swaps stock for fine-tune; runtime is the same.

Demo scenarios

Rule-based templates

Always-on fallback · ~0 ms

Run a scenario to see the template reply.

On-device Gemma 4 E2B

Tap to load (one-time, ~1.9 GB)

WebGPU is unavailable in this browser. Try Chrome or Edge on desktop.

Training data · 420 dialogues

What the fine-tune learns

Eight verbatim rows from adhd_dialogues.jsonl. Permission language ("you can stop here", "that counts"), ten-word replies, body-day vs work-day discrimination. The voice the model is being taught.

Focus 4/10 · "migraine"

REPLYToday is a body day. That's data.

ACTIONLie flat for 10 minutes. Phone face down.

MINUTES10

Focus 5/10 · "won't start the report"

REPLYYou're warm enough. Open it and read line one.

ACTIONOpen the file and read the first line.

MINUTES3

Focus 4/10 · "draft is blank"

REPLYBullet point. Not a sentence. A bullet.

ACTIONWrite one bullet point.

MINUTES2

Focus 4/10 · "room is chaos"

REPLYThrow five things away. Anything.

ACTIONThrow five items in the bin.

MINUTES3

Reproducible: scripts/generate_synthetic.py with seed=42 reproduces the dataset bit-for-bit. Every row passes scripts/validate_format.py against the same regex used at inference time, so the parser the runtime uses is the parser the trainer was checked against.

Both paths run on this device. Nothing on this page leaves your browser.