<?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: Pintu Kumar</title>
    <description>The latest articles on DEV Community by Pintu Kumar (@pintu_kumar_7850bd0665818).</description>
    <link>https://dev.to/pintu_kumar_7850bd0665818</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%2F4189823%2F76382c43-a8e1-4aff-9eac-2bf14998b629.jpg</url>
      <title>DEV Community: Pintu Kumar</title>
      <link>https://dev.to/pintu_kumar_7850bd0665818</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pintu_kumar_7850bd0665818"/>
    <language>en</language>
    <item>
      <title>I built a tiny programming language for Halloween — then made property tests prove it behaves</title>
      <dc:creator>Pintu Kumar</dc:creator>
      <pubDate>Mon, 23 Nov 2026 07:29:42 +0000</pubDate>
      <link>https://dev.to/pintu_kumar_7850bd0665818/i-built-a-tiny-programming-language-for-halloween-then-made-property-tests-prove-it-behaves-12a9</link>
      <guid>https://dev.to/pintu_kumar_7850bd0665818/i-built-a-tiny-programming-language-for-halloween-then-made-property-tests-prove-it-behaves-12a9</guid>
      <description>&lt;p&gt;This post is part of Kiroween 2026 — it's the story of my Skeleton Crew entry, CurseEngine.&lt;/p&gt;

&lt;p&gt;The idea started with a grumble: every automation tool I rely on asks me to trust rules I can't read. Moderation bots, reminder workflows, digest jobs — the rule fires on real people, and the person accountable for it gets a settings page, not a sentence.&lt;/p&gt;

&lt;p&gt;So I built the opposite. CurseEngine is a small language where a rule is one line of near-English:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curse spam-strikes: when message where count(message by same author flagged) &amp;gt;= 3 within 7 days -&amp;gt; mute author for 1 day; escalate to owner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A hand-written parser compiles that to an inspectable graph. A sandboxed executor runs it — no &lt;code&gt;eval&lt;/code&gt;, no LLM making the call. And because a rule you can't rehearse is still a gamble, the same executor doubles as a simulator: run it over history and see what &lt;em&gt;would&lt;/em&gt; have happened, with zero side effects. Every real action lands in an append-only log — the grimoire — where undo appends a reversal instead of erasing history.&lt;/p&gt;

&lt;p&gt;One engine, three hosts: GrimMod (chat moderation — a raid bot muted on its third flagged message), Deadbeat (invoice chasing at 7/14/21 days, exactly once per tier), and a standup-digest rule-pack. After the engine's baseline commit, the apps were added with zero changes to the engine package. That diff is the whole Skeleton Crew argument, and it's checkable in the git history.&lt;/p&gt;

&lt;p&gt;The part I did not expect: the property-based tests found the best bug. The suite runs 1,500 generated event streams through the live executor and the simulator and demands identical outcomes. On the first run it shrank a disagreement about stacked mutes down to a tiny example — a wrong assumption that my hand-written tests shared, which is exactly why they would never have caught it. The generators are wider now (hostile regex patterns, wrong-typed fields, webhook and timer curses), and the parity count is asserted inside the test so it can't silently shrink.&lt;/p&gt;

&lt;p&gt;The build itself was spec-first in Kiro: four specs, steering files with three inviolables (no exfiltration, the simulator never executes side effects, every action is reversible), and a hook that re-runs the whole property suite every time a curse or fixture is saved — a hook I trust because we deliberately broke a fixture once and watched it fail. Total agent cost: about 50 of the 4,000 hackathon credits. Writing the decisions down turned out to be the cheap part's best friend.&lt;/p&gt;

