This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
Github repo: https://github.com/Nullhermit/Hacktoberfest26/tree/Week2
code: https://github.com/Nullhermit/Hacktoberfest26/blob/main/index.html
Demo:https://www.youtube.com/watch?v=jjmGQzdt2Jw
My Downloads folder is a crime scene: invoice_final_FINAL(2).pdf, Document (7).docx, untitled.json, forty screenshots, and an installer I ran once in August. I've promised myself a cleanup every month for a year, and it never happens, because sorting files is boring and renaming them is worse.
SlothSort is the lazy fix. It looks at a messy pile of files, works out what each one actually is, sorts it into a category folder and gives it a readable name. All I do is look at the plan and say yes.
It comes in two flavours that share the same idea:
A command-line tool (Python, no dependencies) for tidying a real folder in one command.
A single-page web app where you drop files onto the page, edit the plan, and copy the files into a tidy folder or download a script that moves them.
Anyone with a cluttered Downloads or Desktop folder gets to be a little lazier, especially students juggling assignments, notes, datasets and screenshots.
How I Built It
Model: Gemma (gemma3:4b by default) running locally through Ollama, called over its HTTP API. Swap models with --model in the CLI or the model box in the web app.
CLI: pure Python standard library. Optional pypdf lets it peek at the first page of PDFs.
Web app: one static index.html with no framework and no build step. The browser reads each file's name, size, date and a short text peek, and sends only that to Ollama on your own machine. There's no backend, so no server ever sees your files.
Flow: for each file, Gemma receives that small bundle of evidence and replies with JSON containing a category and a clear new name. SlothSort turns the replies into a plan, and nothing moves until you approve it.
A 4B model will sometimes get things wrong, and I'm letting it near my files, so most of the engineering went into making mistakes cheap:
Dry run by default. Nothing moves until you say so (--apply in the CLI, an explicit button in the web app).
No deletes, no overwrites. Name collisions get -2, -3, and so on. The web app's "copy" mode never touches the originals.
Model output is treated as untrusted. Categories must come from a fixed list and names are slugified, so a reply like "../../etc/evil" can't escape the folder.
A fallback exists. If Gemma returns broken JSON or Ollama isn't running, files are sorted by extension and marked [rules] in the plan.
Everything is undoable. The CLI writes an undo log for --undo, and the web app can generate an undo.sh.
You can edit the plan. In the web app, every folder and file name in the plan is editable before anything happens.
I tested the CLI against a tiny fake Ollama server (no GPU needed), covering dry run, apply, undo, collisions, garbage output, a hostile reply, and Ollama being offline. I also tested the web app's planning logic the same way.
Limits: it only handles loose files, not nested folders; it can only judge what it can see, so a PDF with no extractable text is sorted on name and date alone; and a 4B model sometimes picks a bland name, which is what the review step is for. A web page can only reach local Ollama if you allow it with OLLAMA_ORIGINS, which is a one-time setup step. I haven't benchmarked accuracy on a large set.
Why Does Open Innovation Matter?
A Downloads folder holds bank statements, assignments, ID scans and half-finished work. Sending all of that to a closed API just to learn that Document (7) is a meeting note is a bad trade.
Private by design. Gemma runs on my laptop. File names and text peeks never leave the machine.
Works offline. No internet needed once the model is pulled.
Costs nothing per run. I can point it at thousands of files without watching a bill or running out of credits.
Swappable. Changing the model is one flag or one text box: bigger for better names, smaller for faster runs on a weak laptop.
Prize Categories
Best Use of Gemma: Gemma is the core of the project, run locally through Ollama.
just download it and give it a try!
Top comments (0)