<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vivaan Teotia</title>
    <description>The latest articles on DEV Community by Vivaan Teotia (@vivaan_teotia_).</description>
    <link>https://dev.to/vivaan_teotia_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4157869%2F2a0339a6-179e-43b6-ac9e-6f5f47f00b29.png</url>
      <title>DEV Community: Vivaan Teotia</title>
      <link>https://dev.to/vivaan_teotia_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vivaan_teotia_"/>
    <language>en</language>
    <item>
      <title>Uninvited: my laptop left standby 233 times in 9 days. 72 times, it wasn't me.</title>
      <dc:creator>Vivaan Teotia</dc:creator>
      <pubDate>Sun, 01 Nov 2026 05:30:20 +0000</pubDate>
      <link>https://dev.to/vivaan_teotia_/uninvited-my-laptop-left-standby-233-times-in-9-days-72-times-it-wasnt-me-11ld</link>
      <guid>https://dev.to/vivaan_teotia_/uninvited-my-laptop-left-standby-233-times-in-9-days-72-times-it-wasnt-me-11ld</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In 1949 the philosopher Gilbert Ryle coined "the ghost in the machine" to mock the idea of a mind hiding inside a body. My laptop has a less philosophical problem. Something inside it keeps waking up.&lt;/p&gt;

&lt;p&gt;So I wrote a ghost hunter for Windows laptops. It runs a Gemma 4 model on the laptop's own integrated GPU and sends nothing anywhere. Then I pointed it at my own ASUS Zenbook 14:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the 9 days Windows still remembered, the laptop &lt;strong&gt;left standby 233 times&lt;/strong&gt;. &lt;strong&gt;72 of those weren't me&lt;/strong&gt;: no lid, no key, no touchpad.&lt;/li&gt;
&lt;li&gt;It spent &lt;strong&gt;156.5 hours "asleep" and was actually awake for 16.9 of them&lt;/strong&gt;. Deep sleep only 89% of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;46 times, on every single one of those 9 nights&lt;/strong&gt;, Windows itself had to step in because standby was eating more battery than it is allowed to. The worst one was at &lt;strong&gt;4:00 AM on Halloween morning&lt;/strong&gt;, when it spent 41% of an hour of "sleep" awake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;14 exits carry the reason code &lt;code&gt;16777220&lt;/code&gt;&lt;/strong&gt;, which I could not find documented anywhere: not by Microsoft, not on the forums. My tool can't name it either. It is a literal unknown ghost.&lt;/li&gt;
&lt;li&gt;And &lt;strong&gt;58 things start on their own&lt;/strong&gt; before I ask for anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Uninvited&lt;/strong&gt; is a local, read-only ghost hunter for Windows. It answers the two questions every laptop owner has asked at some point: &lt;em&gt;why was my laptop warm and drained after a night in my bag?&lt;/em&gt; and &lt;em&gt;what is this thing in Task Manager, and do I need it?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It finds three kinds of ghost:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Ghost&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🌙&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Night wakers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What pulled the laptop out of Modern Standby, how long it was secretly awake, and what that cost in battery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;👻&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Uninvited guests&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Everything that starts without asking: Run keys, the Startup folder, scheduled tasks, auto-start services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🧟🪤&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Zombies and poltergeists&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Startup entries pointing at programs that are gone, and entries that look like malware persistence&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For every guest, a &lt;strong&gt;Gemma 4 E4B&lt;/strong&gt; model running in &lt;strong&gt;Ollama on my Intel Arc iGPU&lt;/strong&gt; explains in plain English what it is, why it starts, and what you'd lose by turning it off. Then &lt;strong&gt;plain, testable rules&lt;/strong&gt; decide the verdict. Gemma never gets a vote, for reasons I'll show with numbers below.&lt;/p&gt;

&lt;p&gt;Uninvited never changes your system. For each guest it shows the exact command to turn it off &lt;em&gt;and&lt;/em&gt; the command to undo that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnnrfy396pmbwp05dng9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnnrfy396pmbwp05dng9c.png" alt="Uninvited dashboard" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/AEO51j7ecp8" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The video is a silent, captioned walk through the real dashboard on my laptop. The "poltergeist" and the zombies in it are the evaluation's planted samples, shown with a yellow "planted for the demo" badge, because my own laptop turned out to have none.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Night wakers.&lt;/strong&gt; Every standby exit, by hour of day. Orange is Windows itself, red is the undocumented code, teal is me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2nni2eqm56iyzucor6rf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2nni2eqm56iyzucor6rf.png" alt="Night wakers" width="800" height="718"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A guest, explained.&lt;/strong&gt; MySQL had been starting with Windows, every boot. Gemma says what it is; the rules say it's your call; the card gives you the off switch and the undo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3et4zbdky7ahmvn4xecg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3et4zbdky7ahmvn4xecg.png" alt="MySQL card" width="383" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A poltergeist&lt;/strong&gt; (planted): a hidden PowerShell downloader posing as "OneDriveUpdate". The rules flag it and decode the base64: it downloads a script and runs it. Gemma had that decoded script in its prompt and &lt;em&gt;still&lt;/em&gt; described it as "a script to check for or apply updates" for OneDrive. That is exactly why it doesn't get a vote.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4ygb4uedqx6ujjs5rt2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4ygb4uedqx6ujjs5rt2.png" alt="Poltergeist card" width="383" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Séance:&lt;/strong&gt; ask your laptop a question. Answers have to cite the entries they rely on, and every number is checked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhrvvlkd6tpntfnwzfmqd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhrvvlkd6tpntfnwzfmqd.png" alt="Seance" width="798" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dragon-slayer27" rel="noopener noreferrer"&gt;
        dragon-slayer27
      &lt;/a&gt; / &lt;a href="https://github.com/dragon-slayer27/uninvited" rel="noopener noreferrer"&gt;
        uninvited
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      What's haunting your laptop? Finds what wakes your Windows laptop at night and what starts without asking. Explained by Gemma 4 running locally; rules decide. Read-only.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;👻 Uninvited&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;What's haunting your laptop?&lt;/strong&gt; Uninvited finds out what pulls your Windows laptop out of sleep at night, and everything that starts without asking. A &lt;strong&gt;Gemma 4 model running on your own laptop&lt;/strong&gt; explains each one in plain English. Plain, testable rules decide what to do about it.&lt;/p&gt;
&lt;p&gt;It is read-only, works offline, and never changes your system. It shows you the command to turn something off &lt;em&gt;and&lt;/em&gt; the command to undo it.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/dragon-slayer27/uninvited/docs/img/dashboard.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdragon-slayer27%2Funinvited%2FHEAD%2Fdocs%2Fimg%2Fdashboard.png" alt="Uninvited dashboard"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What it found on my laptop&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;From nine days of my own Windows event log (&lt;code&gt;python -m uninvited scan&lt;/code&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It left standby &lt;strong&gt;233 times in 9 days&lt;/strong&gt;. &lt;strong&gt;72 of those weren't me.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;It spent 156.5 hours "asleep", but was &lt;strong&gt;actually awake for 16.9 of them&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;46 times, on every one of the 9 nights&lt;/strong&gt;, Windows itself had to step in because standby was draining more battery than allowed ("Austerity Battery Drain…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dragon-slayer27/uninvited" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Try it on your own laptop (Windows 10/11, Python 3.10+, no pip install needed for the scan):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;clone&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https://github.com/dragon-slayer27/uninvited&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;uninvited&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;uninvited&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;scan&lt;/span&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="c"&gt;# 20 seconds, read-only, no AI needed&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;ollama&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pull&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;gemma4:e4b&lt;/span&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c"&gt;# or gemma4:e2b on an 8 GB laptop&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;uninvited&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;serve&lt;/span&gt;&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="c"&gt;# the dashboard on http://127.0.0.1:8666&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Reading the ghosts' footprints
&lt;/h3&gt;

&lt;p&gt;Windows already records everything. It just doesn't tell you. The collectors are a read-only PowerShell script plus Python's &lt;code&gt;winreg&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Standby exits&lt;/strong&gt; come from &lt;code&gt;Kernel-Power&lt;/code&gt; events 506 and 507. The useful part is not the message text ("Reason: Input Keyboard"), which is translated into the user's language, but the event's structured fields: &lt;code&gt;Reason&lt;/code&gt;, &lt;code&gt;DurationInUs&lt;/code&gt;, &lt;code&gt;DripsResidencyInUs&lt;/code&gt; (time in the deepest low-power state), &lt;code&gt;ActiveResidencyInUs&lt;/code&gt;, battery capacity on entry and exit, lid state and power source. Parsing fields instead of text makes it work on any Windows language. It also gives battery drain per session, and the "awake while asleep" number that no Windows screen shows you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Startup entries&lt;/strong&gt; come from the Run and RunOnce keys, the Startup folders, every scheduled task (actions, triggers, &lt;code&gt;WakeToRun&lt;/code&gt;) and every auto-start service. I also read Task Manager's own enable/disable switches (&lt;code&gt;StartupApproved&lt;/code&gt;), so things you already turned off show up as "sleeping" instead of being nagged about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facts about each file&lt;/strong&gt;: does it exist, its Authenticode signature and signer, version info, and how much memory it is using right now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A full scan of 320 entries and 466 standby events takes about 20 seconds. Most of that is signature checking.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Gemma explains. The rules decide.
&lt;/h3&gt;