&lt;p&gt;Try it live: GrimMod and Deadbeat are both running (links in the repo), and the code is MIT at github.com/pintu544/curseengine. If you run a small community or chase invoices solo, I'd genuinely like to know which curse you'd write first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try CurseEngine live
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GrimMod (chat moderation)&lt;/strong&gt; — &lt;a href="https://curseengine-grimmod.azurewebsites.net" rel="noopener noreferrer"&gt;https://curseengine-grimmod.azurewebsites.net&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deadbeat (invoice chasing)&lt;/strong&gt; — &lt;a href="https://curseengine-deadbeat.azurewebsites.net" rel="noopener noreferrer"&gt;https://curseengine-deadbeat.azurewebsites.net&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demo video (2:47)&lt;/strong&gt; — &lt;a href="https://youtu.be/xgDH1HQla54" rel="noopener noreferrer"&gt;https://youtu.be/xgDH1HQla54&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LinkedIn post&lt;/strong&gt; — &lt;a href="https://www.linkedin.com/posts/pintukumar12_kiroweenhackathon26-share-7530550305286012928-x6Nr/" rel="noopener noreferrer"&gt;https://www.linkedin.com/posts/pintukumar12_kiroweenhackathon26-share-7530550305286012928-x6Nr/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
      <category>kiroween</category>
      <category>hackathon</category>
      <category>typescript</category>
    </item>
    <item>
      <title>I Held a Séance for Dead Programming Languages (and the Ghost Lives on My Machine)</title>
      <dc:creator>Pintu Kumar</dc:creator>
      <pubDate>Wed, 28 Oct 2026 15:45:27 +0000</pubDate>
      <link>https://dev.to/pintu_kumar_7850bd0665818/i-held-a-seance-for-dead-programming-languages-and-the-ghost-lives-on-my-machine-40ej</link>
      <guid>https://dev.to/pintu_kumar_7850bd0665818/i-held-a-seance-for-dead-programming-languages-and-the-ghost-lives-on-my-machine-40ej</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Séance&lt;/strong&gt; is a tiny terminal chatbot with one job: let you sit down with&lt;br&gt;
the ghost of a programming language that the world declared dead, and&lt;br&gt;
ask it questions.&lt;/p&gt;

&lt;p&gt;You light the candles (that is, you run one command), pick a spirit —&lt;br&gt;
COBOL (1959), FORTRAN (1957), or Lisp (1958) — and talk. The answers&lt;br&gt;
come back in a spooky, playful planchette voice, streamed word by word&lt;br&gt;
so it feels like something is spelling itself out on the board. No&lt;br&gt;
gore, no jump scares. The ghosts here are languages, and the joke is a&lt;br&gt;
fond one: these are the languages everyone buried, and they never&lt;br&gt;
actually left.&lt;/p&gt;

&lt;p&gt;I built it for Week 4's theme, "Ghost in the Machine", which asks for&lt;br&gt;
something spooky or something that honors the past in the spirit of Día&lt;br&gt;
de los Muertos. This does both at once. Halloween gets the séance&lt;br&gt;
table. Día de los Muertos gets the part I actually care about: taking a&lt;br&gt;
moment to remember the code that came before us, instead of laughing at&lt;br&gt;
it and moving on.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Séance is a local command-line app, so there is no deployed link — it&lt;br&gt;
runs on your machine, and that is the point. Here is a real exchange,&lt;br&gt;
captured from a real run (the full transcript, including timings, is in&lt;br&gt;
the repo):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ node seance.mjs --once "Why are you still here?"

🕯️  The candles are lit. The spirit of COBOL (1959) stirs...

