<?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: Sergei Berets</title>
    <description>The latest articles on DEV Community by Sergei Berets (@erehemoc).</description>
    <link>https://dev.to/erehemoc</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%2F4202572%2F3c1f202b-bf10-40e8-8597-a27357bade4f.png</url>
      <title>DEV Community: Sergei Berets</title>
      <link>https://dev.to/erehemoc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/erehemoc"/>
    <language>en</language>
    <item>
      <title>repo-séance: talk to the ghost of an abandoned repo, offline, with Gemma</title>
      <dc:creator>Sergei Berets</dc:creator>
      <pubDate>Tue, 27 Oct 2026 15:48:19 +0000</pubDate>
      <link>https://dev.to/erehemoc/repo-seance-talk-to-the-ghost-of-an-abandoned-repo-offline-with-gemma-5gml</link>
      <guid>https://dev.to/erehemoc/repo-seance-talk-to-the-ghost-of-an-abandoned-repo-offline-with-gemma-5gml</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&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Every abandoned repository is a small grave. Nobody visits, but nothing is gone. The history still holds who wrote the first line, who carried the project for years, and the last thing anyone said before it went quiet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;repo-séance&lt;/strong&gt; reads that history and lets you talk to what is left. It has two commands.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;epitaph&lt;/code&gt;&lt;/strong&gt; carves a tombstone from &lt;code&gt;git log&lt;/code&gt;: when the project was born, its last words, how long it lived, how long it has been silent, and the people who kept it alive. Then Gemma writes four lines of verse for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ask&lt;/code&gt;&lt;/strong&gt; lets you question the ghost. It answers in the first person, and &lt;strong&gt;every claim has to cite a real commit&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the tombstone for &lt;code&gt;left-pad&lt;/code&gt;, the tiny npm package whose removal in March 2016 broke builds across the JavaScript world (trimmed a little to fit the page):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;╭──────────────────────────────────────────────────────────────────────────────╮
│  HERE LIES LEFT-PAD                                                          │
│  born 2014-03-14 by E.Azer Koçulu: "initial"                                 │
│  last words 2019-03-15: "Fixes typo in readme" (Alex Jacobs, 6955230)        │
│  lived 5 years, 0 months · silent for 7 years, 7 months                      │
│  72 commits by 19 souls · most devoted: Steve Mao (31), E.Azer Koçulu (7)    │
│  kept by: E.Azer Koçulu (2014) → Steve Mao (2015) → jamie (2018)             │
│         → Steve Mao (2019)                                                   │
╰──────────────────────────────────────────────────────────────────────────────╯

Five years breathed, a shallow grace,
Nineteen hands touched its fading space.
A readme's ghost, a final plea,
Seven years lost, eternally.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The package that once took down half of npm ended its life fixing a typo in its own README. I did not write that line. Git did.&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%2Fpz5gy68h2727j91js953.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%2Fpz5gy68h2727j91js953.gif" alt="repo-séance demo: an epitaph for left-pad, then three questions to two ghosts" width="760" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The GIF is sped up. Every word in it comes from real runs of Gemma 3 4B on two CPU cores with the network off, and the full transcripts are in &lt;a href="https://github.com/Erehemoc/repo-seance/tree/main/demo" rel="noopener noreferrer"&gt;&lt;code&gt;demo/&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Asked how it made the back button work, the ghost of &lt;code&gt;jquery-pjax&lt;/code&gt; answers:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;👻 I remember a fix to reset the hash using `window.location.href = hash` [a19d6fe]
   to resolve a bug where the back button failed after navigating with a hash
   [a19d6fe] and I also added a loading event when hitting the back button [4bfa2fa]
   ... I also had to prevent browser caching of pjax responses [75bd2d6]

📜 evidence:
   75bd2d6  2011-04-04  Chris Wanstrath: Don't browser cache pjax responses (back button bug)
   a19d6fe  2011-07-07  Markus Kaiserswerth: Fix a bug that caused the back button to fail...
   4bfa2fa  2011-02-28  Chris Wanstrath: fire loading event when you hit the back button too
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I checked each one by hand. &lt;code&gt;a19d6fe&lt;/code&gt; really does swap &lt;code&gt;window.location.hash = hash&lt;/code&gt; for &lt;code&gt;window.location.href = hash&lt;/code&gt;, and &lt;code&gt;4bfa2fa&lt;/code&gt; really does bind a &lt;code&gt;loading.pjax&lt;/code&gt; event. A project nobody has touched in years explained a fix from 2011 correctly, with receipts.&lt;/p&gt;