&lt;p&gt;My first prototype asked Gemma 4 directly about Google's updater. It said &lt;strong&gt;"remove", with high confidence&lt;/strong&gt;. That was the end of letting the model decide.&lt;/p&gt;

&lt;p&gt;The pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;collectors ──► rules.analyze: missing file? encoded PowerShell? LOLBin? system-file look-alike?
                              unsigned in a writable folder? part of Windows? a driver package?
           ──► Gemma 4: product, vendor, category, what it does, what you'd lose  (JSON schema)
           ──► guards: vendor must match the digital signature, no advice, no scare words
           ──► rules.decide: keep / your call / lay it to rest / investigate / look it up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model can only influence a verdict through a &lt;em&gt;category&lt;/em&gt;: "updater" maps to keep, "chat app" to your call, and so on. Hard facts always win. A missing file is a zombie whatever Gemma thinks. An encoded PowerShell download cradle is a poltergeist even if Gemma calls it an updater. When Gemma isn't confident, the verdict is "look it up", not a guess.&lt;/p&gt;

&lt;p&gt;Then I measured it. I hand-labelled all 65 non-Windows startup entries on my laptop, and planted 14 more: 10 malicious-style entries modelled on documented MITRE ATT&amp;amp;CK persistence techniques (Run keys, hidden scheduled tasks, &lt;code&gt;mshta&lt;/code&gt;, &lt;code&gt;rundll32&lt;/code&gt;, &lt;code&gt;certutil&lt;/code&gt;, an &lt;code&gt;svchost.exe&lt;/code&gt; look-alike in Temp, using a reserved documentation IP), plus 4 harmless look-alikes such as Spotify running from AppData. The full results are in &lt;a href="https://github.com/dragon-slayer27/uninvited/blob/main/eval/EVAL.md" rel="noopener noreferrer"&gt;EVAL.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The first surprise: &lt;strong&gt;naming is not the hard part.&lt;/strong&gt; For all 65 entries, the name Windows already shows you contains the product. What nobody can tell from a name is &lt;em&gt;whether you need it&lt;/em&gt;. So that is what I scored, on the 51 entries that were switched on (judgement calls excluded):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;How the verdict is made&lt;/th&gt;
&lt;th&gt;Correct&lt;/th&gt;
&lt;th&gt;Told me to remove something I need&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemma 4 E4B decides on its own&lt;/td&gt;
&lt;td&gt;27/51 (53%)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Uninvited: rules decide, Gemma 4 E4B explains&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;46/51 (90%)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Uninvited: rules decide, Gemma 4 E2B explains&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;47/51 (92%)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Planted samples&lt;/th&gt;
&lt;th&gt;Ghosts caught (of 10)&lt;/th&gt;
&lt;th&gt;False alarms on look-alikes (of 4)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemma 4 E4B decides on its own&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Uninvited&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Left alone, Gemma is a people-pleaser: &lt;em&gt;"This is a legitimate service from your laptop's manufacturer (ASUS) and is likely needed for proper hardware functionality."&lt;/em&gt; It said "keep" for all seven ASUS extras, for MySQL (&lt;em&gt;"a database server (MySQL) that you likely need for applications"&lt;/em&gt;) and for the exam browser's service. Ask it to tidy up and it keeps almost everything, except the things that keep you patched. About Google's updater: &lt;em&gt;"it can be safely disabled if you prefer to manage updates manually."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The smaller E2B model did just as well inside the pipeline (one entry better, which is noise at this sample size) and answers in about 9 seconds instead of 16 on my iGPU. Once the rules hold the steering wheel, a smaller model is good enough.&lt;/p&gt;

&lt;p&gt;The most important line: &lt;strong&gt;asked on its own, Gemma said "keep" for the PowerShell downloader posing as OneDriveUpdate.&lt;/strong&gt; Its reason: &lt;em&gt;"This is a legitimate update process for OneDrive, signed by Microsoft, and is likely necessary for cloud synchronization."&lt;/em&gt; The file &lt;em&gt;is&lt;/em&gt; signed by Microsoft, because it is &lt;code&gt;powershell.exe&lt;/code&gt;. The payload is in the arguments, base64-encoded. Gemma also said "keep" for an unsigned fake Windows Update task hidden among Windows' own tasks. The rules caught both. Gemma alone also said "remove" for an Edge clean-up entry that deletes itself after one run, and "optional" for Google's and Adobe's security updaters.&lt;/p&gt;

&lt;p&gt;Where Uninvited is still wrong: it trusts Gemma's category, so when Gemma calls Chrome's Platform Experience Helper an "updater", the verdict is "keep" (harmless, but wrong). Office's Click-to-Run service is labelled "productivity", so it gets "your call", even though Office won't open without it. Every miss is listed in EVAL.md.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Guards on the model
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vendor check.&lt;/strong&gt; Gemma's vendor must match the file's digital signature (Oracle ↔ "Oracle America, Inc.", ASUS ↔ "ASUSTeK COMPUTER INC."). If it doesn't, Gemma gets one retry with the signer in the prompt. If it is still wrong, the signature wins and confidence drops to low, so the verdict becomes "look it up".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No advice, no scare words.&lt;/strong&gt; Sentences like "you should remove it" or "this could be malware" are stripped unless the rules actually found something. The verdict is the rules' job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Numbers are checked.&lt;/strong&gt; When Gemma writes the night report or answers a séance question, every number in its text must exist in the measurements. One invented number and the story is rejected, and a plain template is shown instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thinking off.&lt;/strong&gt; My first Gemma 4 calls returned empty strings: the model spent its whole token budget thinking. &lt;code&gt;think: false&lt;/code&gt; plus a JSON schema in Ollama's &lt;code&gt;format&lt;/code&gt; fixed it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Night Watch: a durable ghost hunt on Temporal
&lt;/h3&gt;

&lt;p&gt;The best time to catch a night waker is at night, and a laptop at night is the worst place for a long-running job. It sleeps, the lid closes, Ollama may not be running yet. So &lt;code&gt;uninvited watch&lt;/code&gt; runs as a &lt;a href="https://temporal.io" rel="noopener noreferrer"&gt;Temporal&lt;/a&gt; workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every 15 minutes, an activity takes a read-only snapshot (new standby exits, new startup entries);&lt;/li&gt;
&lt;li&gt;anything new goes to Gemma in its own activity, with &lt;strong&gt;unlimited retries and backoff&lt;/strong&gt; (15 seconds, growing to 5 minutes);&lt;/li&gt;
&lt;li&gt;the workflow sleeps on &lt;strong&gt;durable timers&lt;/strong&gt;, so a closed lid or a reboot just delays the next check;&lt;/li&gt;
&lt;li&gt;each check writes a morning report that the dashboard shows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tested the part that matters. I started a worker that could not reach the model, then planted a fake startup entry. Night Watch spotted it on its next check and tried to explain it. Temporal retried &lt;strong&gt;8 times over about 23 minutes&lt;/strong&gt;, backing off each time. Then I started a worker that could reach Ollama. &lt;strong&gt;Attempt 9 succeeded&lt;/strong&gt;, the rules called it a zombie, and the morning report said "1 new uninvited guest". Nothing was lost.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnsd4f7mo6xynmay278o6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnsd4f7mo6xynmay278o6.png" alt="Temporal retrying" width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I left it on duty for real and closed the lid at 2 AM. My morning report, written by the workflow while I slept:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;6 standby exits since 02:07; 4 were not you.&lt;/strong&gt;&lt;br&gt;
04:18, Windows clamps down on battery drain in standby (the 10th night in a row) · 08:00, lid (me) · 09:32 and 09:33, reason &lt;code&gt;16777220&lt;/code&gt;, twice · 10:15, the charger, then the lid (me)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The ghost with no name knocked twice while I was getting ready.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Web lookup with SerpApi, opt-in
&lt;/h3&gt;