👻 Well, now, that’s a remarkably perceptive question! You see, I’ve
been… operational, shall we say, since 1959. My primary function, as
you may know, is the processing of financial transactions – banking,
payroll, accounts payable. I’ve simply continued to execute my
DESIGNATED tasks, quite reliably, I might add. It’s a rather satisfying
PROCEDURE DIVISION, wouldn't you agree?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fuqqbkfsue7pg5zxg4rww.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%2Fuqqbkfsue7pg5zxg4rww.png" alt="Séance terminal exchange" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The code is on GitHub: &lt;strong&gt;&lt;a href="https://github.com/pintu544/seance" rel="noopener noreferrer"&gt;pintu544/seance&lt;/a&gt;&lt;/strong&gt; — the app is one file, &lt;code&gt;seance.mjs&lt;/code&gt;, zero dependencies, plus a README and a transcript of real runs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama serve          &lt;span class="c"&gt;# in one terminal, if it is not already running&lt;/span&gt;
ollama pull gemma3:4b &lt;span class="c"&gt;# once&lt;/span&gt;
node seance.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The whole app is one Node file with zero dependencies. It sends your&lt;br&gt;
question to a local Ollama server on &lt;code&gt;localhost:11434&lt;/code&gt;, and &lt;strong&gt;Gemma 3&lt;br&gt;
4B&lt;/strong&gt; — an open-weight model — answers on your own machine. One prompt&lt;br&gt;
per spirit, one streaming request, temperature 0.9, answers capped at&lt;br&gt;
about 220 tokens so they stay séance-short.&lt;/p&gt;

&lt;p&gt;Two things about the design are deliberate:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;If Ollama is not running, or the model is not pulled, the app
says so and exits.&lt;/strong&gt; There is no hosted fallback. A fallback would
make "offline" a lie, and the entire point of this project is that
it is not a demo of a cloud service wearing a costume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The model is never asked to be a historian.&lt;/strong&gt; The prompt tells it
to stay in character, keep answers short, and say when it does not
know something instead of inventing history. It will still invent
facts sometimes — that is what language models do — which is why the
post never presents an answer as verified history. These are
roleplay ghosts, not sources.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Honest limits, because a small project should own them: a 4B model on&lt;br&gt;
a CPU machine is slow. The first exchange took 62 seconds including&lt;br&gt;
loading the model; a warm run took 34 seconds. The streaming reply&lt;br&gt;
makes the wait feel like a planchette moving instead of a hang, but it&lt;br&gt;
is slow, and I am not going to pretend otherwise. If 4B is too heavy&lt;br&gt;
for your machine, the same app runs with &lt;code&gt;gemma3:1b&lt;/code&gt;.&lt;/p&gt;

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

&lt;p&gt;A séance is private by nature. You would not hold one over a corporate&lt;br&gt;
API that logs every question, rate-limits the spirits, and can change&lt;br&gt;
its terms next quarter. Running your own open-weight model means the&lt;br&gt;
questions, the jokes, and the bad poetry stay on your machine — and the&lt;br&gt;
thing still works with the internet off.&lt;/p&gt;

&lt;p&gt;That is also what makes this project possible at all. A downloadable&lt;br&gt;
model you can run, inspect, and swap is not a service that can&lt;br&gt;
disappear. The open piece is not decoration here; it is the whole&lt;br&gt;
apparatus. A closed API could have given me faster, smoother answers —&lt;br&gt;
and would have taken away the one property the theme demands: that the&lt;br&gt;
ghost lives in &lt;em&gt;your&lt;/em&gt; machine, not in someone else's data centre.&lt;/p&gt;

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

&lt;p&gt;The moment it landed was the first real question I asked it: why are&lt;br&gt;
you still here? I expected a joke. What I got was COBOL, completely&lt;br&gt;
straight-faced, explaining that it has simply continued to execute its&lt;br&gt;
designated tasks since 1959 — and calling that "a rather satisfying&lt;br&gt;
PROCEDURE DIVISION". It was funny because it was true. The language&lt;br&gt;
everyone jokes about burying is still moving money around the world,&lt;br&gt;
and it is not embarrassed about it in the slightest.&lt;/p&gt;