&lt;p&gt;Asked about its favourite food, the ghost of &lt;code&gt;left-pad&lt;/code&gt; says only: &lt;em&gt;"The spirits are silent: nothing in my history speaks to that."&lt;/em&gt; That is my favourite answer it gives.&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/Erehemoc" rel="noopener noreferrer"&gt;
        Erehemoc
      &lt;/a&gt; / &lt;a href="https://github.com/Erehemoc/repo-seance" rel="noopener noreferrer"&gt;
        repo-seance
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Summon the ghost of an abandoned open-source project from its git history. Offline, with Gemma. Every answer cites real commits.
    &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;repo-séance&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Summon the ghost of an abandoned open-source project from its git history. Offline, with Gemma.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Erehemoc/repo-seance/demo/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%2FErehemoc%2Frepo-seance%2FHEAD%2Fdemo%2Fdemo.gif" alt="demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every abandoned repository is a small grave. Its history is still all there: who wrote the first line, who carried it for years, the last thing anyone said before it went quiet. &lt;code&gt;repo-séance&lt;/code&gt; reads that history and lets you talk to what is left.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;epitaph&lt;/code&gt;&lt;/strong&gt; carves a tombstone from &lt;code&gt;git log&lt;/code&gt;: born, last words, lifespan, how long it has been silent, the people who kept it alive. Then Gemma writes four lines of verse for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ask&lt;/code&gt;&lt;/strong&gt; lets you question the ghost. It answers in the first person, and &lt;strong&gt;every sentence has to cite a real commit&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;git clone https://github.com/left-pad/left-pad
python seance.py epitaph left-pad
python seance.py ask left-pad &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Why did you change hands in 2016?&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;A ghost that cannot lie about its own life&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;A model asked about a project's…&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/Erehemoc/repo-seance" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


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

&lt;p&gt;The hard part was not getting a small model to sound like a ghost. Gemma does that happily. The hard part was stopping a ghost from inventing its own life. A model asked about a project's past will make one up, so the séance runs on rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The model never writes the facts.&lt;/strong&gt; Dates, counts, last words and keepers are computed from git in plain Python. Merges are not anyone's last words, and bots are not keepers. Gemma only writes the verse, and every number in the verse is checked against the facts it was given. In early runs it happily invented numbers that appeared nowhere in the facts. Now a verse with an invented number is thrown away and requested again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The ghost sees only a few memories.&lt;/strong&gt; For each question, a small BM25 search picks about six commits: message, files changed, a slice of the diff, author and date. A short synonym list helps, so a question about "changing hands" finds commits about maintainers and publishing. Gemma answers from those memories and nothing else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Citations are checked, twice.&lt;/strong&gt; A citation to a commit the ghost was not shown gets struck out on screen as &lt;code&gt;[~~1234567~~ not in my memories]&lt;/code&gt;. A citation to a real commit whose words do not support the claim, or that names someone who did not write it, gets a ⚠. When &lt;code&gt;left-pad&lt;/code&gt; said it was "created in 2014 with a simple core [2d60a7f]", the ⚠ was right. That commit's message is just &lt;code&gt;initial&lt;/code&gt;, so "simple core" was the ghost embellishing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. No citation, no answer.&lt;/strong&gt; If the ghost cannot point to a single commit, or only says it does not remember, the reply becomes "The spirits are silent", followed by the closest commits so you can look yourself.&lt;/p&gt;

&lt;p&gt;One bug taught me the most. The first diff excerpts kept git's headers, and lines like &lt;code&gt;index 3f2a1b0..9c4d7e2&lt;/code&gt; contain short hashes. Gemma started citing those blob hashes as if they were commits. The check struck them out, correctly, so honest answers came back looking like lies. Now the excerpt keeps only the added and removed lines, and a test makes sure no blob hash gets through.&lt;/p&gt;

&lt;p&gt;The stack is small on purpose: Python, &lt;code&gt;llama-cpp-python&lt;/code&gt;, and a Gemma 3 4B GGUF. There are 13 tests, and none of them needs the model, because the ghost is swapped for a scripted fake medium.&lt;/p&gt;

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