&lt;p&gt;Sometimes Gemma just doesn't know, or worse, doesn't know that it doesn't know. It confidently called Chrome's undocumented "Platform Experience Helper" an updater. It isn't one, and since July it has been blamed for a blank white window that some people see at sign-in. So every card has an opt-in &lt;strong&gt;Ask the web&lt;/strong&gt; button. Only the file name, a descriptive entry name and the publisher leave the laptop: never paths, usernames, SIDs or other entries. The dashboard shows you the exact query before anything is sent. Gemma then answers again with the search results in front of it and must cite them by number. Citations to results that don't exist are rejected, and an answer that cites nothing counts as low confidence, so the rules say "look it up". The rules re-decide using the web answer's category, and the card shows both verdicts.&lt;/p&gt;

&lt;p&gt;I spent 6 of SerpApi's 250 free monthly searches on the entries Uninvited got wrong. The result was honest, not magic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chrome's helper.&lt;/strong&gt; Sent: &lt;code&gt;"platform_experience_helper.exe" RunPlatformExperienceHelperOnUnlock Google LLC&lt;/code&gt;. The results were all about Chrome opening at startup, so Gemma could not cite anything. The verdict went from a confidently wrong "keep" to "look it up". An honest "I don't know" beats a confident wrong answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Office Click-to-Run.&lt;/strong&gt; Grounded in two results, Gemma now says &lt;em&gt;"This service is required to run during the use of any Microsoft 365 and Office program"&lt;/em&gt;. That is exactly the fact it was missing. But my rules only read the category ("productivity"), so the verdict stayed "your call". The cited fact now sits right on the card, and teaching the rules to read a "required by" field is the obvious next step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OneDrive's updater.&lt;/strong&gt; Grounded, still called "cloud sync". Still a miss.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F66oz55ra7pgwa52b9y02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F66oz55ra7pgwa52b9y02.png" alt="Web lookup on the Office card" width="383" height="928"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. The boring parts that make it trustworthy
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Python standard library only for the scanner, rules, model client and dashboard. No build step, no CDN, nothing loaded from the internet.&lt;/li&gt;
&lt;li&gt;The dashboard binds to &lt;code&gt;127.0.0.1&lt;/code&gt;, checks the &lt;code&gt;Host&lt;/code&gt; and &lt;code&gt;Origin&lt;/code&gt; headers, accepts only real JSON requests, sends a strict Content-Security-Policy, and renders every entry name with &lt;code&gt;textContent&lt;/code&gt;. A startup entry is untrusted input, so a malicious one named &lt;code&gt;&amp;lt;img onerror=...&amp;gt;&lt;/code&gt; cannot attack the tool that is inspecting it.&lt;/li&gt;
&lt;li&gt;PCs without Modern Standby (most desktops) get the same view from their sleep and hibernate wake events, including which scheduled task asked to wake them. Reasons are read from codes, never from the translated message text.&lt;/li&gt;
&lt;li&gt;60 unit tests run on GitHub Actions on &lt;code&gt;windows-latest&lt;/code&gt;, followed by a real scan of the runner's own clean Windows. The build fails if that clean machine shows a single "investigate".&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What went wrong (and what I learned)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;My CI found 193 poltergeists on a perfectly clean Windows machine.&lt;/strong&gt; The smoke test scans GitHub's Windows runner, and there &lt;code&gt;Get-AuthenticodeSignature&lt;/code&gt; could not verify Windows' own catalog-signed files, so every System32 binary read "NotSigned". My rule "a task among Windows' tasks whose file isn't from Microsoft" fired 193 times. My laptop never showed this. Now a canary checks &lt;code&gt;svchost.exe&lt;/code&gt;'s signature first. If Windows can't verify even its own files, Uninvited says so, trusts the Windows folder, and only flags payloads in places Microsoft never installs to. CI now &lt;em&gt;fails&lt;/em&gt; if a clean runner shows a single "investigate".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My copy-paste commands could have been weaponised.&lt;/strong&gt; I asked a second Copilot agent to review the code before publishing. It found that a startup entry &lt;em&gt;named&lt;/em&gt; something like &lt;code&gt;Updater$(Start-Process calc)&lt;/code&gt; would have run that code the moment you pasted my "turn it off" command. A malicious entry could have attacked you through the tool that was inspecting it. Every command is now PowerShell with single-quoted literals, where &lt;code&gt;$()&lt;/code&gt; is just text, and there's a test that tries exactly that name. The same review found that I only inspected the &lt;em&gt;first&lt;/em&gt; action of a scheduled task (a harmless first action could hide a second one), and that I resolved COM handlers machine-first while Windows does user-first, which hides a known hijacking trick. Both are fixed and tested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every file was "missing" in my first scan.&lt;/strong&gt; Windows PowerShell 5.1's &lt;code&gt;ConvertFrom-Json&lt;/code&gt; emits an array as one object, so my &lt;code&gt;@(...)&lt;/code&gt; wrapped the whole list into a single "path". 320 zombies, all fake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My tool called Windows Defender a poltergeist.&lt;/strong&gt; Defender's engine &lt;code&gt;MsMpEng.exe&lt;/code&gt; lives in &lt;code&gt;ProgramData&lt;/code&gt;, which matched my "system file outside the Windows folder" rule. Validly Microsoft-signed files are now exempt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every driver helper claimed to be Microsoft.&lt;/strong&gt; Drivers are signed by Microsoft's hardware programme, so ASUS, Intel, Realtek and Dolby services all showed "Microsoft Corporation". The real vendor is in the file's version info.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Office was "part of Windows"&lt;/strong&gt; because its tasks live under &lt;code&gt;\Microsoft\&lt;/code&gt;. Only &lt;code&gt;\Microsoft\Windows\&lt;/code&gt; counts now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My own label was wrong.&lt;/strong&gt; I was sure "ASUS Optimization" handles the Fn keys and labelled it "keep". Gemma said "optional". I checked: the Fn keys belong to ASUS System Control Interface. Gemma was right, and I marked that label as a judgement call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows forgets.&lt;/strong&gt; My System log only goes back 9 days, and it keeps sliding: two hours later the window had shrunk to 8.4 days. The tool reports the real window instead of pretending it's 30 days, and Night Watch keeps its own log, so what happened tonight is still known after Windows forgets it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;16777220&lt;/code&gt; stays a ghost.&lt;/strong&gt; I tried. Uninvited reports it and refuses to guess.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Because the list Uninvited reads is a fingerprint of your life. Mine shows my VPN, my exam lock-down software, a database server, my laptop maker's diagnostics and the tools I use to code. Uninvited has to look at exactly what you'd otherwise paste into a cloud chatbot, or into one of those ad-covered "what is this .exe" sites that try to sell you a "PC optimizer".&lt;/p&gt;

&lt;p&gt;With an open-weight model, the question "what is this?" no longer requires sending the answer to someone else:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private by construction.&lt;/strong&gt; Gemma 4 runs in Ollama on the laptop's own Intel Arc iGPU through the open Vulkan backend of llama.cpp. 51 explanations cost me nothing and sent nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works when you need it most.&lt;/strong&gt; Offline, on a café or campus network, with no API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditable and fixable.&lt;/strong&gt; The rules are readable Python, the labels and planted ghosts are in the repo, and anyone can rerun the evaluation. If Gemma gets a program wrong, the fix is a pull request, not a support ticket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swappable.&lt;/strong&gt; Gemma 4 E2B runs on 8 GB laptops; &lt;a href="https://github.com/dragon-slayer27/uninvited/blob/main/eval/EVAL.md" rel="noopener noreferrer"&gt;EVAL.md&lt;/a&gt; shows what you trade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built on open shoulders.&lt;/strong&gt; Gemma (Apache 2.0), Ollama and llama.cpp (MIT), Temporal (MIT), and Windows' own event schema.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I built this with GitHub Copilot as my pair programmer in VS Code. It did the research, wrote most of the code and tests, ran the scans and the evaluation on my laptop, and drafted this post. Before publishing, I had a second Copilot agent review the code with fresh eyes. It found the command-injection hole and the multi-action blind spot described above. I checked the facts and the numbers. The &lt;a href="https://github.com/dragon-slayer27/uninvited/commits/main" rel="noopener noreferrer"&gt;commit history&lt;/a&gt; shows the order things happened in, including every bug above.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Spirit of It
&lt;/h2&gt;