&lt;p&gt;That is the feeling I wanted the project to capture. We treat old code&lt;br&gt;
like it is haunted — strange, a little scary, best left alone. Most of&lt;br&gt;
the time, it is just still doing its job, waiting for someone to ask it&lt;br&gt;
a decent question.&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 3 4B is the entire voice of the app.
There is no other model and no hosted fallback — if Gemma is not
running locally, the séance does not happen.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Ledger Sloth: a bank statement reader that never phones home</title>
      <dc:creator>Pintu Kumar</dc:creator>
      <pubDate>Sat, 24 Oct 2026 04:48:10 +0000</pubDate>
      <link>https://dev.to/pintu_kumar_7850bd0665818/ledger-sloth-a-bank-statement-reader-that-never-phones-home-21nj</link>
      <guid>https://dev.to/pintu_kumar_7850bd0665818/ledger-sloth-a-bank-statement-reader-that-never-phones-home-21nj</guid>
      <description>&lt;p&gt;&lt;em&gt;Submitted to the DEV × MLH Hacktoberfest Week 3 challenge ("Slow and Steady"), for the Best Use of TabPFN and Best Use of Gemma featured categories.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The hook — the chore everyone dreads, monthly
&lt;/h2&gt;

&lt;p&gt;Once a month, the statement lands. A few hundred lines of bank-speak — &lt;code&gt;ACH D- ZERODHA BROKING SIP&lt;/code&gt;, &lt;code&gt;UPI-SWIGGY-BANGALORE&lt;/code&gt;, a ₹999 charge from a tool you trialled in August and forgot by September. Somewhere in there is the answer to "where did the money go?", and getting it out means an evening with a spreadsheet, or uploading the most revealing document you own to a website and hoping.&lt;/p&gt;

&lt;p&gt;Ledger Sloth is the lazy way out — appropriately, for International Sloth Day. Point it at the statement CSV your bank already gives you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tsx src/index.ts report statement.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It reads every transaction, categorizes it, and writes a month-in-review: where the money went, what changed versus last month, which subscriptions renewed silently, which charges look wrong — plus a forecast of next month's spending per category, and a categorized CSV for your records. It runs at CPU speed, on your machine, and it is in no hurry. Neither are you. That's the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;One command takes one statement CSV (HDFC layout first; ICICI and SBI variants and a generic signed-amount shape too) and produces three files in an output folder: &lt;code&gt;report.md&lt;/code&gt;, a self-contained &lt;code&gt;report.html&lt;/code&gt;, and &lt;code&gt;categorized.csv&lt;/code&gt; — every transaction with its category, ready for a spreadsheet or an accountant. In between, every row is parsed and normalized; categorized by a local correction memory, then deterministic rules, then Gemma; aggregated into per-category totals and month-over-month deltas; scored by TabPFN, which forecasts next month per category and scores every debit against what it expected that charge to be; and written up by Gemma into a plain-English month-in-review whose every rupee figure is mechanically checked against the computed aggregates before it is allowed into the report.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Categorizes every transaction (memory → rules → Gemma — see below).&lt;/li&gt;
&lt;li&gt;Flags anomalous charges with reasons built from your own history.&lt;/li&gt;
&lt;li&gt;Forecasts next month's per-category spend with TabPFN — and tells you, honestly, whether that forecast beat the naive guess (see "The honest benchmark").&lt;/li&gt;
&lt;li&gt;Learns your corrections locally: &lt;code&gt;correct "NOTION LABS" Subscriptions&lt;/code&gt; writes one line to a JSON file on your disk, and that merchant is yours forever — no retraining, no account, no sync.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture — two models, never in the room together
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;statement.csv
     │
     ▼
 parse ──► categorize ──► aggregate ──► TabPFN worker ──► narrate ──► render
 (TS)      memory → rules   (pure TS)    (Python, spawned   (Gemma —    report.md
            → Gemma (Ollama)              once, one JSON     figures    report.html
                                          job, then exits)   checked)   categorized.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pipeline is a straight line, and its shape &lt;em&gt;is&lt;/em&gt; the privacy story:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Parse.&lt;/strong&gt; A hand-rolled RFC-4180 reader maps the statement's columns into typed transactions. Unrecognized layouts fail loudly, listing the headers found — never a silent guess.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Categorize, deterministic first.&lt;/strong&gt; A local correction memory (your teachings, in a JSON file you can read and edit) and an ordered merchant-rule table categorize everything they know — instantly, offline, explainably.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Categorize, Gemma for the long tail.&lt;/strong&gt; Whatever is left goes, in batches, to &lt;strong&gt;Gemma 3 4B running locally via Ollama&lt;/strong&gt;. Replies are validated — exact length, categories checked against the fixed list — before a single row is mapped; anything invalid degrades to &lt;code&gt;Other&lt;/code&gt; and is counted, in the open, in the run metrics. The stage's last request unloads the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aggregate.&lt;/strong&gt; Totals, month-over-month deltas, top merchants, medians — pure functions, unit-tested against hand-computed values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forecast + anomaly scoring with TabPFN.&lt;/strong&gt; A separate Python process is spawned once, handed one JSON job (forecast, honest benchmark, expected amounts), and exits — so PyTorch and Gemma are &lt;em&gt;never resident at the same time&lt;/em&gt;. On a small machine that isn't an optimization; it's the difference between running and swapping to death. On the 7.7 GB box this was built on, Gemma peaks at 3,773 MB and TabPFN at 3,933 MB — comfortable one at a time, impossible together.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Narrate.&lt;/strong&gt; Gemma returns for one call whose prompt contains &lt;em&gt;only&lt;/em&gt; the aggregates. Every ₹-figure it writes is then checked against those aggregates — it must exist, be written in well-formed digit grouping, and be used in the right scope (see "Grounding the narrator"). Fail, and the narrative is retried once, then replaced by a templated summary — and the report says so, in the report. The model proposes; the code disposes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Render.&lt;/strong&gt; &lt;code&gt;report.md&lt;/code&gt;, a self-contained &lt;code&gt;report.html&lt;/code&gt; (zero external references — the offline claim holds even when you &lt;em&gt;view&lt;/em&gt; the report), and &lt;code&gt;categorized.csv&lt;/code&gt;, byte-identical across runs — I verified that across four full runs, including one with no network at all.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why open — bank statements are data you never upload