&lt;p&gt;For this project, an open-weight model is not a preference. It is the whole design.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It works with the lights off.&lt;/strong&gt; After the one-time model download there is no network at all. You can hold a séance on a plane, or in a repository behind a company firewall.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Private history stays private.&lt;/strong&gt; The most interesting dead projects are often internal ones: the old billing service, the tool someone wrote before they left. Their history can contain names, emails and code that should never be pasted into someone else's API. Here it never leaves the machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ghost will outlive the medium.&lt;/strong&gt; A tool for remembering abandoned software should not depend on a service that may itself be shut down. The weights are a file on disk. The code is MIT licensed. In ten years it will still run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It is cheap enough to be curious.&lt;/strong&gt; A question costs about a minute of CPU and nothing else, so you can ask a hundred silly ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open models can be swapped and checked.&lt;/strong&gt; Pointing the tool at a different GGUF is one path. And because everything around the model is open too, you can read exactly how a claim gets struck or flagged instead of trusting a black box to grade itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reading the past is a good fit for open tools in general. Git itself is open, the projects are open, and the record they leave is public. It felt right for the thing reading that record to be open too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits, Honestly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The ghost knows only what commits say. &lt;code&gt;left-pad&lt;/code&gt; was famously unpublished over a dispute about a different package name, and none of that is in its git history, so the ghost (correctly) does not remember it.&lt;/li&gt;
&lt;li&gt;The ⚠ check is lexical, plus a check that a named person wrote the cited commit. It catches a claim pinned to the wrong commit or the wrong person. It does not catch a claim that gets the direction of a change backwards. In &lt;a href="https://github.com/Erehemoc/repo-seance/blob/main/demo/ask-license.txt" rel="noopener noreferrer"&gt;&lt;code&gt;ask-license.txt&lt;/code&gt;&lt;/a&gt; the ghost says the old COPYING file was deleted "in favor of the WTFPL" [6d35dfb]. In fact that commit removed the WTFPL text so an MIT license could replace it, and nothing flagged the mistake. That is why every answer prints its evidence, and why the transcript stays in the repo.&lt;/li&gt;
&lt;li&gt;Retrieval is keyword-based. A question phrased far from the commits' own words may come back silent.&lt;/li&gt;
&lt;/ul&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 3 4B runs locally through &lt;code&gt;llama-cpp-python&lt;/code&gt;. It writes every epitaph verse and voices every answer, under the checks described above.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built and written up with Claude as my AI agent. Gemma is used under the &lt;a href="https://ai.google.dev/gemma/terms" rel="noopener noreferrer"&gt;Gemma Terms of Use&lt;/a&gt;. The demo repositories are public open-source projects, cloned as they are.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
    <item>
      <title>lazy-ledger: a bank statement turns into a one-page money report, offline, with Gemma</title>
      <dc:creator>Sergei Berets</dc:creator>
      <pubDate>Fri, 23 Oct 2026 12:32:02 +0000</pubDate>
      <link>https://dev.to/erehemoc/lazy-ledger-a-bank-statement-turns-into-a-one-page-money-report-offline-with-gemma-5g06</link>
      <guid>https://dev.to/erehemoc/lazy-ledger-a-bank-statement-turns-into-a-one-page-money-report-offline-with-gemma-5g06</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&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Reviewing a bank statement properly means answering three questions: where did the money go, is anything in here wrong, and how is this month going to end. Doing that by hand in a spreadsheet is slow and boring, which is exactly why it gets postponed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;lazy-ledger&lt;/strong&gt; answers those three questions. Export the statement, run one command, read one page:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Where it went:&lt;/strong&gt; spending by category this month next to your 3-month average.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Worth a second look:&lt;/strong&gt; a charge far above what you usually pay that merchant, a merchant you have never paid before, a subscription billed twice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where the month is heading:&lt;/strong&gt; spend so far and the pace to month end.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It runs entirely on your laptop. Gemma 3 4B does the one part that needs language understanding: turning merchant strings like &lt;code&gt;BOLT.EU/O/2610&lt;/code&gt; or &lt;code&gt;NIKORA 2 SABURTALO&lt;/code&gt; into categories. Everything that involves money arithmetic is plain Python.&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%2Feipizj8izgbe0rm5e9qm.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%2Feipizj8izgbe0rm5e9qm.gif" alt="lazy-ledger demo" width="760" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The demo uses a &lt;strong&gt;synthetic&lt;/strong&gt; statement: six months of everyday spending in Tbilisi, in GEL, generated by &lt;code&gt;make_demo_data.py&lt;/code&gt;, with three planted problems: a 410 GEL food-delivery order, Netflix charged twice, and an unknown merchant. lazy-ledger finds all three. The first run labels 31 merchants in about 2.5 minutes on a 2-core CPU with no GPU. The next run sends zero merchants to the model and finishes in about 30 seconds.&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/Erehemoc" rel="noopener noreferrer"&gt;
        Erehemoc
      &lt;/a&gt; / &lt;a href="https://github.com/Erehemoc/lazy-ledger" rel="noopener noreferrer"&gt;
        lazy-ledger
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Bank-statement CSV to a one-page monthly money report, fully offline with Gemma 3 (llama.cpp).
    &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;lazy-ledger&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Drop in a bank-statement CSV, get back a one-page monthly money report. Runs fully offline with &lt;strong&gt;Gemma 3&lt;/strong&gt; on your own machine: no cloud, no API keys, your transactions never leave your laptop.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Erehemoc/lazy-ledger/demo/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%2FErehemoc%2Flazy-ledger%2FHEAD%2Fdemo%2Fdemo.gif" alt="demo"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The report tells you three things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Where the money went&lt;/strong&gt; this month, by category, against your 3-month average.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What's worth a second look&lt;/strong&gt;: a charge far above what you usually pay that merchant, a merchant you've never paid before, a subscription billed twice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where the month is heading&lt;/strong&gt;: spend so far and the pace to month end.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quick start&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;pip install -r requirements.txt
