<?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: XExpertAI</title>
    <description>The latest articles on DEV Community by XExpertAI (@xexpertai).</description>
    <link>https://dev.to/xexpertai</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%2F4177065%2F92520185-0ef2-4089-a143-959196194fe6.png</url>
      <title>DEV Community: XExpertAI</title>
      <link>https://dev.to/xexpertai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xexpertai"/>
    <language>en</language>
    <item>
      <title>I hired a sloth to tidy my Downloads, and it only touches what I have forgotten</title>
      <dc:creator>XExpertAI</dc:creator>
      <pubDate>Wed, 21 Oct 2026 06:42:12 +0000</pubDate>
      <link>https://dev.to/xexpertai/i-hired-a-sloth-to-tidy-my-downloads-and-it-only-touches-what-i-have-forgotten-lil</link>
      <guid>https://dev.to/xexpertai/i-hired-a-sloth-to-tidy-my-downloads-and-it-only-touches-what-i-have-forgotten-lil</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;p&gt;&lt;strong&gt;Built with Google Gemma.&lt;/strong&gt;&lt;/p&gt;

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

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

&lt;p&gt;A Downloads folder is where files go to be forgotten. &lt;code&gt;final.pdf&lt;/code&gt;, &lt;code&gt;final(2).pdf&lt;/code&gt;, &lt;code&gt;Screenshot 2026-03-18 at 19.11.33.png&lt;/code&gt;, an installer for a program you already installed. Nobody wants to open each one just to learn what it is.&lt;/p&gt;

&lt;p&gt;The usual fix is a tidy script, and a tidy script has a flaw. It moves the PDF you downloaded this morning and are about to open. So I wrote the opposite: &lt;strong&gt;sloth-sort only touches files I have ignored for a week. The lazier I am, the more it tidies. Anything I touched recently, it leaves alone, because I might still be using it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the whole idea, and it is enforced in code, not in a prompt. A file counts as touched if it was modified &lt;em&gt;or opened&lt;/em&gt; in the last 7 days. Those files are never read, never planned, never moved. For everything else, a small open-weight model (Gemma 4 E2B, 4-bit, running on a laptop CPU through llama.cpp) reads the start of each file, picks one of &lt;em&gt;my&lt;/em&gt; folders for it, and moves it. It is slow on purpose: lowest CPU priority, four threads, one file at a time. It never deletes or overwrites anything, and &lt;code&gt;sloth undo&lt;/code&gt; puts every file back, byte for byte.&lt;/p&gt;

&lt;p&gt;The setup is one &lt;code&gt;sloth.toml&lt;/code&gt;: your folder names, one line each, and the rule.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[settings]&lt;/span&gt;
&lt;span class="py"&gt;ignored_for&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"7d"&lt;/span&gt;        &lt;span class="c"&gt;# only touch files neither opened nor modified for 7 days&lt;/span&gt;

&lt;span class="nn"&gt;[folders.invoices-receipts]&lt;/span&gt;
&lt;span class="py"&gt;desc&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bills, invoices, receipts, payment confirmations and tax paperwork"&lt;/span&gt;

&lt;span class="nn"&gt;[folders.installers]&lt;/span&gt;
&lt;span class="py"&gt;desc&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Software installers and setup packages"&lt;/span&gt;
&lt;span class="py"&gt;ext&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;".exe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;".msi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;".dmg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;".deb"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;".appimage"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="c"&gt;# the baseline's guess; the model gets to disagree&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then &lt;code&gt;sloth plan&lt;/code&gt;, look at the one-page report, &lt;code&gt;sloth apply&lt;/code&gt;. Or &lt;code&gt;sloth undo&lt;/code&gt;. &lt;code&gt;--ignored-for 36h&lt;/code&gt; or &lt;code&gt;--ignored-for 0&lt;/code&gt; change the rule if you are less lazy than me.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Code (MIT): &lt;/p&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/xexpertai" rel="noopener noreferrer"&gt;
        xexpertai
      &lt;/a&gt; / &lt;a href="https://github.com/xexpertai/sloth-sort" rel="noopener noreferrer"&gt;
        sloth-sort
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A lazy Downloads tidier: a local open model (Gemma) files only what you have ignored for 7 days, with full undo.
    &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;sloth-sort&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;A lazy folder tidier that only touches what you have forgotten. &lt;strong&gt;sloth-sort only touches files I have ignored for a week. The lazier I am, the more it tidies; anything I touched recently, it leaves alone, because I might still be using it.&lt;/strong&gt; A file counts as touched if it was modified &lt;em&gt;or opened&lt;/em&gt; in the last 7 days (&lt;code&gt;--ignored-for 7d&lt;/code&gt;, changeable). For the forgotten files, a 2B open-weight model (Gemma 4 E2B, 4-bit, via llama.cpp) reads each one, picks one of &lt;em&gt;your&lt;/em&gt; folders, and moves it, slowly and at the lowest CPU priority. It never overwrites or deletes anything, and &lt;code&gt;sloth undo&lt;/code&gt; puts every file back, byte for byte.&lt;/p&gt;

&lt;p&gt;Built by &lt;strong&gt;Harsha Shinde&lt;/strong&gt; for the DEV Hacktoberfest Open-Source AI Challenge, Week 3 ("Slow and Steady"). AI-assisted: the code was written with Claude Code (the AI agent also wrote the demo generator and the labels for it)…&lt;/p&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/xexpertai/sloth-sort" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;There is no live site. The model needs a CPU and a 2.7 GB file, and I would rather say so than fake a hosted page. What you can do in about ten minutes is generate the same fictional folder and watch it work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/xexpertai/sloth-sort &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;sloth-sort   &lt;span class="c"&gt;# setup steps are in the README&lt;/span&gt;
.venv/bin/python &lt;span class="nb"&gt;eval&lt;/span&gt;/make_downloads_folder.py /tmp/demo/Downloads   &lt;span class="c"&gt;# 72 fictional files with old and recent dates&lt;/span&gt;
.venv/bin/sloth plan /tmp/demo/Downloads &lt;span class="nt"&gt;--config&lt;/span&gt; &lt;span class="nb"&gt;eval&lt;/span&gt;/downloads.toml
.venv/bin/sloth report /tmp/demo/Downloads    &lt;span class="c"&gt;# opens as one HTML page&lt;/span&gt;
.venv/bin/sloth apply /tmp/demo/Downloads &lt;span class="nt"&gt;--config&lt;/span&gt; &lt;span class="nb"&gt;eval&lt;/span&gt;/downloads.toml
.venv/bin/sloth undo  /tmp/demo/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  First, the true story: my real Downloads folder
&lt;/h2&gt;