&lt;/h2&gt;

&lt;p&gt;There is a short list of documents that describe a life almost completely: a month of bank transactions is on it. Salary, rent, medicines, the 2 a.m. food orders, the loan you're quiet about — it's all there, timestamped. Tools that analyze statements almost always ask you to upload that document to someone else's server, where "analysis" means it joins a database you can't see, under a privacy policy you'll never read.&lt;/p&gt;

&lt;p&gt;Open-weight models change who can build this tool. &lt;strong&gt;Gemma 3&lt;/strong&gt; (open-weight under the Gemma Terms of Use) runs on the laptop that already holds the statement. &lt;strong&gt;TabPFN&lt;/strong&gt; — a foundation model for tabular data — runs the forecast locally after a one-time weights download: the TabPFN-3.5 weights are open-weight under Prior Labs' non-commercial TABPFN-3-5 License v1.0, and the &lt;code&gt;tabpfn&lt;/code&gt; package code itself is Apache 2.0. Nothing in Ledger Sloth's design &lt;em&gt;requires&lt;/em&gt; a server, an account, or a network: after setup, the only HTTP it makes is to &lt;code&gt;localhost&lt;/code&gt;. That's not a privacy &lt;em&gt;policy&lt;/em&gt;; it's an architecture. You don't have to trust it — you can watch it work with the Wi-Fi off. I did: a full run inside a network namespace with no egress route at all (a &lt;code&gt;curl&lt;/code&gt; to the outside fails) completed with the identical benchmark verdict and identical output.&lt;/p&gt;

