This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 3 — theme: Slow and Steady.
What I built
sloth-sorter 🦥 is a file tidier for people who keep putting off cleaning Downloads. Point it at a folder: a local open-weight model (Gemma 3 4B through Ollama) reads each file, picks a category folder, and gives it a clean kebab-case name. It's a dry run by default, so nothing moves until you pass --apply.
ollama pull gemma3:4b
python3 sloth.py ~/Downloads # preview
python3 sloth.py ~/Downloads --apply # move files
It's about 60 lines of stdlib-only Python — no pip install.
Demo
I made a messy folder with five files and ran it:
Untitled-3.txt -> notes/meeting-notes.txt
doc (1).txt -> contracts/service-agreement.txt
export.csv -> docs/export-csv.csv
final_final2.py -> code/fib.py
scan_0001.txt -> invoices/scan-2041.txt
The model got four of five clearly right. export.csv (a list of expenses) landed in docs instead of something better, and its name just repeats the extension. Small models are imperfect, which is exactly why the dry run exists.
The lazy payoff
Five files took about 12 seconds on a laptop, with zero decisions from me. Sorting them by hand means opening each one to remember what it is. The saving grows with the folder: you review a list instead of reading files.
Why open innovation matters here
Your Downloads folder holds invoices, contracts and personal notes. Sending those to a hosted API just to rename them would be a bad trade. With an open-weight model running through Ollama, file contents never leave the machine, it costs nothing per file, and I can swap the model with --model for a bigger or smaller one.
How it works
For each file it sends the name plus the first 600 characters (or just size/type for binaries) to Ollama with format: json, validates the folder against a fixed list, sanitizes the name, and avoids overwriting by appending a counter.
Code
What I'd do next
Read PDFs and images (a vision-capable Gemma), and add an undo log.
Built with: Gemma 3 (Best Use of Gemma), Ollama, Python.
Top comments (0)