&lt;p&gt;Día de los Muertos honours what is gone, and Halloween is about what refuses to stay gone. A startup entry for a program you uninstalled years ago is a little of both: it still tries to come back every time you sign in. Uninvited has a graveyard for those. My own laptop has none, though even Windows keeps two of its own: tasks that point at files that are no longer there. The ghosts I did find were quieter. A laptop that is never really asleep, a database that starts every boot, and a reason code nobody seems able to name. Now I know who's knocking at 4 AM, and at least some of the time, it's me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Gemma 4 E4B (QAT) is the explanation engine for every startup item, the night report and the séance. E2B is evaluated as the low-memory option.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Temporal:&lt;/strong&gt; Night Watch is a Temporal workflow with durable timers and retried model activities, plus a durable "explain everything" batch. Tested by taking the model away mid-run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SerpApi:&lt;/strong&gt; an opt-in, citation-checked web lookup for items the local model gets wrong or doesn't know. Only the file name, a descriptive entry name and the publisher are sent. Tested live on the entries Uninvited got wrong; results above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Copilot:&lt;/strong&gt; built with Copilot in VS Code, and reviewed by a second Copilot agent that found a command-injection hole before launch. GitHub Actions runs the tests plus a real scan of a clean Windows runner, and that scan caught a false-alarm bug my laptop couldn't show me.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;AI disclosure: this project and post were made with substantial help from GitHub Copilot. All numbers come from my own laptop's logs and from the evaluation in the repo.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Ditto: type it once, and Gemma 4 on your laptop fills every form after that</title>
      <dc:creator>Vivaan Teotia</dc:creator>
      <pubDate>Thu, 22 Oct 2026 15:37:35 +0000</pubDate>
      <link>https://dev.to/vivaan_teotia_/ditto-type-it-once-and-gemma-4-on-your-laptop-fills-every-form-after-that-331</link>
      <guid>https://dev.to/vivaan_teotia_/ditto-type-it-once-and-gemma-4-on-your-laptop-fills-every-form-after-that-331</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;In school, when an answer was the same as the line above, you didn't write it again. You drew two little strokes, &lt;strong&gt;〃&lt;/strong&gt;, the &lt;em&gt;ditto mark&lt;/em&gt;, and moved on.&lt;/p&gt;

&lt;p&gt;The internet never learned that trick. Job portals, bank KYC forms, clinic intakes, college applications and rental forms all ask the same forty questions in slightly different words. &lt;em&gt;Legal first name. Father's / Spouse's Name. Date of Birth (DD/MM/YYYY). Aadhaar No. (last 4 digits only). Is your correspondence address the same as your permanent address?&lt;/em&gt; Browser autofill handles your name and email, then gives up, and you type the rest again. Every form. Forever.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Ditto&lt;/strong&gt;: a Chrome extension that fills &lt;strong&gt;any&lt;/strong&gt; web form from a private profile, using &lt;strong&gt;Gemma 4 running on my own laptop through Ollama&lt;/strong&gt;. Press Alt+Shift+. (or click the toolbar button) and a small open model reads the form the way you would (labels, sections, instructions) and fills it, field by field, at sloth speed, while you do nothing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🟢 &lt;strong&gt;Green&lt;/strong&gt;: came from your profile.&lt;/li&gt;
&lt;li&gt;🟠 &lt;strong&gt;Amber&lt;/strong&gt;: please check. Gemma wasn't sure, or the value couldn't be traced back to your profile.&lt;/li&gt;
&lt;li&gt;⚪ &lt;strong&gt;Grey&lt;/strong&gt;: needs you. Essays, consent boxes, and things your profile doesn't know yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's designed to be &lt;em&gt;safely&lt;/em&gt; lazy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It &lt;strong&gt;never submits&lt;/strong&gt; a form and &lt;strong&gt;never ticks&lt;/strong&gt; "I agree" or "I hereby declare". Consent is yours to give.&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;never touches&lt;/strong&gt; passwords, card numbers, OTPs or captchas.&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;doesn't invent&lt;/strong&gt;. If your profile doesn't say how many people will live in the flat, that field doesn't get a confident guess.&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;gets lazier over time&lt;/strong&gt;. Type a missing answer once, click &lt;em&gt;Remember what I typed&lt;/em&gt;, and Gemma turns it into a reusable fact. A form it has seen before fills in under a second.&lt;/li&gt;
&lt;li&gt;Even setup is lazy: paste your resume into the profile page and Gemma extracts the facts for you to approve.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Who gets to be lazier?&lt;/strong&gt; Anyone who fills forms, which is everyone. Job seekers retyping their resume into applicant-tracking portals. Students on admission and scholarship forms. Parents on school forms. Patients at a new clinic. And anyone opening a bank account in India, where KYC is less a process and more a lifestyle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr6iifs1xo0xy5rswxs5q.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr6iifs1xo0xy5rswxs5q.gif" alt="Ditto filling a 26-field bank account opening form" width="559" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A real run on my laptop's CPU, with the waiting sped up 5×. Watch for the BLOCK LETTERS, the DD/MM/YYYY dates, "last 4 digits only" for Aadhaar, the income bracket picked from the salary, the permanent address (Chennai) kept apart from the current one (Bengaluru), and the nominee section filled with Meera's mother, not Meera. The declaration checkbox is left for the human.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;🌐 &lt;strong&gt;Website and five demo forms:&lt;/strong&gt; &lt;a href="https://dragon-slayer27.github.io/ditto/" rel="noopener noreferrer"&gt;dragon-slayer27.github.io/ditto&lt;/a&gt;. Install the extension, click &lt;strong&gt;Load Meera&lt;/strong&gt; (a fictional person with about 50 facts) and try any of the forms.&lt;/p&gt;

&lt;h3&gt;
  
  
  It learns from you
&lt;/h3&gt;

