DEV Community

TAIL
TAIL

Posted on

Sloth Vault

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission πŸ¦₯

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Sloth Vault is a lazy filing system for people whose folders are a landfill. Point it at a folder and a local Gemma model reads each file (text, the first page of PDFs, even photos) and gives it a proper name, like 2026-10-24_airtel-broadband-invoice.pdf instead of IMG_4821.jpg.

It then files everything into a predictable layout, Category / Year / Month, and builds a searchable INDEX.csv plus a README of the rules, so anyone can find things without asking the person who set it up. Everything is logged, so one command undoes the whole run.

Demo

Before: the unsorted folder, listed with tree /f.

Terminal output of the tree /f command listing the unsorted image files in a single messy folder

Dry run: Sloth Vault plans the tidy-up without moving anything.

Terminal showing Sloth Vault running a dry run with the live progress display while Gemma reads each file

The plan: A before and after table of original file names and their new names and folders.

Dry run result table comparing each original file name with its new dated name and destination folder

After: the sorted vault in File Explorer after we run with --apply.

File Explorer window showing the sorted vault with organised category folders

The index: every file's new path, original name, summary and tags, searchable in INDEX.csv.

Contents of INDEX.csv listing each filed image with its new path, original name, summary and tags

The final structure: the same tree /f command on the sorted vault, showing the category, year and month hierarchy.

Terminal output of tree /f for the sorted vault showing the nested category, year and month folders with renamed files

Code

https://github.com/GodOfZap/Sloth-Vault

How I Built It

  • Model: Gemma 3 (4B), open-weight, served locally through Ollama. Gemma's vision reads photos and names them by what they show.
  • Glue: a single Python script that asks Gemma for strict JSON (category, title, summary, tags) using Ollama's JSON mode. Obvious file types are sorted by extension rules, so the model only does the thinking.
  • Safety: it defaults to a dry run and never overwrites a file (collisions get a numeric suffix). Exact duplicates are parked in _Duplicates instead of deleted, and every move is logged for --undo.
  • Extras: --find searches the vault, --watch tidies new files as they arrive, and a live terminal progress bar shows what the sloth is doing.

Why Does Open Innovation Matter?

Your folders might include tax forms, rΓ©sumΓ©s, screenshots, bank statements and many more. With an open-weight model, none of that is uploaded to anyone's server. It also works offline, costs nothing per file, and I can swap in a bigger or smaller Gemma, or change the categories and prompt, with a one-line edit. A closed API would mean sending my private files to a third party and paying per call to organise them.

The Lazy Payoff

I ran Sloth Vault on a camera-roll folder full of photos named things like 650028291_18101274937925214_..._n.jpg. In one dry run, Gemma (running locally, 4B) looked at each photo and proposed a name and a home:

  • 28341743-d6fa-...jpg β†’ 04_Images/2026/2026-04/2026-04-09_cloud-computing-workshop.jpg
  • 650028291_..._n.jpg β†’ 04_Images/2026/2026-04/2026-04-08_graduation-ceremony.jpg

Honest numbers from that run: 3 files, about 6.7 seconds each on my machine, 1,453 tokens in total, and zero cost. Three files is too small to beat doing it by hand, so the payoff is in what happens at scale: at that speed, 100 files is roughly 11 minutes of waiting for the model. That's time I can spend elsewhere, because I start it and walk away (or leave --watch running). Tidying 100 files by hand would take me far longer, and the names would be worse.

The bigger win is that the result is findable. Every file lands in a dated folder and gets a searchable line in INDEX.csv, so "that workshop photo" becomes --find workshop instead of scrolling through hundreds of numbered files.

Prize Categories

  • Best Use of Gemma

Top comments (0)