&lt;p&gt;And the local part compounds. Your corrections live in a JSON file on your disk, making next month's run better without a single byte leaving the machine. The cost structure is a consequence of the openness too: after the one-time downloads, a run costs ₹0 — no API bill scales with your bank history. Open weights make this &lt;em&gt;possible&lt;/em&gt;, not just cheaper: a hosted API version of Ledger Sloth would be a different, worse product wearing the same name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest benchmark
&lt;/h2&gt;

&lt;p&gt;TabPFN's forecast is only worth having if it beats the forecast a spreadsheet makes for free: &lt;em&gt;next month = this month&lt;/em&gt;. So Ledger Sloth benchmarks itself on a held-out month — same model, same features, cutoff moved — and prints the verdict either way.&lt;/p&gt;

&lt;p&gt;On the fixture statement (four months, Jun–Sep 2026; Sep held out; 12 spend categories), the verdict is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The naive baseline won — naive MAE ₹2,558.75 vs TabPFN MAE ₹2,806.45.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why, honestly: this household is metronome-stable. Rent is ₹28,000 every month, investments ₹10,000, food within a few hundred rupees. Repeating last month scores &lt;em&gt;zero&lt;/em&gt; error on five categories and under ₹200 on six more. The only row where either model was badly wrong was Shopping — September's actual (₹36,147) contains the planted anomaly, and both models missed it by ~₹30,000. One held-out month and 12 categories is a small sample, and the report says that too; this verdict describes this statement's benchmark, not TabPFN in general.&lt;/p&gt;

&lt;p&gt;What TabPFN's predictions looked like anyway: on the big steady categories they were genuinely close — rent ₹28,004.74 against an actual ₹28,000 (off by ₹4.74), food &amp;amp; dining ₹14,828.06 against ₹14,641 (off by ₹187), transport within ₹188. It lost on the small jumpy categories (utilities, entertainment), where it predicted rises that didn't happen, and on the anomaly row, where both models were equally blindsided. With three training months, "close but not closest" is the true result — so the forecast is the part of this tool I make the &lt;em&gt;smallest&lt;/em&gt; claim for. Where TabPFN earned its place is the next section.&lt;/p&gt;

&lt;p&gt;The same rawness applies to the forecast itself: next month's Shopping forecast prints as ₹82,866.32, because the model trained on the anomaly month as-is. The report shows it unadjusted, with a note naming the flagged charge — rather than quietly cleaning the input to make the model look smarter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The anomaly that almost got away
&lt;/h2&gt;

&lt;p&gt;The anomaly detector scores each debit against a TabPFN model of expected amounts. The fixture plants one charge that must be caught: ₹32,999 at CROMA on 2026-09-14, in a Shopping history whose category median is ₹1,774. The flag rule is conservative — actual must exceed 2.5× the expected amount &lt;em&gt;and&lt;/em&gt; the gap must exceed ₹1,000.&lt;/p&gt;

&lt;p&gt;The first working version expected ₹21,834 for that charge — a ratio of 1.51×. No flag. The detector missed the one charge it existed to catch, and the reason was a leak, not the model: the &lt;code&gt;merchantMedian&lt;/code&gt; feature for a merchant that occurs exactly once &lt;em&gt;is that charge's own amount&lt;/em&gt;. The feature contained the answer.&lt;/p&gt;

&lt;p&gt;Fix one: leave-one-out merchant medians — the median of the merchant's &lt;em&gt;other&lt;/em&gt; debits, falling back to the category median. The expected amount barely moved: ₹20,294 (1.63×). Because the second leak was subtler: TabPFN is an in-context learner, and the scoring protocol fit on all debits and predicted the same rows — the CROMA row sat in its own training context, under a merchant key that occurs once, pulling its prediction toward itself.&lt;/p&gt;

