{"slug": "inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to", "title": "Inbox Sloth: a local Gemma that reads your inbox so you don’t have to", "summary": "A developer built Inbox Sloth, an open-source tool that runs Google's Gemma 3 1B model locally via Ollama to convert emails into tracked commitments with deadlines and flag when later messages override earlier ones. The design treats the model as a noisy witness: Gemma extracts structured JSON under schema constraints while plain-code checks decide what counts, lifting accuracy on a real 18-email test set from 6/12 commitments found and 5/12 dates correct to 12/12 on both after adding rule-based validation. The project, released on GitHub with 132 tests and a scored demo command, runs on a CPU-only 16 GB laptop and caches model answers by model, prompt and email to speed iteration.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady](https://dev.to/challenges/hacktoberfest-week3-2026-10-19)*\n\nMy professor emails on Monday: *assignment due Friday.* On Tuesday: *\"correction, because of the holiday it's now Thursday.\"*\n\nAn email summariser gives me two accurate summaries and zero help. I still have to notice they're about the same assignment, remember which one wins, and move the date in my head.\n\n**Inbox Sloth** does that part for me. It reads a mailbox with **Gemma running on my own laptop**, turns emails into *commitments* (what, by when, which email said so), and notices when a later email changes an earlier one:\n\n**Submit Probability Assignment 3**: Thu 22 Oct, 11:59 PM. *Changed (was Fri 23 Oct).*\n\nEvidence: \"Please submit Probability Assignment 3 by Thursday 22 October, 11:59 PM instead.\"\n\nI open one page and see what to do first, what's due this week, what clashes, and which dates moved and are worth double-checking.\n\nRun it yourself in a few minutes (the `demo` command runs the real model on 18 sample emails and scores it against ground truth):\n\n```\nollama pull gemma3:1b\ncd backend && pip install -r requirements.txt\npython -m pytest -q              # 132 tests, no Ollama needed\npython -m app.cli demo           # real model run, scored against ground truth\nuvicorn app.main:app             # http://localhost:8000\n```\n\n[https://github.com/newton-lebniz/inbox-sloth](https://github.com/newton-lebniz/inbox-sloth)\n\n**Stack:** `gemma3:1b` via Ollama (JSON-schema constrained output, temperature 0), FastAPI, SQLite, plain HTML/JS, pytest. It runs on a CPU-only laptop with 16 GB RAM.\n\nThe key design decision: **the model is a noisy witness.** The model *reads*; code *decides*.\n\n``` php\nemail -> Gemma (local, JSON-schema output) -> checks in plain code -> commitment tracker -> plan\n```\n\nValid model answers are cached by (model, prompt, email), so re-analysing all 18 emails after a code change takes about a second instead of three minutes. That is what made fast iteration possible on a CPU.\n\nOn Day 1, my evaluator said: **10 of 12 commitments found, 6 of 12 dates right.**\n\nThen I read the rows. It was comparing *\"Pay semester fee\"* with *\"Submit data structures exam\"*. My matcher accepted the best title match even when the best was bad, so the score looked better than the output. After fixing the evaluator and re-scoring the same real output:\n\n| Day 1 (real gemma3:1b run) | reported | actual | \n|---|---|---|\n| Commitments found | 10/12 | **6/12** | \n| Dates correct | 6/12 | **5/12** | \n| False positives | 2 | **6** | \n\nWhat the real run showed: for 4 of the 14 actionable emails, including the deadline correction, no commitment came out. It invented tasks for informational emails (\"Khichdi and papad dinner\" from a mess-menu notice). It rewrote dates, and a quiz became \"Attend class\".\n\nSo the interesting problem wasn't prompting. It was building something that stays correct when the model doesn't. With the checks above, same prompt:\n\n|  | Day 1 (re-scored) | After the code checks (real Gemma run) | \n|---|---|---|\n| Found | 6/12 | 12/12 | \n| Dates correct | 5/12 | 12/12 | \n| Kinds correct | 5/12 | 12/12 | \n\nAn ablation (on recorded Gemma answers) shows where it comes from: without the rule safety net, 10/12 found and 9/12 dates; without the cue check, the false positives come back.\n\nEmail is the most private text most people have: grades, client names, medical appointments, offers. I didn't want to ship that to a third-party API just to find out when my lab report is due.\n\n`SLOTH_MODEL=gemma3:4b`) changes the model. That mattered, because a 1B model made mistakes and the architecture had to survive them.\nThe saving is the part I used to do by hand: noticing that Tuesday's email overrides Monday's, and re-checking my own list. The honest limit: I haven't run it on a real mailbox for a week, only on 18 synthetic emails, so I can't claim hours saved. What I can show is that on those emails it found every commitment and applied the date correction, and that for every task it shows the sentence it came from, so checking it takes seconds.\n\nWhat I learned: (1) a metric you wrote in ten minutes is a hypothesis, and mine flattered me until I read the rows; (2) let the model read and let code decide; (3) make every judgment visible. The evidence sentence, the ranking reasons and the ignored list made the tool trustworthy and also debuggable.\n\n**Best Use of Gemma**", "url": "https://wpnews.pro/news/inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to", "canonical_source": "https://dev.to/newton_lebniz/inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to-1po9", "published_at": "2026-10-25 09:05:10+00:00", "updated_at": "2026-10-25 09:12:54.606411+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "ai-agents", "ai-safety"], "entities": ["Inbox Sloth", "Gemma", "Ollama", "FastAPI", "SQLite", "Hacktoberfest", "newton-lebniz"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to", "markdown": "https://wpnews.pro/news/inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to.md", "text": "https://wpnews.pro/news/inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to.txt", "jsonld": "https://wpnews.pro/news/inbox-sloth-a-local-gemma-that-reads-your-inbox-so-you-dont-have-to.jsonld"}}