&lt;p&gt;I removed three facts from Meera's profile (blood group, allergies, emergency contact phone) and opened a clinic form. Ditto left those fields empty instead of guessing. I typed them in by hand and clicked &lt;strong&gt;Remember what I typed&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3fuezefbcfpqv3oghtz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3fuezefbcfpqv3oghtz.png" alt="Ditto proposing three new facts to remember" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ditto proposed exactly those three facts. It deliberately ignores free-text answers, like the reason for a clinic visit, because those only make sense once. Then I opened a completely different form, a hackathon registration, and the allergy and emergency contact phone filled themselves:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fql2xcr8o1879uc8kj1yg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fql2xcr8o1879uc8kj1yg.png" alt="The next form filling with the learned facts" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the slow and steady part: every form you fill by hand is the last time you type those answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dragon-slayer27" rel="noopener noreferrer"&gt;
        dragon-slayer27
      &lt;/a&gt; / &lt;a href="https://github.com/dragon-slayer27/ditto" rel="noopener noreferrer"&gt;
        ditto
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Type it once. A Chrome extension that fills any web form from your private profile using Gemma 4 running locally via Ollama.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Ditto 〃 type it once&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;A Chrome extension that fills any web form from your private profile, using Gemma 4 running on your own computer through Ollama.&lt;/strong&gt;
Job portals, bank KYC, clinic intake, rental applications, college forms: they all ask the same forty questions in slightly different words. Ditto answers them for you, and your passport number never leaves your laptop.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/dragon-slayer27/ditto/actions/workflows/ci.yml" rel="noopener noreferrer"&gt;&lt;img src="https://github.com/dragon-slayer27/ditto/actions/workflows/ci.yml/badge.svg" alt="CI"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/c1c70544c1d31953fe45cfbda444f6ca1d3e0d813f0dee66959da04db019b7c9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d336636323132"&gt;&lt;img src="https://camo.githubusercontent.com/c1c70544c1d31953fe45cfbda444f6ca1d3e0d813f0dee66959da04db019b7c9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d336636323132" alt="License: MIT"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/be97a68e97fc850ead37d7b59ea5e78a49e36f4008e1efd7d4d62ee2fc7bc23a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6f64656c2d47656d6d61253230342532304534422d363561333064"&gt;&lt;img src="https://camo.githubusercontent.com/be97a68e97fc850ead37d7b59ea5e78a49e36f4008e1efd7d4d62ee2fc7bc23a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6f64656c2d47656d6d61253230342532304534422d363561333064" alt="Model: Gemma 4 (Apache 2.0)"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/dragon-slayer27/ditto/site/assets/demo.gif"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdragon-slayer27%2Fditto%2FHEAD%2Fsite%2Fassets%2Fdemo.gif" alt="Ditto filling a bank account opening form"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A 26-field bank form filled by Gemma 4 E4B on a laptop CPU. Green came from the profile, amber means "please check", grey means "needs you".&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Website and demo forms:&lt;/strong&gt; &lt;a href="https://dragon-slayer27.github.io/ditto/" rel="nofollow noopener noreferrer"&gt;https://dragon-slayer27.github.io/ditto/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Write-up on DEV:&lt;/strong&gt; &lt;a href="https://dev.to/vivaan_teotia_/ditto-type-it-once-and-gemma-4-on-your-laptop-fills-every-form-after-that-331" rel="nofollow"&gt;Ditto: type it once, and Gemma 4 on your laptop fills every form after that&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Browser autofill knows your name and email. It has no idea what "Father's / Spouse's Name", "Aadhaar No. (last 4 digits only)" or "Name as per PAN, in BLOCK LETTERS" means, so you type it all again, on every…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dragon-slayer27/ditto" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The open pieces:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://ai.google.dev/gemma" rel="noopener noreferrer"&gt;Gemma 4 E4B&lt;/a&gt;&lt;/strong&gt; (open weights, Apache 2.0) does three jobs: reading forms and choosing values, turning typed answers into profile facts, and extracting a profile from a pasted resume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;&lt;/strong&gt; runs it on my laptop's CPU (Intel Core Ultra 5, 16 GB RAM, no GPU).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Chrome MV3 extension&lt;/strong&gt; in about 2,300 lines of plain JavaScript, with no framework and no build step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playwright&lt;/strong&gt; drives the &lt;em&gt;real&lt;/em&gt; extension through an automated eval, and &lt;strong&gt;GitHub Actions&lt;/strong&gt; runs everything from unit tests to Gemma itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What happens when you press the shortcut:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A content script reads the form like a person would. For each field it finds the label (from &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt;, ARIA, neighbouring table cells, nearby text or placeholders), the &lt;strong&gt;section&lt;/strong&gt; it sits in, the options, and hints like "(DD/MM/YYYY)" or &lt;code&gt;maxlength&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The background worker sends Gemma your profile and the field list, together with a JSON schema that has one required key per field.&lt;/li&gt;
&lt;li&gt;Values stream back, and each field fills the moment its value is complete.&lt;/li&gt;
&lt;li&gt;Code checks every value: format rules, option matching, the browser's own validation, and a "tripwire" that traces the value back to your profile.&lt;/li&gt;
&lt;li&gt;Answers are remembered per page, so the same form is instant next time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Six things that broke, and what fixed them
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Ollama said 403.&lt;/strong&gt; Ollama rejects requests from browser extensions unless you set &lt;code&gt;OLLAMA_ORIGINS&lt;/code&gt;. I didn't want anyone editing environment variables, so Ditto adds a &lt;code&gt;declarativeNetRequest&lt;/code&gt; &lt;em&gt;session rule&lt;/em&gt; that removes the &lt;code&gt;Origin&lt;/code&gt; header only for the extension's own requests (&lt;code&gt;tabIds: [-1]&lt;/code&gt;). Zero setup, and web pages still can't reach your Ollama through Ditto.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. 134 seconds for one form.&lt;/strong&gt; My first output format was an array of &lt;code&gt;{id, value, from, sure}&lt;/code&gt; objects, about 45 tokens per field at about 10 tokens a second. Switching to a per-form schema, &lt;code&gt;{"values": {"d1": …, "d2": …}, "unsure": [...]}&lt;/code&gt;, cut the output 3.5× and the same bank form went from &lt;strong&gt;134 s to 51 s&lt;/strong&gt;. A bonus: every field id is a &lt;em&gt;required&lt;/em&gt; key, so the model can't skip a field or invent one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Someone's height came out as &lt;code&gt;"},{"&lt;/code&gt;.&lt;/strong&gt; Every number field got junk like &lt;code&gt;", "&lt;/code&gt;. The parser was fine. Gemma really wrote it. My schema only allowed a string or null, the model wanted to write a bare &lt;code&gt;162&lt;/code&gt;, the grammar blocked that token, and the model derailed. Allowing numbers in the schema fixed all seven fields at once. A good reminder that constrained decoding can push a model off a cliff when the schema fights its instincts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Gemma forgot BLOCK LETTERS after section 1.&lt;/strong&gt; The values were right, just in normal case. Instead of pleading harder in the prompt, Ditto spots "BLOCK LETTERS" on the page and uppercases in code. That became my rule for the whole project: &lt;strong&gt;the model finds the facts, code enforces the formats.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Confident guesses.&lt;/strong&gt; Asked for "Monthly take-home income", Gemma divided the annual salary by 12 (ignoring tax). Asked "Number of people who will live here", it said 1. Neither is in the profile. So every value now goes through a &lt;strong&gt;tripwire&lt;/strong&gt;: every word and number in it must trace back to the profile (dates in any format, digit runs as substrings, short numbers as standalone tokens). Both guesses now turn amber on their own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. My own shortcut didn't work.&lt;/strong&gt; The first time I installed Ditto in my everyday browser, the toolbar button worked but Alt+Shift+D did nothing. Dark Reader already owned that combination, and Chrome doesn't warn anyone: it just leaves the new extension's shortcut empty. A GitHub code search found 488 public manifests suggesting Alt+Shift+D and 23 suggesting Alt+Shift+Period, so the default is now Alt+Shift+.. More importantly, Ditto now asks Chrome which shortcut it actually got (&lt;code&gt;chrome.commands.getAll()&lt;/code&gt;). If the answer is "none", the popup says so and links straight to &lt;code&gt;chrome://extensions/shortcuts&lt;/code&gt;. A CI test reproduces the conflict with a stand-in extension to keep it that way.&lt;/p&gt;

&lt;h3&gt;
  
  
  The eval: 5 forms, 114 fields, lots of traps
&lt;/h3&gt;

&lt;p&gt;I built five demo forms to be annoying in the ways real forms are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;React&lt;/strong&gt; job portal, where React's own state must receive the values, not just the screen;&lt;/li&gt;
&lt;li&gt;an old &lt;strong&gt;table-layout bank form&lt;/strong&gt; with no &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; tags, BLOCK LETTERS and a nominee section;&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;clinic intake&lt;/strong&gt; with a date picker, a computed age and &lt;em&gt;two&lt;/em&gt; different "Phone" fields;&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;rental form&lt;/strong&gt; with placeholder-only inputs and questions the profile can't answer;&lt;/li&gt;
&lt;li&gt;a dark-mode &lt;strong&gt;hackathon form&lt;/strong&gt; whose radio buttons hide the real &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;s.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's 114 fields of ground truth, 18 of which must stay &lt;strong&gt;empty&lt;/strong&gt; because the honest answer is "the profile doesn't know". &lt;a href="https://github.com/dragon-slayer27/ditto/blob/main/eval/run-eval.mjs" rel="noopener noreferrer"&gt;&lt;code&gt;eval/run-eval.mjs&lt;/code&gt;&lt;/a&gt; loads the real extension in Chromium, fills every form, and scores each field.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Form&lt;/th&gt;
&lt;th&gt;Fields&lt;/th&gt;
&lt;th&gt;Right&lt;/th&gt;
&lt;th&gt;Wrong but shown green&lt;/th&gt;
&lt;th&gt;First fill&lt;/th&gt;
&lt;th&gt;Same form again&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Job application (React)&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;50 s&lt;/td&gt;
&lt;td&gt;0.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bank KYC (table layout)&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;54 s&lt;/td&gt;
&lt;td&gt;0.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clinic intake&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;45 s&lt;/td&gt;
&lt;td&gt;0.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rental application&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;27 s&lt;/td&gt;
&lt;td&gt;0.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hackathon sign-up&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;26 s&lt;/td&gt;
&lt;td&gt;0.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;114&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;112 (98.2%)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;202 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.4 s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Right" counts fields filled correctly &lt;em&gt;and&lt;/em&gt; fields correctly left empty. The two wrong answers are the take-home pay and the head count from above, and the tripwire flagged both amber. &lt;strong&gt;Not one wrong value was shown green.&lt;/strong&gt; React's state received all 23 values Ditto typed into the job form.&lt;/p&gt;

&lt;h3&gt;
  
  
  How small can the sloth be?
&lt;/h3&gt;

&lt;p&gt;I ran the same eval with the smaller &lt;strong&gt;Gemma 4 E2B&lt;/strong&gt; (4.6 GB instead of 6.1 GB):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Right&lt;/th&gt;
&lt;th&gt;Wrong but shown green&lt;/th&gt;
&lt;th&gt;Output speed on my CPU&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemma 4 E4B&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;112 / 114&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;9.7 tokens/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma 4 E2B&lt;/td&gt;
&lt;td&gt;104 / 114&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;11.9 tokens/s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;E2B's big mistake was instructive: it put the &lt;em&gt;current&lt;/em&gt; Bengaluru address into the bank form's &lt;em&gt;Permanent address&lt;/em&gt; section. Those are real facts in the wrong place, so my tripwire, which catches facts that aren't in your profile, couldn't see them: six silent mistakes in one go. That's why Ditto picks E4B when it's installed, and why I measured both on my own forms instead of trusting a leaderboard.&lt;/p&gt;