python fetch_model.py              &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Gemma 3 4B, ~2.5 GB, one time&lt;/span&gt;
python make_demo_data.py           &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; synthetic statement, no real data&lt;/span&gt;
python ledger.py demo/statement.csv
cat report.md&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;With your own statement: export CSV from your bank and run &lt;code&gt;python ledger.py my_statement.csv&lt;/code&gt;. Columns are matched loosely: any header containing &lt;em&gt;date&lt;/em&gt;, &lt;em&gt;description/merchant/details&lt;/em&gt; and &lt;em&gt;amount&lt;/em&gt; works…&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/Erehemoc/lazy-ledger" 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 model.&lt;/strong&gt; Gemma 3 4B in GGUF format, run locally through &lt;code&gt;llama-cpp-python&lt;/code&gt;. &lt;code&gt;fetch_model.py&lt;/code&gt; downloads the same weights &lt;code&gt;ollama pull gemma3:4b&lt;/code&gt; would. I started with Gemma 3 1B because it's tiny, but on my test set it called a supermarket "Eating out", so I moved up to 4B.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where Gemma is used, and where it deliberately isn't:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Done by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Parse CSV (dates, amounts, columns in English, Russian or Georgian)&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Categorise each &lt;em&gt;new&lt;/em&gt; merchant&lt;/td&gt;
&lt;td&gt;Gemma, JSON mode, 6 merchants per call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remember categories in &lt;code&gt;merchants.json&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flag spikes, first-time merchants, double billing&lt;/td&gt;
&lt;td&gt;Median and MAD per merchant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decide what the summary says&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Say it in readable sentences&lt;/td&gt;
&lt;td&gt;Gemma&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Two things I learned on the way:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Small models are bad at arithmetic but good at phrasing.&lt;/em&gt; My first version let Gemma write the summary from a table of numbers. It told me groceries had "risen" from 1,023 to 979 GEL. So now Python computes the facts ("biggest change: Eating out, 711 GEL, up from a usual 364") and Gemma only rewords them. A guard then checks that every number in Gemma's text was in the facts it was given. If one isn't, the report falls back to the plain sentence.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Local knowledge beats a bigger model.&lt;/em&gt; Most of the misses at 4B were Tbilisi-specific: Nikora is a supermarket chain, Gorgia sells hardware, Bolt is a taxi app. Three lines of hints in the prompt fixed them. On the demo data it now gets 30 of 31 merchants right. The one miss, &lt;code&gt;GLOVO*ORDER&lt;/code&gt; labelled Groceries instead of Eating out, is in the README.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Doing less next month.&lt;/strong&gt; Labels are cached, so only genuinely new merchants reach the model. A wrong label gets fixed once, by editing one line of JSON, and stays fixed.&lt;/p&gt;

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

&lt;p&gt;Because a bank statement is about as personal as data gets. Every line is where you were, what you bought, and when. That shouldn't have to go into a hosted chatbot, and a budgeting app shouldn't need your bank login.&lt;/p&gt;

&lt;p&gt;An open-weight model changes that trade. Gemma runs on the laptop you already own, with no account, no API key, and no network after the first download. The cost of a run is a couple of minutes of CPU. And because the weights and the code are open, you can check what happens to your data instead of trusting a privacy policy. If a better small model comes out next month, swapping it in is one &lt;code&gt;--model&lt;/code&gt; flag.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Before: sort hundreds of transactions into categories by hand, then compare months and hunt for odd charges.&lt;/li&gt;
&lt;li&gt;Now: export the CSV, run one command, read one page. On the demo statement (420 transactions) the first run takes about 2.5 minutes on a 2-core laptop CPU; after that, about 30 seconds, because known merchants are cached.&lt;/li&gt;
&lt;li&gt;The useful part: a double-billed subscription or an odd charge shows up in "Worth a second look" without anyone hunting for it.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma&lt;/strong&gt;: Gemma 3 4B runs locally and does all categorisation and the report summary.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built with Claude as my coding agent. The demo data is synthetic; no real transactions appear anywhere in the repo.&lt;/em&gt;&lt;/p&gt;

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