This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
Sloth Sorter is a command-line tool. It sorts and renames the files in your Downloads folder. A small AI model on your own computer does the work. No file leaves your machine.
Example: bill_oct.pdf becomes Documents/Bills/2026-10_Electricity-Bill.pdf.
Many AI organizers upload your bank statements, IDs, and resumes to a server you do not control. Sloth does not. Anyone with a messy Downloads folder can set it up once and stop sorting by hand.
Demo
$ sloth plan --folder ~/Downloads
Plan: 14 files
bill_oct.pdf -> Documents/Bills/2026-10_Electricity-Bill.pdf
setup.exe -> Installers/setup.exe
2 files need review. Nothing has changed yet.
$ sloth run --folder ~/Downloads --yes
14 files tidied. 2 need review.
$ sloth undo --last 3
Put 3 files back.
Code
github.com/DhirajB05/sloth-sorter
How I Built It
Open-source parts
- Ollama runs the model on my computer.
-
Qwen2.5 3B is the default model. It runs on CPU. You can swap it for Llama 3.2 3B or another model with one line in
sloth.toml. - Python tools: watchdog, typer, pydantic, pypdf, python-docx, SQLite.
How it works
- Watch the folder for new files.
- Wait until the file is fully downloaded (size and time stay the same for 3 seconds).
- Read the first 1,500 characters of the file.
- Ask the model for a category and a clean name. Ollama must reply in a fixed JSON format. Pydantic checks the reply.
- Make sure the new path stays inside the folder.
- Move the file. Save the move in a SQLite log.
Fallbacks
If Ollama is off, Sloth sorts by file extension. If the model is not sure, the file goes to Needs Review.
Safety rules
- Sloth never deletes or overwrites a file. A name clash gets a number:
file (2).pdf. - Sloth ignores partial downloads (
.crdownload,.part,.tmp). - Sloth only talks to
localhost. A test fails if any other network call happens. - Every move can be undone with
sloth undo.
Limits
- The model makes mistakes. Example: [one real wrong result].
- Sloth does not read images. It uses only the file name.
- Scanned PDFs have no text, so the model has little to read.
Why Does Open Innovation Matter?
- Privacy: your files stay on your disk. A closed API needs an upload for each file.
- Offline: it works with no internet. [I tested with Wi-Fi off: result.]
- Cost: it costs nothing to run after install. A closed API charges for each call.
- Swap models: I compared two models by changing one config line. A closed API gives you the model the vendor chooses.
- Control: I set my own folders and naming rules in a config file.
Top comments (0)