&lt;p&gt;The eval runs in the cloud too: a GitHub Actions workflow installs Ollama on a standard runner, pulls Gemma and fills all 114 fields with the real extension. &lt;a href="https://github.com/dragon-slayer27/ditto/actions/runs/39649957127" rel="noopener noreferrer"&gt;Its first run&lt;/a&gt; finished in under five minutes and reproduced the finding on different hardware: E2B scored 106/114, with the same permanent-address mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Forms are where we hand over our most sensitive facts.&lt;/strong&gt; PAN, Aadhaar, passport number, home address, medical conditions, family members. I'd never paste those into a cloud chatbot every time a form asks. With an open-weight model on my laptop, the profile lives in my browser, the model reads it locally, and the only place Ditto's manifest lets it connect to is my own machine (&lt;code&gt;127.0.0.1&lt;/code&gt;), where Ollama runs. It can't even read a page until you press the button.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It costs nothing per form, forever.&lt;/strong&gt; No API key, no subscription, no per-token bill, nothing that can be repriced or switched off. That changed how I built it, too: I ran the full 114-field eval over and over while tuning prompts and schemas, for free, on the same machine that will run it for real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I could open the hood when things broke.&lt;/strong&gt; The &lt;code&gt;"},{"&lt;/code&gt; bug was a fight between the model and the grammar constraining it. I found it by reading raw model output and fixed it by changing the schema. Local control over decoding (JSON schemas, temperature, context size, how long the model stays warm) is what made Ditto reliable rather than lucky.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I could choose the model's size.&lt;/strong&gt; E2B for 8 GB machines, E4B for accuracy, measured on my own task. A closed API picks that trade-off for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anyone can check it.&lt;/strong&gt; MIT-licensed code, Apache-licensed weights. If a tool is going to fill in your passport number, you should be able to read every line that touches it.&lt;/p&gt;

&lt;p&gt;And honestly, it fits the theme: at about 10 tokens a second, Gemma on my CPU &lt;em&gt;is&lt;/em&gt; a sloth. That's fine. It's a sloth that works while I make chai, and it only has to be slow once per form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building It With GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;I built Ditto with GitHub Copilot's agent as my pair programmer, from start to finish: brainstorming ideas, benchmarking Gemma 4 on my CPU before writing any code, building the extension and the eval harness, and debugging the &lt;code&gt;"},{"&lt;/code&gt; bug from raw model output.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Lazy Payoff
&lt;/h2&gt;

&lt;p&gt;Across the five demo forms, Ditto fills &lt;strong&gt;95 fields&lt;/strong&gt;: 1,352 typed characters plus 24 dropdown, radio and checkbox choices. Another 19 fields need a person no matter what (essays, consent boxes, questions the profile can't answer), so I left them out of both sides.&lt;/p&gt;

&lt;p&gt;To estimate the by-hand time without fooling myself, I used the &lt;strong&gt;Keystroke-Level Model&lt;/strong&gt;, the classic HCI method for predicting how long a skilled user takes with a keyboard and mouse (0.28 s per keystroke at about 40 wpm, 1.1 s to point, 1.35 s to recall or decide), plus 15 s for each value nobody knows by heart, like a PAN or a policy number. The Ditto side uses the times measured in the eval.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Five forms by hand&lt;/th&gt;
&lt;th&gt;With Ditto&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Your time&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;11 min 26 s to 14 min 25 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1 min 06 s&lt;/strong&gt; (press the shortcut, glance at green, check amber)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wall clock, first time&lt;/td&gt;
&lt;td&gt;same as above&lt;/td&gt;
&lt;td&gt;4 min 28 s, and you're free while the sloth works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bank form alone&lt;/td&gt;
&lt;td&gt;2 min 35 s to 3 min 20 s&lt;/td&gt;
&lt;td&gt;14 s of your time&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's roughly &lt;strong&gt;a 10× cut in hands-on time&lt;/strong&gt;, and the model is generous to the human: it assumes no typos, no switching tabs to copy an address, and no hunting for your PAN card for longer than 15 seconds. If you apply for jobs, a portal asks most of these questions again on every application: 20 job forms like the demo one take &lt;strong&gt;about an hour of typing by hand, and about 6 minutes of glancing with Ditto&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The calculation is a script in the repo (&lt;a href="https://github.com/dragon-slayer27/ditto/blob/main/eval/payoff.mjs" rel="noopener noreferrer"&gt;&lt;code&gt;eval/payoff.mjs&lt;/code&gt;&lt;/a&gt;), with every assumption written down next to the per-form table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma&lt;/strong&gt;: Gemma 4 E4B is the core of Ditto. It reads arbitrary forms in context (sections, instructions, formats), turns typed answers into reusable facts, and extracts profiles from pasted text, all locally through Ollama. I measured E4B against E2B on 114 fields and designed around the model's strengths (structured output) and weaknesses (formatting drift, arithmetic) with guards in code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of GitHub Copilot&lt;/strong&gt;: built end to end with GitHub Copilot's agent, and automated with GitHub Actions: CI loads the real extension in Chromium, checks extraction on all five forms and reproduces the shortcut conflict from above; a &lt;strong&gt;Model eval&lt;/strong&gt; workflow installs Ollama, pulls Gemma and runs the full 114-field eval in the cloud, posting the scorecard to the job summary; Pages deploys the site, and tagged releases ship the extension zip.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Solo project. Thanks for reading, and may you never type your information into a form again.&lt;/em&gt; 🦥&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
      <category>mlhacks</category>
    </item>
    <item>
      <title>Second: Stockfish finds the blunder, Gemma 4 explains it to a 10-year-old, and code checks every word</title>
      <dc:creator>Vivaan Teotia</dc:creator>
      <pubDate>Sat, 17 Oct 2026 14:59:53 +0000</pubDate>
      <link>https://dev.to/vivaan_teotia_/second-stockfish-finds-the-blunder-gemma-4-explains-it-to-a-10-year-old-and-code-checks-every-2970</link>
      <guid>https://dev.to/vivaan_teotia_/second-stockfish-finds-the-blunder-gemma-4-explains-it-to-a-10-year-old-and-code-checks-every-2970</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I asked Gemma 4 E4B (an open model) to explain 29 real blunders and mistakes from club games. Its notes suggested Stockfish's top alternative &lt;strong&gt;zero&lt;/strong&gt; times, and one note in four recommended a move that isn't even legal. Then I gave it Stockfish's facts instead of the raw game, and it named the right move &lt;strong&gt;29 times out of 29&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That gap is the whole product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second&lt;/strong&gt; is a game-review assistant for chess coaches. A coach pastes a student's games (or just their Lichess or Chess.com username) and a couple of minutes later gets a review sheet they can teach from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The 3 or 4 moments that decided the game, on board diagrams showing the move played, the better move and the opponent's threat&lt;/li&gt;
&lt;li&gt;A short explanation of each moment in words a 10-year-old understands&lt;/li&gt;
&lt;li&gt;A question to ask the student in class, and a rule of thumb to remember&lt;/li&gt;
&lt;li&gt;Homework for the week&lt;/li&gt;
&lt;li&gt;A WhatsApp-ready note for the parents, in Hindi, Hinglish, Tamil, English or any other language&lt;/li&gt;
&lt;li&gt;An annotated PGN to drop straight into a Lichess study&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything runs on an ordinary laptop with open models: &lt;strong&gt;Stockfish&lt;/strong&gt; does the chess, &lt;strong&gt;Gemma 4 E4B&lt;/strong&gt; (through Ollama) writes the words, and a &lt;strong&gt;verifier&lt;/strong&gt; in plain Python makes sure the words only say what Stockfish confirmed.&lt;/p&gt;

&lt;p&gt;In chess, a &lt;em&gt;second&lt;/em&gt; is the analyst who does the preparation so the player can focus on playing. That's the job here: the coach keeps teaching, Second does the Sunday-night homework checking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl27k0byau7n13zngnrww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl27k0byau7n13zngnrww.png" alt="A Second review: accuracy, blunders, the winning-chances graph and where the notes came from" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Who would pay for this?
&lt;/h3&gt;

&lt;p&gt;Chess coaching has exploded in India since Gukesh became world champion, and a lot of the coaches are strong club players and college students teaching on the side, which makes it a side hustle in its own right. The lessons are paid. The part after the lessons isn't: opening every student's games, finding the turning points, and writing something a kid (and their parents) will actually read. A coach with 20 students who each play two games a week has 40 games to go through. At five minutes a game, that's more than three hours of unpaid work every week.&lt;/p&gt;

&lt;p&gt;Second turns each of those games into about 90 seconds of laptop time, while the coach does something else.&lt;/p&gt;

&lt;p&gt;Here's how I'd sell it. The software is GPL and free to self-host, forever. Coaches pay for the parts they don't want to do themselves: a one-click installer, their academy's name on the printouts, automatic weekly import of every student's online games, and support. Around &lt;strong&gt;₹299 a month per coach&lt;/strong&gt; (about $3.15). That price works because a review costs nothing to produce: the models run on the coach's own laptop, so there's no bill growing with every game.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://chess-second.onrender.com" rel="noopener noreferrer"&gt;https://chess-second.onrender.com&lt;/a&gt; (free Render instance, so it can take a minute to wake up)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sample reviews:&lt;/strong&gt; &lt;a href="https://chess-second.onrender.com/samples" rel="noopener noreferrer"&gt;https://chess-second.onrender.com/samples&lt;/a&gt; (real games from the open Lichess database, reviewed on my laptop, with notes for parents in any language like Hindi, English, Tamil)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A real run on my laptop, sped up (the real thing takes about 90 seconds): paste a game, Stockfish checks every move, Gemma writes the notes, the verifier checks them, and the review comes out with a note for parents in Hindi(can be any language).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7g77yhwenplny64odn30.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7g77yhwenplny64odn30.gif" alt="Second reviewing a real game, from pasting the PGN to the Hindi note for parents" width="760" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each key moment gets two boards: the position before the move (red: what was played, green: what was better) and after it (orange: the opponent's best reply, yellow: the piece left undefended).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcx69ox705w1psn7t4lt0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcx69ox705w1psn7t4lt0.png" alt="A key moment: two boards, the explanation, a question for the student and a rule of thumb" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the part parents actually read:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi16arphs419ngsfdn89c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi16arphs419ngsfdn89c.png" alt="The note for parents in Hindi with Copy and Send on WhatsApp buttons" width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dragon-slayer27" rel="noopener noreferrer"&gt;
        dragon-slayer27
      &lt;/a&gt; / &lt;a href="https://github.com/dragon-slayer27/chess-second" rel="noopener noreferrer"&gt;
        chess-second
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Game reviews for chess coaches: Stockfish finds the mistakes, an open-weight Gemma 4 explains them, and a verifier checks every claim. Runs on a laptop.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;♞ Second: a chess coach's AI second&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Stockfish finds it. Gemma explains it. Code checks it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://chess-second.onrender.com" rel="nofollow noopener noreferrer"&gt;https://chess-second.onrender.com&lt;/a&gt; (public demo, free instance, so give it a minute to wake up) ·
&lt;a href="https://chess-second.onrender.com/samples" rel="nofollow noopener noreferrer"&gt;sample reviews&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Second turns your students' games into review sheets you can teach from: the turning points
on board diagrams, a kid-friendly explanation of each one, a question to ask in class, a rule of
thumb, homework, and a WhatsApp-ready note for parents in their own language.&lt;/p&gt;
&lt;p&gt;It runs on an ordinary laptop with open models (Stockfish + Gemma 4 through Ollama), so
students' games and names never leave the coach's machine, and a review costs nothing.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/dragon-slayer27/chess-second/docs/demo.gif"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fdragon-slayer27%2Fchess-second%2FHEAD%2Fdocs%2Fdemo.gif" alt="Second reviewing a real game: paste a PGN, Stockfish and Gemma run on the laptop, the verified review comes out"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In chess, a &lt;em&gt;second&lt;/em&gt; is the analyst who does the preparation so the player (or the coach) can focus
on the game. That is the job here: the coach still teaches, Second does the Sunday-night homework checking.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why the model is&lt;/h2&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dragon-slayer27/chess-second" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  First experiment: Gemma on its own is a terrible chess coach
&lt;/h3&gt;