&lt;p&gt;My real Downloads on this laptop is small: 7 files. I ran sloth on a &lt;strong&gt;copy&lt;/strong&gt; of it (made with &lt;code&gt;cp -p&lt;/code&gt;, so the dates stayed the same; I never touched the original) with the settings the repo ships with: the 7-day rule and the final prompt. Here is what it did, with the names left out because they are mine:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the file is&lt;/th&gt;
&lt;th&gt;Last touched&lt;/th&gt;
&lt;th&gt;What sloth did&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;a video (.mp4)&lt;/td&gt;
&lt;td&gt;2 days ago&lt;/td&gt;
&lt;td&gt;left alone, under the 7-day rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;another video (.mp4)&lt;/td&gt;
&lt;td&gt;3 days ago&lt;/td&gt;
&lt;td&gt;left alone, under the 7-day rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a Windows &lt;code&gt;desktop.ini&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;now&lt;/td&gt;
&lt;td&gt;left alone (sloth always skips it)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a browser installer (.exe)&lt;/td&gt;
&lt;td&gt;8.5 days ago&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;installers&lt;/code&gt;, high confidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a phone-style photo (.jpg)&lt;/td&gt;
&lt;td&gt;8.7 days ago&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;screenshots&lt;/code&gt;, high confidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a screenshot (.png)&lt;/td&gt;
&lt;td&gt;9 days ago&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;screenshots&lt;/code&gt;, high confidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;another screenshot (.png)&lt;/td&gt;
&lt;td&gt;9 days ago&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;screenshots&lt;/code&gt;, high confidence&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the 7-day rule did what it is for: the two things I worked on this week were not read, not planned, not moved. The other 4 were planned in 50.7 seconds (about 13 seconds a file), &lt;code&gt;apply&lt;/code&gt; moved them in 0.12 seconds, and &lt;code&gt;undo&lt;/code&gt; put them back. I checked the SHA-256 of all 7 files before and after: identical.&lt;/p&gt;

&lt;p&gt;Sloth moved 4 files (an installer, a phone photo and two screenshots) and left 3 alone. I haven't graded them; the photo landing in screenshots looks wrong to me. It went to &lt;code&gt;screenshots&lt;/code&gt; with "high" confidence, from its name alone, which is the blind-name habit from bug two below. So there is no accuracy number for the real folder.&lt;/p&gt;

&lt;p&gt;7 files is a small test. It shows the rule and the undo working on real data. It does not show how good the model is. For that I made a bigger, fictional folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bigger stress test (fictional 72-file folder)
&lt;/h2&gt;

&lt;p&gt;All the numbers from here down (except the "What I got wrong" notes about the 7-file run) come from a &lt;strong&gt;fictional Downloads folder&lt;/strong&gt; that the AI coding agent generated for this entry, with invented shops, invented trips and generated placeholder images. It is not my files.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Scale test
&lt;/h3&gt;

&lt;p&gt;I also planned 920 of 1,000 free-licence files (dry run, stopped early on purpose): 4.84 files a minute (about 13 s a file), the 7-day rule held (283 left alone), and the model left 448 of 637 eligible files alone. No labels, so no accuracy claim. Numbers: &lt;code&gt;eval/results/scale/scale-summary.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Credits: Wikimedia Commons file authors and Project Gutenberg; licence and author for every non-generated file are in &lt;code&gt;eval/results/scale/SOURCES.csv&lt;/code&gt;. Raw files are not in the repo.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The folder: 72 files, 14 of them "in use"
&lt;/h3&gt;

&lt;p&gt;The generator (&lt;code&gt;eval/make_downloads_folder.py&lt;/code&gt;) builds 72 files in seven kinds: invoices (PDF, text, email), screenshots (placeholder PNGs with phone-style and desktop-style names), installers (random bytes with a binary header), manuals and papers, boarding passes and hotel bookings, memes (JPG, PNG, GIF with names like &lt;code&gt;image(3).png&lt;/code&gt;), and three notes that fit nowhere. Names are deliberately useless: &lt;code&gt;final.pdf&lt;/code&gt;, &lt;code&gt;copy of copy.txt&lt;/code&gt;, &lt;code&gt;x.pdf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each file gets a date. 58 were last modified 10 to 204 days ago. 14 are "active": 11 modified in the last 6 days (a boarding pass for this week, an installer from this morning, a paper "to read tonight") and 3 that were modified long ago but &lt;strong&gt;opened&lt;/strong&gt; in the last few days, like a router manual that is 95 days old and was opened a day and a half ago. Those three are the interesting ones. If sloth only looked at modification time, it would grab a file you are literally reading.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the sloth did, and what it saved me
&lt;/h3&gt;

&lt;p&gt;On the 58 forgotten files, the baseline and the model compare like this. The baseline is what a normal tidy script does: match on the extension (&lt;code&gt;.pdf&lt;/code&gt; is a bill, &lt;code&gt;.png&lt;/code&gt; is a screenshot, &lt;code&gt;.jpg&lt;/code&gt; and &lt;code&gt;.gif&lt;/code&gt; are memes), with no age rule.&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%2F5aswrknrz8pnha28okox.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%2F5aswrknrz8pnha28okox.png" alt="Results table: extension rules versus sloth on the 58 forgotten files, and the 14 active files each approach moved" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;58 forgotten files&lt;/th&gt;
&lt;th&gt;Right moves&lt;/th&gt;
&lt;th&gt;Wrong moves&lt;/th&gt;
&lt;th&gt;Left, should have moved&lt;/th&gt;
&lt;th&gt;Left, correctly&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Extension rules, no model&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sloth, first prompt&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sloth, final prompt&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And on the 14 fictional files "in use": the extension script would have moved &lt;strong&gt;14 of 14&lt;/strong&gt;. sloth moved &lt;strong&gt;0 of 14&lt;/strong&gt;. That is the point of the tool, and it is the number I trust most, because it comes from a rule in code and not from the model being clever.&lt;/p&gt;

&lt;p&gt;The time cost, measured: in the end-to-end run, &lt;code&gt;sloth plan&lt;/code&gt; took &lt;strong&gt;9 minutes 56 seconds&lt;/strong&gt; of wall clock for 58 files (about 10.3 seconds per file, at &lt;code&gt;nice 19&lt;/code&gt;), &lt;code&gt;sloth apply&lt;/code&gt; moved 42 files in &lt;strong&gt;0.09 seconds&lt;/strong&gt;, and &lt;code&gt;sloth undo&lt;/code&gt; restored all 72 files with identical checksums (&lt;code&gt;e2e-before.sha&lt;/code&gt; and &lt;code&gt;e2e-after.sha&lt;/code&gt; in the evidence). I did not time anyone sorting this folder by hand, so I am not going to invent a minutes-saved figure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bug one: reading a file counts as opening it
&lt;/h3&gt;

&lt;p&gt;The 7-day rule uses the later of "last modified" and "last opened". My first version read each file for the model with a normal &lt;code&gt;open()&lt;/code&gt;. On a normal Linux filesystem, reading a file updates its access time. So the sorter itself made every file look freshly opened, and after one plan, a second plan found nothing to do. The rule was eating itself.&lt;/p&gt;

