Home / use case

Slothsort: a local Gemma 3 agent that renames and files a messy Downloads folder overnight

At a glance
Hardware
An 8-core CPU with no GPU in his demo run
Models & engines
Gemma 3 4B through Ollama (gemma3:1b can be set for older laptops)
Key gotcha
For images with no text, the model started borrowing the example phrase from the prompt as the subject, so those images now skip the model and get named from measured colours and shape.

What they built

Cody Topp's target is the designer's Downloads folder: screenshots with timestamp names, Untitled-1.png, document(3).pdf and logo_FINAL_final_v3 (1).png. Slothsort reads every loose file, gives it a dated, descriptive name and files it into a sensible folder, so an invoice becomes something like Invoices & Receipts/2026-10-11_invoice-88231-for-500-a2-posters.pdf.

It runs entirely on the machine with Gemma 3 4B and Tesseract, and can be set up as a nightly cron job. The privacy argument is what's in a designer's Downloads: client invoices, NDA brand work, contracts and screenshots of banking dashboards.

The demo folder was generated by a script with made-up brands, so no real client files were used, and he notes an AI coding agent wrote most of the code under his direction.

Setup

  • Gemma 3 4B through Ollama (gemma3:1b can be set for older laptops)
  • Tesseract for OCR
  • Pillow for image measurements
  • Standard-library Python, MIT licensed, 30 unit tests
  • An 8-core CPU with no GPU in his demo run

How it works

  1. Gemma's only job is to return two fields via Ollama structured outputs: a kind from a fixed list and a 3 to 6 word subject.
  2. Plain code handles dated slug names, collision-safe suffixes, SHA-256 duplicate detection, skipping files edited between plan and apply, and a journal that makes undo reliable.
  3. It checks the model's capabilities through Ollama's API; with a text-only build it feeds Gemma the OCR text plus measured facts like pixel size and dominant colours.
  4. A SQLite index with FTS5 and per-file vectors powers slothsort find, so a search for "card declined" can find a screenshot whose name never mentioned a card.

Results & numbers

  • The demo folder of 13 files was planned and filed in 38 seconds on an idle 8-core CPU, with 8 files read by the model.
  • On 100,000 synthetic index entries, median search took 11.7 ms for words, 4.2 ms for similarity and 20.1 ms combined.

Gotchas

  • For images with no text, the model started borrowing the example phrase from the prompt as the subject, so those images now skip the model and get named from measured colours and shape.
  • Without vision it filed a phone mockup under Logos & Brand, which is why there's a plan page and an undo.
  • His network blocked downloading nomic-embed-text, so similarity search falls back to fuzzy word-fragment vectors until the real embedding model is installed.
“the model describes, the code decides.”— Cody Topp

Do it yourself

  1. Install Ollama and run ollama pull gemma3:4b.
  2. Install Tesseract.
  3. Clone github.com/ctopp11/slothsort.
  4. Run python3 -m slothsort plan ~/Downloads and review the HTML plan page.
  5. Run python3 -m slothsort apply ~/Downloads, or undo to put everything back.
  6. Add the cron line with --overnight to run it nightly at low priority.
ollama pull gemma3:4b
python3 -m slothsort plan ~/Downloads
python3 -m slothsort apply ~/Downloads
# nightly:
0 2 * * * cd ~/slothsort && python3 -m slothsort run ~/Downloads --overnight
Source: Cody Topp (DEV Community) · Published 2026-10-24 · Added 2026-10-24. This write-up summarizes the original source; see it for full details.

Similar setups

Hush: a local Gemma 2B notification filter that only interrupts for real emergencies

Rajan Mishra built Hush, which runs Gemma 2B via Ollama on-device to classify macOS notifications and IMAP email, batching everything into a four-line brief every three hours unless a scored emergency breaks through.

Rajan Mishra (DEV Community) · 2026-10-24

LazyDesk AI: a local file organizer that renames and sorts your Downloads with Qwen3

LazyDesk AI scans a folder you allow, reads PDFs, DOCX, Markdown and CSVs locally, and has a local Ollama model propose clean filenames and categories, then moves files only after you approve, with hash-checked one-click undo.

Ayush Dinda (DEV Community) · 2026-10-20

Gist: an offline exam-prep partner that mines past papers with Ollama

A student built Gist so a friend could study from lecture PDFs and three-plus years of past exam papers without uploading copyrighted course material anywhere; parsing, embeddings, search and the LLM all run on the laptop with Wi-Fi off.

DEV Community (Hacktoberfest Build for a Friend) · 2026-10-20

A local contract and invoice agent whose citations are checked by code

Gonzalo Blasco built a laptop-only agent that answers questions about contracts and invoices and only accepts a citation if its quote literally appears in the retrieved chunk; Gemma 4 12B got 18 of 18 of his test questions right.

DEV Community (Gonzalo Blasco) · 2026-11-21