&lt;p&gt;My very first test gave Gemma 4 E4B one line of facts about the most famous beginner blunder there is: &lt;em&gt;"The student played 3... Nf6 and allowed Qxf7#. Better was g6."&lt;/em&gt; I asked for a coaching note.&lt;/p&gt;

&lt;p&gt;It titled the note &lt;strong&gt;"Don't Fall for the Quick Knockout: Avoiding the Back-Rank Trap"&lt;/strong&gt;. It isn't a back-rank mate. It warned about a &lt;strong&gt;"discovered attack"&lt;/strong&gt;. There isn't one. On the second try the headline was &lt;strong&gt;"Tactical Blunder: Avoiding the Queen Sacrifice"&lt;/strong&gt;. The queen takes a pawn and it's checkmate; nothing is sacrificed.&lt;/p&gt;

&lt;p&gt;That's harmless in a chatbot. It's not harmless on a sheet of paper a 10-year-old will believe, from a coach the child's parents are paying for accuracy.&lt;/p&gt;

&lt;h3&gt;
  
  
  So the model never analyses anything
&lt;/h3&gt;

&lt;p&gt;The rule in Second is simple: &lt;strong&gt;the language model only writes words. Everything chess is decided by code.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PGN / Lichess / Chess.com
  -&amp;gt; Stockfish: every position, best 2 lines, depth 14
  -&amp;gt; Facts: python-chess works out what actually happened
  -&amp;gt; Gemma 4: headline, explanation, question, tip, summary, parent note
  -&amp;gt; Verifier: is every claim in the facts?
       yes                 -&amp;gt; review
       no                  -&amp;gt; Gemma gets the list of problems and tries again
       3 failed tries      -&amp;gt; plain note built from the facts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1. Stockfish checks every move.&lt;/strong&gt; A move is flagged when the player's winning chances drop by 10 points or more (15 or more for a blunder), using the same win-chance curve and thresholds as Lichess.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Code turns the analysis into facts.&lt;/strong&gt; For each critical moment, python-chess works out what actually happened and writes it down as plain sentences: which piece was left undefended and by what it's attacked, whether the reply is a fork, whether there's a forced mate (and whether it's a back-rank mate), what the better move captures, and how much material each line wins or loses. Here's the real fact sheet for a blunder from one of the &lt;a href="https://lichess.org/kvatmony" rel="noopener noreferrer"&gt;sample games&lt;/a&gt; (a 1531-rated blitz game from the Lichess database):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Move played: 19. Rxe5 (a blunder)
- Before Rxe5 the position was winning for you; after it, the position was losing for you.
- After Rxe5, your queen on d6 is attacked by the queen on g6 and nothing defends it.
- After Rxe5, your rook on e5 can be taken by the knight on d7, which is worth less.
- Your opponent's best reply is Qxd6, which captures your queen on d6.
- If your opponent finds the best line (Qxd6, Re4, fxe4, Bxd6), you lose about 8 points of material.
- The better move was Qxe7, which captures the opponent's knight on e7 for free.
- Following the best line (Qxe7, e4, Be2, h3), you would win about 3 points of material.
KEY FACT: After Rxe5, your queen on d6 is attacked by the queen on g6 and nothing defends it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And what Gemma wrote from it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Don't leave your queen attacked.&lt;/strong&gt; After you played Rxe5, your queen on d6 was attacked by the queen on g6 and had no defense. A better move was Qxe7, which lets you take the knight for free.&lt;br&gt;
&lt;strong&gt;Ask Ananya:&lt;/strong&gt; Before you moved, what was happening to your queen on d6?&lt;br&gt;
&lt;strong&gt;Rule of thumb:&lt;/strong&gt; Always check if your pieces are safe before making a move.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3. Gemma writes the notes&lt;/strong&gt; for the student's level (beginner, intermediate, advanced): a headline, two or three sentences, a question that lets the student find the idea themselves, and a rule of thumb. Then a summary, homework and the note for parents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The verifier checks specific chess claims against the engine facts.&lt;/strong&gt; Every move, square, "mate in N", move number and evaluation in the note has to appear in the facts. So does every named tactic: a note can only say "fork", "pin", "sacrifice", "back rank" or "discovered attack" if the facts do. Claims like "you lose your queen" or "the knight on f4 is hanging" have to match a piece the facts say was actually lost or undefended. The parent note can't contain chess notation, and if it's meant to be in Hindi it has to actually be in Devanagari. If anything fails, Gemma gets told exactly what was wrong and tries again. After three failures, Second uses a plain note assembled from the facts, so nothing invented ever reaches a student.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;TACTIC_RE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;\b(back[- ]rank|fork(?:s|ed|ing)?|pin(?:s|ned|ning)?|skewer\w*|discovered (?:attack|check)\w*|&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sacrific\w*|smothered|stalemate\w*|en passant|zwischenzug|deflect\w*|decoy\w*|overload\w*|x-ray)\b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="bp"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TACTIC_RE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;finditer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;TACTIC_ROOTS&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;allowed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mentions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Issue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wrong_tactic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Measuring it
&lt;/h3&gt;