&lt;p&gt;I wrote a short experiment and saved the output (&lt;code&gt;atime-regression.log&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file last opened/modified 30.0 days ago; days since atime: 30.0
after a plain open()+read():   days since atime = 0.0 -&amp;gt; the file now looks fresh
after open(O_NOATIME)+read():  days since atime = 30.0 -&amp;gt; still forgotten
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fix is to open files with &lt;code&gt;O_NOATIME&lt;/code&gt; whenever sloth reads them for the model or hashes them for the undo ledger. There is a regression test (&lt;code&gt;test_planning_does_not_make_files_look_fresh&lt;/code&gt;) that ages a file 30 days, plans, hashes, and checks it is still 30 days old. The same log shows &lt;code&gt;cp -a&lt;/code&gt; has the same side effect on the &lt;em&gt;source&lt;/em&gt; folder, so the end-to-end script hashes with a helper that avoids touching access times too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bug two: a model that cannot see an image still sounds sure
&lt;/h3&gt;

&lt;p&gt;The first full run scored 46 right and &lt;strong&gt;8 wrong&lt;/strong&gt;. Every wrong move was the same mistake. Eight memes went into &lt;code&gt;screenshots&lt;/code&gt;, all with "high" confidence. Here is the model's own reason for &lt;code&gt;cat_laptop.png&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The file name 'cat_laptop.png' strongly suggests it is an image, and the 'screenshots' folder is the most appropriate...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It cannot see the picture. Gemma 4 E2B in this setup reads text, not pixels, so for an image it has only the file name. And "an image" plus a folder called screenshots is enough for it to say "high". A confidence guard does not help when the model is confidently wrong.&lt;/p&gt;

&lt;p&gt;The fix is a rule in the prompt for files with nothing to read: you cannot see inside this file, go by the name only, and answer &lt;code&gt;leave&lt;/code&gt; unless the name itself says where it belongs. A name like &lt;code&gt;Screenshot 2026-03-18 at 19.11.33.png&lt;/code&gt; does. &lt;code&gt;image(3).png&lt;/code&gt; does not. The result is in the second table: 8 wrong moves became 0. The price is also in the table: &lt;strong&gt;13 files that should have moved were left where they were&lt;/strong&gt;, 12 of them memes and one a browser archive. For a lazy tidier that trade is fine. A file left alone costs you nothing, and a file in the wrong folder costs you a hunt later.&lt;/p&gt;

&lt;p&gt;I should say clearly that I wrote this prompt after seeing these 8 errors on this same folder, so "0 wrong" is not a score on unseen files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bug three: the same settings, two different answers
&lt;/h3&gt;

&lt;p&gt;After the prompt change I ran the whole thing end to end with the same settings, and I ran the eval a second time. Both gave the same result: 42 right, &lt;strong&gt;0&lt;/strong&gt; wrong, 13 left.&lt;/p&gt;

&lt;p&gt;That was not the whole story in my first version of this entry. Before 21 October I had the same two runs with brand-named installers in the demo folder, and they disagreed: the eval run had 1 wrong (&lt;code&gt;when_the_build_passes.jpg&lt;/code&gt; went to &lt;code&gt;screenshots&lt;/code&gt; with high confidence) and the end-to-end run had 0 wrong. I then renamed every demo installer to a generic name (no brand names anywhere in the demo files, the video or the results) and re-ran everything for real. The first-prompt row moved by one file as well (47/8/0 before, 46/8/1 now). Both sets of results are real; the earlier ones are in the git history.&lt;/p&gt;

&lt;p&gt;So the model is not fully deterministic here. Across the runs I have, the final prompt made between 0 and 1 wrong move in 58 files, and I would not claim anything finer from a folder this size. The saved files are &lt;code&gt;downloads-eval-run2-blindname-prompt.json&lt;/code&gt; and &lt;code&gt;e2e-score.json&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it is slow on purpose
&lt;/h3&gt;

&lt;p&gt;The model server runs with four threads under &lt;code&gt;nice&lt;/code&gt;, and the sorter runs at &lt;code&gt;nice 19&lt;/code&gt;. &lt;code&gt;--pace 60&lt;/code&gt; makes it rest a minute between files, if you want the sloth literally. But the real slowness is the week of waiting. The CPU priority is just courtesy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Undo is the feature that lets me be lazy
&lt;/h3&gt;

&lt;p&gt;I would not run a tidier on a real folder if I could not reverse it. Every move goes into a ledger with the file's SHA-256. &lt;code&gt;undo&lt;/code&gt; replays it backwards and refuses a file if the moved copy has been edited since. The code, not the model, owns the dangerous parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the model answers with grammar-constrained JSON: a folder from my list, or &lt;code&gt;leave&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;low confidence means the file stays put, and a file the model cannot read as text moves only on high confidence&lt;/li&gt;
&lt;li&gt;it never overwrites (a clash gets a &lt;code&gt;-1&lt;/code&gt;), skips symlinks and dotfiles, and skips every file touched in the last 7 days&lt;/li&gt;
&lt;li&gt;if a file changed between plan and apply, that file is refused&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I got wrong
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The real-folder run is only 7 files and I have not labelled the 4 moves, so it is a demo of the rule and of undo, not a score.&lt;/li&gt;
&lt;li&gt;An earlier test on a different folder is in &lt;code&gt;eval/results/round1/&lt;/code&gt;. Its labels and the strict rule for it were written by the agent, not by me.&lt;/li&gt;
&lt;li&gt;I trusted "high confidence" at first. In the eight meme cases it meant nothing.&lt;/li&gt;
&lt;li&gt;The rule counts access time, and access time is only as honest as the filesystem. On a &lt;code&gt;noatime&lt;/code&gt; mount, opening a file does not count, so only modification time protects you. I tested on ext4 with the default &lt;code&gt;relatime&lt;/code&gt;, nowhere else.&lt;/li&gt;
&lt;li&gt;The prompt fix and the numbers come from the same 72 files. They are not a held-out test.&lt;/li&gt;
&lt;li&gt;The reasons the model writes are sometimes cut off mid-sentence, because I capped its answer at 120 tokens. The report page now ends them at the last whole word with "...".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scripts/install-timer.sh&lt;/code&gt; sets up a nightly systemd timer. I wrote it and did not install it on my machine for this entry, so I will not tell you it works.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it can't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It reads only the first 1,200 characters of each file. A long document that changes subject halfway is sorted by its start.&lt;/li&gt;
&lt;li&gt;Images, audio and video are sorted by name only, and only when the name is clear.&lt;/li&gt;
&lt;li&gt;It is a 2B model. It is sometimes wrong in a confident voice. That is why undo exists.&lt;/li&gt;
&lt;li&gt;I tested English files only, and no files were in subfolders.&lt;/li&gt;
&lt;li&gt;I did not test a closed model, so I cannot say how it would do on the same 72 files.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The payoff I can measure, on the fictional folder: 14 files "in use" were left alone, 42 forgotten files were filed, and it took 9 minutes 56 seconds of machine time that I did not have to sit through, plus a single &lt;code&gt;apply&lt;/code&gt; that took less than a second. The payoff I cannot measure yet: how long a person takes to sort 58 old files by hand. Nobody timed it, so the post makes no claim about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Open Innovation Matters
&lt;/h2&gt;

&lt;p&gt;A Downloads folder is private: bills, tickets, screenshots of things I would not paste into a chat box. With an open model, the file names and the first 1,200 characters of each file never leave the machine, and I did not need an account or a per-file fee to find out whether the idea works. The model is one 2.7 GB file that I can swap by changing a name in a script. A closed model might read the memes better, because several of them are the kind of thing a vision model would get right. I did not test that. For a tool that runs on every folder I own, forever, "free, private, and I can replace it" matters more to me than the last few points of accuracy.&lt;/p&gt;

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

&lt;p&gt;This project was built with Claude Code as the coding agent. I decided the idea. The agent wrote the code, the fictional-folder generator, the labels, the evaluation scripts and the first draft of this post, and it ran the evaluations you see above. I reviewed the logic and the results. The 7-day rule and the access-time fix were both made in that agent session, and the log in the evidence folder shows the bug that led to the fix.&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 E2B is the whole decision step for forgotten files: it reads each one and picks a folder under a JSON schema, on a laptop CPU with no network. The code around it (the 7-day rule, the blind-name prompt, the confidence guard, never-overwrite, the undo ledger) exists because a 2B model is confidently wrong in specific places, and the tables above show where.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;AI assistance: the code, the evaluation scripts, the demo folder generator, the screenshots and a first draft of this post were produced with an AI coding agent (Claude Code). I checked the logic and reviewed the results. The video narration is an AI voice (open-source Kokoro).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Demo data: the 72 files in the big tables are fictional, made by &lt;code&gt;eval/make_downloads_folder.py&lt;/code&gt;. The 7-file section is my real Downloads, names left out. Post by Harsha Shinde.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The rabbit night light sold 4,452. My forecast said 1,249.</title>
      <dc:creator>XExpertAI</dc:creator>
      <pubDate>Sat, 17 Oct 2026 07:03:39 +0000</pubDate>
      <link>https://dev.to/xexpertai/bill-no-maal-kitne-a-weekly-restock-note-for-a-shop-that-counts-stock-by-hand-on-two-open-models-mm4</link>
      <guid>https://dev.to/xexpertai/bill-no-maal-kitne-a-weekly-restock-note-for-a-shop-that-counts-stock-by-hand-on-two-open-models-mm4</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;p&gt;&lt;strong&gt;Built with PriorLabs-TabPFN.&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;On Sunday 27 November 2011, a small online gift shop asks its restock tool what to order for the week ahead. The tool says: expect about 1,250 rabbit night lights, and have up to 2,592 ready for a busy week.&lt;/p&gt;

&lt;p&gt;The shop sells &lt;strong&gt;4,452&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That week is the one I want to show first. It is the clearest case of what &lt;strong&gt;tidy-predict&lt;/strong&gt; gets wrong, and it is also a fair way to see what it gets right.&lt;/p&gt;

&lt;p&gt;Why I built it: I know a shop that manages its stock by hand, and it makes many mistakes. It sometimes cannot get the item that is in demand, and sometimes buys an item nobody wants. This is my attempt at that problem. That shop has not used it, and nobody has: the story below uses a made-up shop and a public file.&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%2F1ehewa4dwunyuuu8m637.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%2F1ehewa4dwunyuuu8m637.gif" alt="tidy-predict in use: the file drop, Gemma reading two odd headers, the progress log (real run, sped up)" width="560" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;42 seconds, narrated. The shop is fictional and the data is demo data; both are labelled in the video. Narration is an AI copy of my own voice, generated from a voice sample I recorded and agreed to use (open-source Chatterbox, MIT licence).&lt;/em&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%2F41c3rruutkeyhj4enpgy.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%2F41c3rruutkeyhj4enpgy.png" alt="The replay page: the red harmonica row carries a " width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  One shop, one week, one dataset
&lt;/h3&gt;

&lt;p&gt;The shop is &lt;strong&gt;fictional&lt;/strong&gt;: a small online seller of gift items who guesses next week's stock by eye. Her orders are stood in for by a public export from a real UK online gift shop, &lt;a href="https://archive.ics.uci.edu/dataset/502/online+retail+ii" rel="noopener noreferrer"&gt;UCI Online Retail II&lt;/a&gt; (1,067,371 order lines, 2009 to 2011, CC BY 4.0). Everything in this post is a &lt;strong&gt;replay&lt;/strong&gt; of that file. I pretend today is Sunday 27 Nov 2011, forecast the week of 28 Nov, and then look at what really sold.&lt;/p&gt;

&lt;p&gt;tidy-predict takes the messy order export and gives back three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a cleaned file, with every set-aside row listed with its reason;&lt;/li&gt;
&lt;li&gt;next week's expected units for her 20 regular sellers, each with a likely range, a &lt;strong&gt;chance of selling out&lt;/strong&gt;, and a &lt;strong&gt;"wide range: check by hand"&lt;/strong&gt; flag where the range is too wide to order from;&lt;/li&gt;
&lt;li&gt;a short restock note in plain English.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both models run on the laptop's CPU. The orders never go to an AI API. The steps are fixed: clean, forecast with TabPFN-2, write with Gemma 4 E2B, check every number, retry once or fall back to a template.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The report page from this run, as a static replay:&lt;/strong&gt; &lt;a href="https://xexpertai.github.io/tidy-predict/" rel="noopener noreferrer"&gt;28 Nov 2011 report&lt;/a&gt;. It is public demo data, with no model running on the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The week it got wrong
&lt;/h2&gt;

&lt;p&gt;Here is the note Gemma wrote, one sentence of it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The biggest expected drop is for the Rabbit night light down 58%.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The model had seen rabbit night lights sell 2,971 a week over the last four weeks. It expected them to fall to 1,249. They went to 4,452, their second-best week in the whole file. My guess is the start of the December rush broke the usual pattern.&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%2Fmjk8du4xpxowhht90jmy.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%2Fmjk8du4xpxowhht90jmy.png" alt="Four products: forecast range, expected value, 4-week average, and what really sold" width="800" height="1112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Made from the run's own numbers. Each row has its own scale. Orange dots sold above the range.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Two products sold above their range: the rabbit night light and the small popcorn holder (3,271 against a busy-week number of 2,596). 17 landed inside their range and one sold below it. Added up, the 20 middle numbers said 13,386 units and the shop sold 19,101.&lt;/p&gt;

&lt;p&gt;The sell-out chance did not save me either. At a stock level equal to its busiest of the last 4 weeks (4,265), the rabbit night light had a &lt;strong&gt;5%&lt;/strong&gt; chance of selling out. Demand that week was 4,452, a little above even that.&lt;/p&gt;

&lt;p&gt;The two products the note named as most likely to sell out (67% and 47%) sold 148 and 689 against busiest-of-4 levels of 272 and 1,170. They did not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The harmonica
&lt;/h2&gt;

&lt;p&gt;An earlier version of this note told the shop to have &lt;strong&gt;2,993 red harmonicas&lt;/strong&gt; ready. That item sold 22 the week before. The 2,993 is the top of a very wide range (44 to 2,993), a ceiling for a lumpy item, not a number to order. A shop owner reading it would have been right to ignore the whole note. It sold 1,120 that week, inside the range, so the range was honest and the advice was useless.&lt;/p&gt;

&lt;p&gt;The fix is a flag, not a cleverer model. Any product whose P90 is more than 10 times its P10, or whose last week was under a quarter of its 4-week average, is marked &lt;strong&gt;"wide range: check by hand"&lt;/strong&gt; in the table, is left out of the "most stock" sentence and of the rise, drop and sell-out sentences, and is named in its own sentence with no stock number. Gemma's prompt now asks for that sentence. In this replay it flags two products, the red harmonica and the pack of 12 london tissues (last week 100 against an average of 598). The check on the note's numbers is unchanged.&lt;/p&gt;

&lt;p&gt;That is one week. The next section is the other 239 product-weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What TabPFN is for, and what it is not
&lt;/h2&gt;

&lt;p&gt;TabPFN is a tabular foundation model. It reads the training rows in one pass and gives back a full distribution for each product, not just one number. I used TabPFN-2 and trained nothing.&lt;/p&gt;

&lt;p&gt;Here is the honest score on 12 held-out weeks (240 product-weeks), picked once and run once, against the strongest simple rival I could build: the 4-week average times a factor fitted on two earlier months of this shop.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;240 held-out product-weeks&lt;/th&gt;
&lt;th&gt;TabPFN-2&lt;/th&gt;
&lt;th&gt;Tuned 4-week average&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Real sales inside the P10 to P90 range (target 80%), and how wide the range was&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;80.0%&lt;/strong&gt;, 1.50x sales&lt;/td&gt;
&lt;td&gt;85.4%, 1.78x sales&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stocking to the busy-week number: units left over / units short&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;160k&lt;/strong&gt; / 19.5k&lt;/td&gt;
&lt;td&gt;178k / &lt;strong&gt;13.0k&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Middle number: average miss as a share of units sold&lt;/td&gt;
&lt;td&gt;0.502&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.486&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read it plainly. &lt;strong&gt;The middle number is a tie, and the simple rule is slightly better.&lt;/strong&gt; I am not going to dress that up.&lt;/p&gt;

&lt;p&gt;What the distribution gives that an average cannot is a range that is calibrated (exactly 80.0% inside, with no per-shop tuning) and a probability. A tuned average has no chance of selling out to offer.&lt;/p&gt;

&lt;p&gt;I scored that probability too, and the first version lost to a constant (Brier 0.250 vs 0.241, with the 4-week average as the stock stand-in, because the data has no real stock levels). So I fixed the split by time before looking (weeks 1 to 6 to fit, 7 to 9 to choose, 10 to 12 to test once) and chose the stand-in on the choosing weeks: the busiest of the last 4 weeks, no calibration (Platt and isotonic were worse; numbers in &lt;code&gt;eval/results/sellout_recalibrated.json&lt;/code&gt;). On the untouched test weeks it beats a constant by a hair, on five events, so it is a &lt;strong&gt;ranking signal, not a probability to bet on&lt;/strong&gt;: over all 240 product-weeks, the highest-flagged third sold above the stand-in 27.5% of the time, the lowest third 8.8%.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test weeks only (60 product-weeks, 5 sell-outs)&lt;/th&gt;
&lt;th&gt;Sell-out chance&lt;/th&gt;
&lt;th&gt;Always say the base rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Brier score, lower is better&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.0903&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.0942&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why TabPFN-2 and not 3.5.&lt;/strong&gt; Prior Labs recommends TabPFN-3.5 for this kind of agent. I did not run it. Its weights need a Prior Labs account and a licence acceptance (the download stops with "requires a one-time license acceptance"), and I did not sign up for one for this entry. It is also free for research only; commercial use needs a paid licence. TabPFN-2 is Apache 2.0 with an attribution clause, so a weekly paid service can be built on it from day one. &lt;code&gt;eval/backtest_versions.py&lt;/code&gt; runs the same 240 product-weeks on any version, so the comparison is one command once a token is set.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Finding the columns.&lt;/strong&gt; Plain rules read common headers first. The export in the demo uses plain English headers: Order No, SKU, Item, Pieces, Day Sold, Unit Price, Customer, Country. The rules cannot place "Pieces" and "Day Sold", so Gemma 4 E2B is asked, and a JSON schema means it can only answer with real header names. In the live run it read Day Sold as the date and Pieces as the quantity. On 12 header sets I wrote while building (so treat it as optimistic), rules alone got 3, rules plus Gemma 12, with 0 wrong guesses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Cleaning, with nothing deleted silently.&lt;/strong&gt; Of 1,067,371 lines, 997,117 stay as sales. The other 70,254 are duplicates, returns, postage and fees, each listed in &lt;code&gt;issues.csv&lt;/code&gt; with its reason.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Forecasting.&lt;/strong&gt; One TabPFN-2 model covers the 20 regular sellers. It uses only past weeks: recent weeks, the same week last year, a few averages and the week of the year.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Gemma writes, code checks.&lt;/strong&gt; Gemma sees a small facts table. A checker pulls every number out of its draft and rejects the draft if any number is not in the facts. On 12 test weeks, with the v9 prompt (which adds the check-by-hand sentence and builds the advice only from products that are not flagged), all 12 first drafts passed the check, at a median of 49 seconds each on the CPU. The flag fires often: on 41 of the 240 test product-weeks, and in all 12 weeks, so roughly one product in six is handed back to a person.&lt;/p&gt;

&lt;p&gt;The checker cannot tell whether a number sits next to the right product, so I read the notes myself. An early prompt leaked field names into the text ("change vs 4wk avg pct of -53"). The checker passed it. A person would not have.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I got wrong, and what it cannot do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;My first Gemma header mapping made 4 wrong guesses out of 12. It now fills only the three required gaps.&lt;/li&gt;
&lt;li&gt;The "not a product" rule treats stock codes with no digits as postage or fees. In the demo data it also set aside 50 lines with real-looking codes like &lt;code&gt;DCGSSGIRL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It forecasts &lt;strong&gt;regular sellers only&lt;/strong&gt; (sold in at least 20 of the last 26 weeks), one week ahead. Holidays are handled only through "week of the year" and last year's same week. The 28 Nov miss is the proof.&lt;/li&gt;
&lt;li&gt;The sell-out chance assumes the shop stocks the busiest of its last 4 weeks. A real shop would give its actual stock. It is a ranking signal, and on the test weeks it beat a constant by a hair.&lt;/li&gt;
&lt;li&gt;The "check by hand" flag uses two thresholds I chose by looking at the harmonica (P90 over 10 times P10, or last week under a quarter of the average). They are not tuned or tested beyond this one replay and the unit test.&lt;/li&gt;
&lt;li&gt;It is one dataset and 12 weeks. Test it on a shop's own history before promising anything.&lt;/li&gt;
&lt;li&gt;The shop is fictional and the data is a public 2011 UK export. &lt;strong&gt;Nobody has used this yet. Nobody has paid, and I am not claiming a user.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who would pay
&lt;/h2&gt;

&lt;p&gt;The person I have in mind owns a small online shop and orders stock every week from a spreadsheet and a gut feeling. What they would get: a clean file, a range for each regular seller, a chance of selling out, and a note they can read in one minute.&lt;/p&gt;

&lt;p&gt;I have not priced it, sold it or asked anyone to pay. The cost side is measured: on the full 1-million-row file one run took 54 seconds on an otherwise idle 2019 laptop CPU (40 seconds without Gemma), with no API tokens. The run recorded for the video took 147 seconds, with a browser recording alongside.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why open models
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The licence is the business model.&lt;/strong&gt; TabPFN-2 and Gemma 4 are both open (Apache 2.0, with TabPFN's attribution line). I can run a weekly service on them from day one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The orders stay on the laptop.&lt;/strong&gt; The forecast was run on the full demo file inside a Linux network namespace with no network at all, and it finished (&lt;code&gt;eval/results/offline_check.log&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No cost per run.&lt;/strong&gt; No API key, no metered tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open weights can be bent to the job.&lt;/strong&gt; Gemma's answers are forced into a JSON schema and its thinking mode is off for CPU speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it yourself
&lt;/h2&gt;

&lt;p&gt;Needs Python 3.10+, about 3.5 GB of disk and about 3 GB of free RAM. No GPU, no API keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/xexpertai/tidy-predict &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;tidy-predict
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install &lt;/span&gt;torch &lt;span class="nt"&gt;--index-url&lt;/span&gt; https://download.pytorch.org/whl/cpu
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;".[dev]"&lt;/span&gt;
scripts/get-model.sh          &lt;span class="c"&gt;# llama.cpp + Gemma 4 E2B + TabPFN-2 weights&lt;/span&gt;
scripts/start-model.sh &amp;amp;      &lt;span class="c"&gt;# local model server&lt;/span&gt;
tidy-predict serve            &lt;span class="c"&gt;# open http://127.0.0.1:8765, pick the export, click "Make the restock note"&lt;/span&gt;
&lt;span class="c"&gt;# or: tidy-predict orders.csv --out out/      (add --no-llm for a template note)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;a href="https://github.com/xexpertai/tidy-predict" rel="noopener noreferrer"&gt;https://github.com/xexpertai/tidy-predict&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MIT licence. 31 tests. A script behind every number in this post.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of TabPFN:&lt;/strong&gt; TabPFN-2 is the forecasting step of a small prediction agent (clean, forecast, write, check). With no per-shop tuning its likely ranges came out calibrated (80.0% inside, target 80%), and the same distribution gives each product a chance of selling out. I scored it against what really sold, found it lost to a constant, re-chose the method on separate weeks and report it on held-out weeks as a ranking signal. The middle forecast ties a tuned average, and this post says so.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Gemma 4 E2B runs locally. It reads the headers the rules cannot place, under a JSON schema, and writes the note under a number checker.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;AI assistance: this project, including the code, the evaluation, the video and a first draft of this post, was built with an AI coding agent (Claude Code). I checked the logic, reviewed the code and changed some flows.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Demo data: UCI Online Retail II, CC BY 4.0 (Chen, 2012, doi:10.24432/C5CG6D). The shop owner in the story and video is fictional. Narration in the video is an AI voice generated from my own voice sample. Post by Harsha Shinde.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Outside Hour: a local Gemma model that wants you off your phone in 60 seconds</title>
      <dc:creator>XExpertAI</dc:creator>
      <pubDate>Sun, 11 Oct 2026 20:24:05 +0000</pubDate>
      <link>https://dev.to/xexpertai/outside-hour-a-local-gemma-model-that-wants-you-off-your-phone-in-60-seconds-564b</link>
      <guid>https://dev.to/xexpertai/outside-hour-a-local-gemma-model-that-wants-you-off-your-phone-in-60-seconds-564b</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Most "get outside" apps want one more scroll. &lt;strong&gt;Outside Hour&lt;/strong&gt; gives itself &lt;strong&gt;60 seconds of your attention&lt;/strong&gt;, and&lt;br&gt;
shows it: a ring in the corner counts down while the page is on your screen. You tell it where you are and how&lt;br&gt;
long you have. A Gemma model running on my laptop picks one real park, lake or garden nearby and writes a pocket&lt;br&gt;
card. When the minute is up, the ring turns red, the page dims and asks you to put the phone down. Then the&lt;br&gt;
screen goes black, and the biggest thing on it is your turn-back time: &lt;em&gt;07:40&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Use it the evening before: plan tomorrow's 7 a.m. walk tonight, so the morning needs no screen at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The card has five things:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where to go:&lt;/strong&gt; one real place within walking distance, from OpenStreetMap, and what is mapped there (Lotus
Pond and Bamboo Island Pond inside Cubbon Park, 66 mapped trees, 89 benches).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Which way:&lt;/strong&gt; a compass arrow with the bearing and the straight-line distance, worked out in code from the
coordinates and labelled "straight line, not a route". No map tiles, no map service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When to turn back:&lt;/strong&gt; leave, turn-back and home times, cut short so you're back before sunset.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three things to notice&lt;/strong&gt; at &lt;em&gt;that&lt;/em&gt; place in &lt;em&gt;that&lt;/em&gt; light: the water surface at Lotus Pond, dew and long
shadows at 7 a.m., the sky changing before sunset.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What to bring&lt;/strong&gt; for the forecast: rain, UV, heat, wind, air quality, a torch after dark.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Then three ways off the screen:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Phone down:&lt;/strong&gt; a black screen with the place, the direction and a huge turn-back time, plus two meters: time
&lt;strong&gt;on this screen&lt;/strong&gt; and time &lt;strong&gt;away from it&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Print pocket card:&lt;/strong&gt; an A6-wide card for your pocket, so the phone can stay home.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn-back alarm (.ics):&lt;/strong&gt; a calendar event whose alarm goes off at turn-back time. The phone's own clock does
the reminding, so the app can be closed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The meters are honest about what a web page can know.&lt;/strong&gt; They use the browser's Page Visibility API: time counts&lt;br&gt;
only while the page is visible, and "away" is the time it has been hidden since you tapped Phone down. It can't see&lt;br&gt;
other apps, and the screen says so.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One rule shaped the design:&lt;/strong&gt; anything that could hurt you if it were wrong (the place, walking times, turn-back&lt;br&gt;
time, direction, sunset, weather) comes from code and open data. Gemma only chooses between real places and&lt;br&gt;
writes the words.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;th&gt;Pocket card&lt;/th&gt;
&lt;th&gt;Phone down&lt;/th&gt;
&lt;th&gt;Printed card&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&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%2Feu8r6q04k7u6khtnvxou.png" alt="Form with the 60-second ring" width="800" height="1731"&gt;&lt;/td&gt;
&lt;td&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%2F78lhmlzmsdijfrmukdmp.png" alt="Pocket card for Cubbon Park" width="800" height="1731"&gt;&lt;/td&gt;
&lt;td&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%2Fcoq0cbuwt44a6k1o2mds.png" alt="Phone-down screen" width="780" height="1688"&gt;&lt;/td&gt;
&lt;td&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%2Fqb2s6xlxjqc6q40hb2jr.png" alt="Printable pocket card" width="800" height="1882"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Real run on my laptop CPU, no GPU, at phone size. The start is MG Road metro station in Bengaluru, a public place&lt;br&gt;
I used as a demo location; the plan is for 60 minutes at 07:00 the next morning, because I made it at night.&lt;br&gt;
Places, times and weather are real OpenStreetMap and Open-Meteo data from 11 October 2026. In the phone-down&lt;br&gt;
screenshot, the 20 seconds "away" come from a simulated phone lock in my recording script (headless browsers never&lt;br&gt;
hide a page); on a real phone, locking the screen does the same thing.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/Tsh3luZPPXA" width="710" height="399"&gt;
  &lt;/iframe&gt;
&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%2Fy68d5wyo1lbcn3ksjvk5.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%2Fy68d5wyo1lbcn3ksjvk5.gif" alt="Outside Hour: pocket card, the 60-second ring running out, phone down" width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Demo video (81 s, voiceover):&lt;/strong&gt; &lt;a href="https://youtu.be/Tsh3luZPPXA" rel="noopener noreferrer"&gt;YouTube&lt;/a&gt; (also in the repo as &lt;a href="https://github.com/xexpertai/outside-hour/blob/main/demo/outside-hour-demo-v2.mp4" rel="noopener noreferrer"&gt;outside-hour-demo-v2.mp4&lt;/a&gt;).
The same real phone-size run, framed and zoomed: the 29 s model wait is cut, a few moments are held so you can
read them, and the simulated-lock "away" part runs at 4× speed. All three are labelled on screen. A second real
run (Lalbagh, 45 min, 17:30) closes it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Earlier desktop demo:&lt;/strong&gt; &lt;a href="https://github.com/xexpertai/outside-hour/blob/main/demo/outside-hour-demo.mp4" rel="noopener noreferrer"&gt;51 s, captioned&lt;/a&gt; and &lt;a href="https://github.com/xexpertai/outside-hour/blob/main/demo/outside-hour-demo-realtime.mp4" rel="noopener noreferrer"&gt;73 s, uncut real time&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&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/xexpertai" rel="noopener noreferrer"&gt;
        xexpertai
      &lt;/a&gt; / &lt;a href="https://github.com/xexpertai/outside-hour" rel="noopener noreferrer"&gt;
        outside-hour
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Outside Hour: one honest plan to get outside, written by a local Gemma model on your laptop. DEV Hacktoberfest 2026 Week 1.
    &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;Outside Hour&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;A pocket card for one short trip outside, from a local Gemma model, on a page that gives itself 60 seconds of
your attention.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Outside Hour looks up real parks, lakes, gardens and viewpoints near you on OpenStreetMap, and what is mapped
inside them (named ponds, trees, benches, drinking-water taps). It checks the weather, sunset and air quality on
Open-Meteo, and asks &lt;strong&gt;Gemma 4 E2B, an open-weight model running on your own CPU&lt;/strong&gt;, to pick one place and write a
short pocket card: where to go, when to turn back, three things to notice there, and what to bring. Then it gets
out of the way: a black "phone down" screen, a printable card, and a calendar alarm for the turn-back time.&lt;/p&gt;
&lt;p&gt;Built for the DEV × Hacktoberfest 2026 Open-Source AI Challenge, Week 1: "Touch Grass".&lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;th&gt;Pocket card&lt;/th&gt;
&lt;th&gt;Phone down&lt;/th&gt;
&lt;th&gt;Printed card&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/xexpertai/outside-hour/demo/shots-v2/1-form.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%2Fxexpertai%2Foutside-hour%2FHEAD%2Fdemo%2Fshots-v2%2F1-form.png" alt="Form"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/xexpertai/outside-hour/demo/shots-v2/2-card.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%2Fxexpertai%2Foutside-hour%2FHEAD%2Fdemo%2Fshots-v2%2F2-card.png" alt="Card"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/xexpertai/outside-hour/demo/shots-v2/3-phone-down.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%2Fxexpertai%2Foutside-hour%2FHEAD%2Fdemo%2Fshots-v2%2F3-phone-down.png" alt="Phone down"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a rel="noopener noreferrer" href="https://github.com/xexpertai/outside-hour/demo/shots-v2/4-print-card.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%2Fxexpertai%2Foutside-hour%2FHEAD%2Fdemo%2Fshots-v2%2F4-print-card.png" alt="Print"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Screenshots are from one…&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/xexpertai/outside-hour" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;MIT licensed. Two scripts download llama.cpp and the model into the project folder (no sudo, no GPU, no API keys).&lt;br&gt;
Tests run offline against recorded data.&lt;/p&gt;

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

&lt;p&gt;About 1,500 lines of standard-library Python plus a one-page HTML and JavaScript front end (no build step, no&lt;br&gt;
CDN), built on four open pieces:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fetch.&lt;/strong&gt; One &lt;a href="https://overpass-api.de" rel="noopener noreferrer"&gt;Overpass&lt;/a&gt; query gets every &lt;em&gt;named&lt;/em&gt; park, garden, water body, viewpoint
and footpath within walking range from &lt;a href="https://www.openstreetmap.org/copyright" rel="noopener noreferrer"&gt;OpenStreetMap&lt;/a&gt; (ODbL). A
second, optional query gets what makes a place specific: unnamed ponds, individually mapped trees, benches,
taps, toilets, playgrounds. &lt;a href="https://open-meteo.com" rel="noopener noreferrer"&gt;Open-Meteo&lt;/a&gt; (CC BY 4.0) gives the forecast, sunrise,
sunset and air quality for exactly my time window. Everything is cached, with a proper User-Agent and slow
retries, because the public Overpass servers are shared (I hit plenty of 504s while building this).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute.&lt;/strong&gt; Code works out walking time (4.5 km/h, times 1.3 because paths are never straight), time there,
turn-back time, the sunset cut-off, the light ("early morning", "before sunset"), and the bearing and
straight-line distance to the nearest edge of each place. It also works out what is mapped inside each place's
outline. It skips cemeteries, drains, private land and unnamed spots, and ranks the rest by kind, size and
distance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask Gemma.&lt;/strong&gt; &lt;a href="https://huggingface.co/google/gemma-4-E2B-it" rel="noopener noreferrer"&gt;Gemma 4 E2B-it&lt;/a&gt; (Apache 2.0, Q4_0 GGUF, 2.84 GB)
runs in &lt;a href="https://github.com/ggml-org/llama.cpp" rel="noopener noreferrer"&gt;llama.cpp&lt;/a&gt;'s &lt;code&gt;llama-server&lt;/code&gt; (MIT). It gets the five best
candidates as JSON, each with its named ponds, what else is mapped there and "notice" ideas built from those
features and the light. It returns one &lt;code&gt;place_id&lt;/code&gt;, a headline, a "why", three things to notice and a
phone-down line. The &lt;code&gt;place_id&lt;/code&gt; is an &lt;code&gt;enum&lt;/code&gt; in a JSON schema, so it &lt;em&gt;cannot&lt;/em&gt; pick a place I didn't fetch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check.&lt;/strong&gt; A validator rejects the draft if it names a place that isn't in the map data, talks up a different
place, uses a number or clock time that isn't in the facts, mentions water or a view the map doesn't support,
uses stock filler ("offers a pleasant spot"), or looks cut off. One retry, then a plain template. Every card
says who wrote it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Two bugs that taught me how Gemma 4 behaves on a CPU
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Thinking skipped the grammar.&lt;/strong&gt; Through the chat endpoint, Gemma 4 sometimes "thought" for 400 tokens before
writing any JSON, and the grammar never kicked in: about 47 seconds, no answer. Rendering the chat template myself
(llama-server's &lt;code&gt;/apply-template&lt;/code&gt;) and sending it to &lt;code&gt;/completion&lt;/code&gt; put the grammar on the very first token. Since
then, every answer in my benchmark has been valid JSON.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Length limits cut sentences.&lt;/strong&gt; A &lt;code&gt;maxLength&lt;/code&gt; in the schema doesn't make the model write shorter; it stops it
mid-word. One early line ended "…focus on the" plus a stray Korean character. I loosened the limits, asked for
"one sentence under 15 words", and added checks for cut-off text and non-English characters. The turn-back time
is now added by code, so the model can't get it wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Making a 2B model specific
&lt;/h3&gt;

&lt;p&gt;My first cards were true but bland: "Enjoy the park's shade and greenery" (from my first benchmark, &lt;code&gt;docs/bench-results.json&lt;/code&gt;). The model only knew a place's name and&lt;br&gt;
kind, so that was all it could say. The fix was better facts, not a longer lecture. Each candidate now arrives&lt;br&gt;
with its named ponds, what OpenStreetMap maps inside it (trees, benches, a tap; without counts, so it doesn't&lt;br&gt;
quote survey numbers), and notice ideas that depend on those features and on the light. Now the same model writes&lt;br&gt;
"Look at the water surface for one full minute at the Lotus Pond" for Cubbon Park at 7 a.m. The checker learned&lt;br&gt;
too: "pond" is allowed only when the map has water there, and a short list of stock phrases is rejected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measured on my laptop
&lt;/h3&gt;

&lt;p&gt;Intel Core i5-1035G1 (4 cores, 8 threads, 2019), no GPU, 10 GB RAM, WSL2. Ten plans from &lt;code&gt;scripts/bench.py&lt;/code&gt;&lt;br&gt;
(2 cities, 3 start points, 30–90 minutes, morning to evening), on cached map data, with the current prompt:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Plans written by Gemma (not the fallback template)&lt;/td&gt;
&lt;td&gt;10 of 10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Drafts rejected by the checker&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time per plan, median (min–max)&lt;/td&gt;
&lt;td&gt;28.7 s (24.0–32.3 s)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prompt, median&lt;/td&gt;
&lt;td&gt;~1,250 tokens (~860 new, the rest reused from cache), processed at 55 tokens/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output, median&lt;/td&gt;
&lt;td&gt;134 tokens at 9.7 tokens/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cards that mention something mapped at the chosen place&lt;/td&gt;
&lt;td&gt;7 of 10 (a simple word match)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;llama-bench&lt;/code&gt; prompt / generation, 4 threads&lt;/td&gt;
&lt;td&gt;61.9 / 9.4 tokens/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;llama-server memory after a plan&lt;/td&gt;
&lt;td&gt;about 4.3 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The richer prompt costs about 4 seconds per plan compared with my first version (median 24.8 s). The laptop was&lt;br&gt;
doing other work too, so times vary. Using the 4 physical cores was a little faster in my runs than all 8 threads&lt;br&gt;
(generation 9.4 vs 7.5 tokens/s, but noisy), so the start script uses physical cores.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Open weights let me control the model, not just prompt it.&lt;/strong&gt; With a closed API I could only &lt;em&gt;ask&lt;/em&gt; the model not&lt;br&gt;
to invent places. With Gemma in llama.cpp I made choosing an unfetched place impossible with a grammar, switched&lt;br&gt;
off thinking to make it fast enough on a CPU, and saw exact token counts and speeds for every call. When thinking&lt;br&gt;
bypassed the grammar, I could find out why, because every layer is open: the model card, the chat template and the&lt;br&gt;
server source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's free to run, so it has no reason to keep you.&lt;/strong&gt; Places and weather come from open data with no keys, and&lt;br&gt;
the model runs on my laptop. No account, no subscription, no per-plan bill. Many apps are paid for with your&lt;br&gt;
attention; this one is happiest when you close it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No AI company sees where you are.&lt;/strong&gt; "Where are you, and when are you free?" is personal. The model that reads it&lt;br&gt;
runs on my machine. The only network calls are the open-data lookups (coordinates rounded to about 100 m for&lt;br&gt;
OpenStreetMap and 1 km for Open-Meteo), and they're cached, so a recently fetched area can be planned with&lt;br&gt;
&lt;code&gt;--offline&lt;/code&gt; and no connection at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open map data knows the small places.&lt;/strong&gt; OpenStreetMap has the Bamboo Island Pond inside a Bengaluru park and the&lt;br&gt;
Sopan Baug garden in Pune because volunteers mapped them. Commercial places APIs tend to put businesses first.&lt;br&gt;
OpenStreetMap is a map made by people who walk.&lt;/p&gt;

&lt;p&gt;It's also swappable: any chat model llama.cpp can run can replace Gemma by pointing &lt;code&gt;MODEL_FILE&lt;/code&gt; at another GGUF file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Walking times are estimates (straight line × 1.3), not real routing, and the arrow is a straight line too. Big
parks are measured to the edge of their bounding box.&lt;/li&gt;
&lt;li&gt;It only knows what OpenStreetMap knows. Unnamed places are skipped, and opening hours aren't enforced. "Mapped
here" uses each place's bounding box, so it can include things just beside it.&lt;/li&gt;
&lt;li&gt;Gemma 4 E2B (about 2B effective parameters) is now specific but sometimes stiff ("The water surface is
present"). The checker stops invented facts; it doesn't make the writing brilliant.&lt;/li&gt;
&lt;li&gt;About 29 s on my CPU once the area's map data is cached. The first plan in a new area also waits for
OpenStreetMap (up to about 15 s in my runs). That wait is screen time; plan the evening before, or look away.&lt;/li&gt;
&lt;li&gt;The 60-second budget measures this page, not your phone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How AI helped
&lt;/h2&gt;

&lt;p&gt;An AI coding assistant (Claude) helped me plan and build this. It drafted most of the code, the tests and a first&lt;br&gt;
version of this post. I reviewed the design rules (code computes every fact, the model only chooses and phrases,&lt;br&gt;
and every card says who wrote it), ran the app on my laptop, checked the numbers against the benchmark files and&lt;br&gt;
edited the text. The product itself uses no closed or paid AI: only Gemma, running locally.&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 E2B runs on a 2019 laptop CPU at under 30 s a plan, and because the weights and
chat template are open, I could render the template myself, switch thinking off and put a JSON grammar on the
first token. Result: in two 10-plan benchmarks, all 20 plans were written by Gemma (no template fallback), and
the model can't name a place I didn't fetch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Map data © OpenStreetMap contributors (ODbL). Weather and air quality: Open-Meteo.com (CC BY 4.0).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
