{"slug": "sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-don-t-have-to", "title": "Sloth Digest 🦥 — a local Gemma 3 agent that does my inbox triage so I don't have to", "summary": "A developer built Sloth Digest, a local email-triage agent that runs Gemma 3 4B IT (QAT-quantized) on llama.cpp over plain CPU to sort unread Gmail into urgency buckets and produce a morning markdown digest. The roughly 200-line Python stdlib pipeline uses a strict three-line CATEGORY/SUMMARY/ACTION verdict at temperature 0, fetches mail read-only via the Gmail API, and processes six sample emails in about 14 seconds without any cloud API. The developer says nothing leaves the machine: \"Pull the network cable and it still works.", "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\n**Sloth Digest** is a local AI agent that reads my unread Gmail overnight and hands me a morning digest, so I never have to open a cold inbox again.\n\nEvery email gets triaged by an **open-weight model running entirely on my own machine** (Gemma 3 4B IT, QAT-quantized, served by llama.cpp on plain CPU) into three buckets:\n\nWho gets to be lazier? Me, every single morning. Instead of 15–30 minutes of scanning subject lines and context-switching, I read one short markdown page and only touch the 3–4 emails that actually need a human.\n\nHere's real output from the bundled sample inbox:\n\n```\n# 🦥 Sloth Digest — morning triage\n\n## ⚡ Needs you (4)\n- **Energia Lux** — Your October invoice — €84.12 due Oct 27\n  Electricity bill of €84.12 is due soon.\n  → Pay the invoice before October 27th.\n- **Marco Silva** — Re: Thursday moved to 15:00?\n  Plumber availability needs confirmation for Thursday.\n  → Confirm 15:00 or propose an alternative time.\n...\n\n## 😴 Skip safely (1)\n- **ShopMega** — 🔥 70% OFF ends tonight — don't miss out!\n  Promotional email about a limited-time sale.\n\n6 emails triaged locally in 14s (~12 min of manual triage saved).\nNothing left this machine.\n```\n\n**Live demo:** [https://friend-crops-sharp-episode.trycloudflare.com](https://friend-crops-sharp-episode.trycloudflare.com)\n\nIt shows the sample inbox (6 fake emails — bills, a friend asking for a confirmation, a flash sale, a delivery notice, a medical appointment reminder) and runs the triage live on the local Gemma model when you hit the button. ~14 seconds on CPU, no cloud API involved anywhere.\n\nYou can reproduce the whole thing offline:\n\n```\n./llama-server -m gemma-3-4b-it-qat-Q4_0.gguf --port 8801\npython sloth_digest.py --demo   # sample inbox, zero credentials needed\n```\n\nA local AI agent that reads your unread Gmail overnight and hands you a morning digest — so you don't have to.\n\nEvery email is triaged into three buckets by an **open-weight model running\nentirely on your own machine** (Gemma 3 4B IT QAT via llama.cpp):\n\nNo email content ever leaves your computer. Works offline. Costs nothing per run — set it up once and forget it.\n\nYour inbox is the most private dataset you own. A closed API means sending\nevery message — invoices, medical appointments, personal threads — to\nsomeone else's servers. Sloth Digest runs the whole pipeline against a\nlocal OpenAI-compatible endpoint, so the \"open\" piece *is* the product:\n\nThe agent is ~200 lines of Python stdlib. The only dependencies are llama.cpp (for inference) and, for the optional web UI, FastAPI.\n\nThe architecture is deliberately boring — a sloth would approve:\n\n```\nunread Gmail ──► fetch (Gmail API, strictly read-only)\n                   │\n                   ▼\n        ┌─────────────────────┐\n        │ Gemma 3 4B IT (QAT) │  per email: CATEGORY / SUMMARY / ACTION\n        │ llama.cpp, CPU      │  strict 3-line verdict, temperature 0\n        └─────────────────────┘\n                   │\n                   ▼\n        morning digest (markdown, grouped by urgency)\n```\n\nThree design choices make a small 4B model reliable enough to trust with triage:\n\n`CATEGORY` / `SUMMARY` / `ACTION`) at temperature 0. No essays, no JSON to break.\nLocal inference is not a gimmick here, it's the point: the whole pipeline — fetch, classify, summarize — runs against llama.cpp's OpenAI-compatible endpoint on `127.0.0.1`. Pull the network cable and it still works.\n\nYour inbox is probably the most private dataset you own: invoices, medical appointments, family threads, business negotiations. Triage means reading *all of it* — and with a closed API, \"reading\" means shipping every message to someone else's servers, on someone else's terms, under a privacy policy that can change.\n\nBecause Gemma's weights are open and llama.cpp is open source, the equation flips:\n\nI ran it on my real unread inbox this morning: **8 emails triaged in ~20 seconds**, and the digest correctly separated two things I genuinely needed to act on from the newsletter noise. Manual triage averages ~2 minutes per email once you include the context-switching — so the agent saves me roughly **15 minutes a day, ~90 hours a year**, for a one-time setup cost and €0 in API fees.\n\nThe cron job runs at 7am. I wake up, read one page, and go back to being lazy. The sloth wins. 🦥", "url": "https://wpnews.pro/news/sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-don-t-have-to", "canonical_source": "https://dev.to/jeffreyturov/sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-dont-have-to-9gk", "published_at": "2026-10-20 08:10:45+00:00", "updated_at": "2026-10-20 08:18:48.333228+00:00", "lang": "en", "topics": ["ai-agents", "large-language-models", "ai-tools", "artificial-intelligence", "generative-ai"], "entities": ["Gemma 3 4B IT", "llama.cpp", "Gmail", "Google", "FastAPI", "Sloth Digest", "Hacktoberfest"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-don-t-have-to", "markdown": "https://wpnews.pro/news/sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-don-t-have-to.md", "text": "https://wpnews.pro/news/sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-don-t-have-to.txt", "jsonld": "https://wpnews.pro/news/sloth-digest-a-local-gemma-3-agent-that-does-my-inbox-triage-so-i-don-t-have-to.jsonld"}}