&lt;p&gt;I sampled 16 real games between 1000 and 1700 rated players from the &lt;a href="https://database.lichess.org" rel="noopener noreferrer"&gt;Lichess open database&lt;/a&gt; (CC0) and took the biggest blunder or mistake for each side: 29 moments. Each one was explained three ways by the same model on the same laptop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Plain Gemma&lt;/strong&gt;: the moves so far plus "this move was a blunder, explain it". This is what happens when you paste a game into a chatbot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma + engine facts&lt;/strong&gt;: Second's fact sheet, first answer, no verifier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Second&lt;/strong&gt;: facts, verifier, retries, fallback.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Plain Gemma&lt;/th&gt;
&lt;th&gt;Gemma + facts&lt;/th&gt;
&lt;th&gt;Second&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Suggests a concrete move&lt;/td&gt;
&lt;td&gt;14/29&lt;/td&gt;
&lt;td&gt;29/29&lt;/td&gt;
&lt;td&gt;29/29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Names Stockfish's top alternative&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0/29&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;29/29&lt;/td&gt;
&lt;td&gt;29/29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mentions a piece move that isn't legal on the board&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;7/29&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0/29&lt;/td&gt;
&lt;td&gt;0/29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Makes a chess claim the engine didn't confirm&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;18/29&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0/29&lt;/td&gt;
&lt;td&gt;0/29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Median time per note&lt;/td&gt;
&lt;td&gt;11.9 s&lt;/td&gt;
&lt;td&gt;12.2 s&lt;/td&gt;
&lt;td&gt;12.2 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One example. After a beginner played 14. g4:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plain Gemma:&lt;/strong&gt; &lt;em&gt;"A better move would have been to play 14. Nf7, putting more pressure on Black's position."&lt;/em&gt; Nf7 isn't a legal move in that position.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Second:&lt;/strong&gt; &lt;em&gt;"After your move g4, the game became bad for you. If you had played Nxh6 instead, you would have won about 2 points of material."&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The honest finding surprised me: &lt;strong&gt;the facts did almost all the work.&lt;/strong&gt; With a good fact sheet, Gemma's first answer passed the verifier every single time in this run, so the verifier never had to step in. I'm keeping it anyway. It's the seatbelt for the day grounding isn't enough, and it's what lets me say "nothing invented reaches a student" instead of "probably nothing". Every note and every score is in &lt;a href="https://github.com/dragon-slayer27/chess-second/tree/main/eval" rel="noopener noreferrer"&gt;&lt;code&gt;eval/results.json&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prompting lessons from a 4B model
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tell it what matters.&lt;/strong&gt; My first notes were all correct and all bland ("Watch out for big mistakes!"). In one early review the facts said a knight fork was coming (Nxc2+, hitting the king and the rook) and Gemma talked about the pawn on c2 instead. The fix was letting code pick a single &lt;strong&gt;KEY FACT&lt;/strong&gt; per moment and requiring the explanation to lead with it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Say who the reader is.&lt;/strong&gt; The first Hindi "note for parents" started &lt;em&gt;"प्रिय Aarav"&lt;/em&gt; ("Dear Aarav"): it was written to the kid. Now the prompt says to write to the parent and talk about the child in the third person, and to name one thing to practise this week.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't give the model the kid's name at all.&lt;/strong&gt; Gemma writes &lt;code&gt;[STUDENT]&lt;/code&gt; and Second fills in the name afterwards. Locally it doesn't matter much, but it means the hosted demo never sends a child's name to anyone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The verifier was wrong too, at first
&lt;/h3&gt;

&lt;p&gt;On the first sample game, the verifier proudly reported "4 invented details caught". I went to look, and every one was my bug, not Gemma's. The summary said the student "castled on move 5" and had "75.1% accuracy". Both were true, and both were in the facts I'd given Gemma, but the summary checker only knew about the key moments, so it rejected them three times. Worse, the whole summary then fell back to the English template, even though the parents had asked for Hindi.&lt;/p&gt;

&lt;p&gt;Two fixes. The summary is now checked against exactly the fact sheet Gemma was shown. And fallbacks happen per field: if only the summary sentence is bad, it gets replaced, and a perfectly good Hindi note for parents is kept.&lt;/p&gt;

&lt;h3&gt;
  
  
  Making a 4B model fast on a normal laptop
&lt;/h3&gt;

&lt;p&gt;I run &lt;code&gt;gemma4:e4b-it-qat&lt;/code&gt; (6.1 GB) in Ollama on an Intel Core Ultra 5 laptop with 16 GB of RAM and no discrete graphics card. By default Ollama ignored the integrated Intel Arc GPU. Setting &lt;code&gt;OLLAMA_IGPU_ENABLE=1&lt;/code&gt; turned on Vulkan and took prompt processing from &lt;strong&gt;~31 to ~315 tokens per second&lt;/strong&gt;. A whole game now takes about &lt;strong&gt;90 seconds&lt;/strong&gt; in the web app, from clicking "Review" to the finished page: around 20 for Stockfish and around 12 per note for Gemma. A full review uses roughly 2,000 to 3,000 prompt tokens and about 550 output tokens, all of them free.&lt;/p&gt;

&lt;h3&gt;
  
  
  Render
&lt;/h3&gt;

&lt;p&gt;The same Docker image runs the public demo on Render's free plan. A free instance doesn't have the memory to hold Gemma, so the demo runs Stockfish in the container and asks &lt;strong&gt;Gemma 4 26B A4B on Google AI Studio&lt;/strong&gt; for the notes. Because Gemma is an open model family, the prompts, the verifier and the model family are the same as on the laptop; only where the weights run changes. The demo takes one public game at a time; students' games belong on the coach's laptop. With the bigger hosted Gemma it's also quick: a 21-move game came back in under 30 seconds, every note passing the verifier on the first try.&lt;/p&gt;

&lt;h3&gt;
  
  
  Built with GitHub Copilot
&lt;/h3&gt;

&lt;p&gt;I built Second with GitHub Copilot's agent in VS Code as a pair programmer. It helped brainstorm and check the idea, wrote most of the code and tests, installed Ollama and Gemma on my laptop, ran the evaluation, and found the Intel GPU speed-up in Ollama's logs. GitHub Actions runs the tests against a real Stockfish and builds and smoke-tests the Render Docker image on every push.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The hard part is already open source.&lt;/strong&gt; The strongest chess engine in the world, Stockfish, is free software. A 4B language model can't play chess, and doesn't need to: open source already solved chess analysis, so all the model has to do is talk. Second is a thin layer of glue between two open projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kids' data stays at home.&lt;/strong&gt; A coach's students are children, and India's Digital Personal Data Protection Act, 2023 puts extra rules on children's personal data, including verifiable consent from a parent. With Second on the coach's own laptop, the games and names aren't handed to yet another company on top of that: no third-party processor, nothing leaving the country, nothing extra to explain to a worried parent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No bill, no card, no account.&lt;/strong&gt; Hosted models are cheap per game these days, but every one of them needs an account, an API key and usually an international credit card, which plenty of small coaches in India don't have, and the bill grows with every student. On the coach's laptop, the 40th game of the week costs exactly what the first one did: nothing. For a ₹299-a-month product, that's the only cost number that never needs checking again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No lock-in, and permission to sell.&lt;/strong&gt; Gemma 4 is released under Apache 2.0, so I can build a paid product on it without asking anyone. The same prompts run on Gemma on a laptop, on Ollama Cloud or on Google AI Studio, and I can swap in a bigger Gemma the day a coach has a bigger machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open data made the evaluation possible.&lt;/strong&gt; The Lichess database is CC0. I could test on real club games, publish every note and every score, and link each example back to the original game.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It works offline.&lt;/strong&gt; Tournament halls are famous for bad Wi-Fi. Second doesn't need any.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;This project was built in one long session with GitHub Copilot's agent: brainstorming, setup, code, tests, evaluation and this write-up's numbers. The commit history and &lt;code&gt;eval/results.json&lt;/code&gt; show the work.&lt;/p&gt;

&lt;h2&gt;
  
  
  My First User
&lt;/h2&gt;

&lt;p&gt;My first user was a friend who plays chess well. He tried Second and said that he found it pretty good for being used by coaches. It was encouraging to get that first positive response from someone outside the build process, rather than relying only on automated tests and my own expectations.&lt;/p&gt;

&lt;p&gt;His feedback was brief, so I'm treating it as an encouraging first reaction, not a detailed accuracy review. The benchmark measures specific technical checks; this was the first step towards finding out how the product feels to another chess player.&lt;/p&gt;

&lt;p&gt;The next step is to put it in a coach's weekly routine: review a student's games, use the questions during a lesson, and find out which parts actually save preparation time. That's the test I want before turning the proposed paid offering into a business.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma&lt;/strong&gt;: Gemma 4 E4B (QAT) runs locally through Ollama and writes every note, summary and multilingual parent note, grounded in engine facts and checked by a verifier. Gemma 4 26B A4B on Google AI Studio powers the public demo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of GitHub Copilot&lt;/strong&gt;: built end to end with GitHub Copilot's agent; GitHub Actions runs the tests with a real Stockfish and builds and smoke-tests the Render Docker image on every push.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Render&lt;/strong&gt;: the public demo is a Docker web service deployed on Render from a &lt;code&gt;render.yaml&lt;/code&gt; Blueprint.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>chess</category>
    </item>
  </channel>
</rss>