&lt;p&gt;Fix two: the amounts job is now 5-fold cross-fitted inside the worker — every debit is predicted only by a model fit on the other folds. A charge is never scored by a model that saw it. Expected amount for CROMA: &lt;strong&gt;₹1,938.50 — so ₹32,999 flags at ~17× expected, a gap of ~₹31,061&lt;/strong&gt;, with the reason printed in the report. It is the only flag on the fixture, which is also correct: nothing else in four months deserved one. An anomaly detector graded on its own homework will pass every exam and catch nothing; cross-fitting is what makes the flag mean something.&lt;/p&gt;

&lt;h2&gt;
  
  
  Grounding the narrator
&lt;/h2&gt;

&lt;p&gt;The narrative is the one place a language model writes prose about your money, so it is the place the design trusts it least. Gemma sees only the aggregates JSON — never the statement — and every ₹-figure in its draft is extracted and checked before the draft is accepted. The first version checked only that figures &lt;em&gt;exist&lt;/em&gt; in the aggregates. My adversarial QA pass caught why that's not enough: one draft wrote of Shopping "a significant increase of ₹52,740" — ₹52,740 is real, but it's Shopping's &lt;em&gt;whole-period&lt;/em&gt; total; September's actual month-over-month change was +₹30,148. Right number, wrong scope, false sentence. Another run produced a correct total with mangled digit grouping ("₹11,1622").&lt;/p&gt;

&lt;p&gt;Grounding is now three checks: a figure must exist in the payload, be written in well-formed grouping, and be used in its proper scope — whole-period figures only with whole-period framing. Failures get one sterner retry, then the deterministic template takes over, and the substitution is disclosed in the report body and the run metrics. On the final verification run before writing this post, both Gemma drafts failed on genuinely bad figures — an invented ₹52,747, per-category errors the model derived itself, a ×10 slip (₹11,20,000) — and the report shipped the template instead: plainer, correct, and labelled as a template. The trade-off is real and I'll state it: stricter grounding means more fallbacks, and a failed attempt costs another generation (that run's narrative stage took 347 s; the whole run 6 min 45 s against just under four minutes when a draft grounds first try). The report is never wrong. At worst, it's plainer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Numbers (all measured, none estimated)
&lt;/h2&gt;

&lt;p&gt;Measured on the build host: 2 vCPU · 7.7 GB RAM · CPU-only, no GPU (Ollama 0.40.6, tabpfn 9.2.0, torch 2.14.1+cpu, Python 3.12.3, Node 24).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TabPFN spike:&lt;/strong&gt; CPU-only torch installed in 84 s; &lt;code&gt;tabpfn&lt;/code&gt; in 235 s; TabPFN-3.5 checkpoint 876 MB, downloaded once, offline after; a 200-row fit+predict took 38.7 s at 3,933 MB peak RSS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma spike:&lt;/strong&gt; model load 36.6 s; categorization at 6.64 tokens/s; narrative generation at 6.57 tokens/s (267 tokens in 57.6 s); peak RSS 3,773 MB; &lt;code&gt;keep_alive: 0&lt;/code&gt; unload verified (server RSS falls to 34 MB afterwards).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Categorization:&lt;/strong&gt; the deterministic layer (memory + rules) settled &lt;strong&gt;249/249 rows (100%)&lt;/strong&gt; of the fixture with zero leftovers — the fixture persona runs on 28 regular narration templates, and the post should be honest that the rules, not the model, carry this number. Gemma alone, verified live: 23/25 (92.0%) on a sample of real narrations, and 8/8 on synthetic merchants the rules had never seen (Zudio, Bikanervala, Dr Lal PathLabs, Kalyan Jewellers…). &lt;strong&gt;Accuracy vs ground truth on the full pipeline: 249/249 = 100.0%&lt;/strong&gt; (the target was ≥85%). Source counts print in every report — on the fixture: memory 0 · rule 249 · Gemma 0 · Other 0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TabPFN on the fixture:&lt;/strong&gt; one worker run does all three jobs — in the demo run, 57.9 s total (forecast fit 17.0 s, benchmark 2.3 s, amounts 37.1 s cross-fitted), scoring all 243 debits and forecasting exactly the 12 categories with history. A category with no history gets "no history — no forecast", never a fabricated ₹0.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full run:&lt;/strong&gt; just under four minutes when the narrative grounds on the first attempt (233 s of stage time; the narrative stage alone was 169 s of it); 6 min 45 s on the run where both drafts failed grounding and the disclosed template took over. The categorized CSV came out byte-identical in both — and in the offline run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install footprint:&lt;/strong&gt; Python env 1,328.6 MiB + TabPFN-3.5 checkpoint 835.4 MiB + gemma3:4b 3.4 GB — about 5.5 GB of disk, once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests:&lt;/strong&gt; 149 passing, covering the parser, rules, grounding checks, worker protocol, failure modes, and the byte-identical-output guarantee.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Failure modes are features here
&lt;/h2&gt;

&lt;p&gt;Each of these was exercised end-to-end, not just unit-tested:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TabPFN unavailable&lt;/strong&gt; (no token, no weights): the report is still produced, with the forecast and anomaly sections replaced by an explicit "unavailable because…" note. Nothing silently dropped, nothing invented.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A single month of data:&lt;/strong&gt; the forecast section states that at least two months of history are needed and extrapolates nothing. Anomaly scoring still runs within the month — CROMA flags there too, at ~22× its expected amount.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ollama not running:&lt;/strong&gt; the run fails fast with the exact fix command (&lt;code&gt;ollama serve&lt;/code&gt;) and produces zero partial artifacts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Garbage or unrecognized CSV:&lt;/strong&gt; a plain failure message — for unknown layouts, listing the headers found and the shapes Ledger Sloth can read. No artifacts, no guessing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero outbound calls:&lt;/strong&gt; after the one-time setup downloads, a full run needs no network at all (verified with no egress route, above).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it doesn't do (yet)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PDF statements — CSV exports only, for now.&lt;/li&gt;
&lt;li&gt;Bank connections or syncing — by design; you bring the file.&lt;/li&gt;
&lt;li&gt;Long histories: the benchmark above is three training months, and on short, stable histories the naive baseline is genuinely hard to beat. The forecast should get &lt;em&gt;more&lt;/em&gt; useful with a year of statements; I haven't measured that, so I won't claim it.&lt;/li&gt;
&lt;li&gt;The narrative sometimes ships as the templated summary — by design, disclosed when it happens (see "Grounding the narrator").&lt;/li&gt;
&lt;li&gt;Layouts beyond HDFC, ICICI, SBI and the generic signed-amount shape will fail loudly rather than parse creatively.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/pintu544/ledger-sloth.git
&lt;span class="nb"&gt;cd&lt;/span&gt; ledger-sloth
npm install

&lt;span class="c"&gt;# Python sidecar: CPU-only torch FIRST (avoids the multi-GB CUDA build)&lt;/span&gt;
python3 -m venv python/.venv
python/.venv/bin/pip install &lt;span class="nv"&gt;torch&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;2.14.1 --index-url https://download.pytorch.org/whl/cpu
python/.venv/bin/pip install -r python/requirements.txt   &lt;span class="c"&gt;# tabpfn==9.2.0&lt;/span&gt;

ollama pull gemma3:4b
&lt;span class="c"&gt;# one-time: accept the TabPFN-3.5 license at platform.priorlabs.ai,&lt;/span&gt;
&lt;span class="c"&gt;# copy the token from your account page, then:&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;TABPFN_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;your token&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

ollama serve &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;   &lt;span class="c"&gt;# if it isn't already running&lt;/span&gt;
npx tsx src/index.ts report fixtures/statement.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The demo statement is synthetic (a salaried persona, Jun–Sep 2026, one planted anomaly) with published ground truth, so every number in this post can be checked by hand. Slow, local, and in no hurry — that's the whole idea. 🦥&lt;/p&gt;




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