DEV Community

noneofurbusiness
noneofurbusiness

Posted on

SlothSort

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

🦥 SlothSort: A Lazy Way to Organize Your Downloads with Local AI

My submission for the Hacktoberfest Open-Source AI Challenge — Week 3: Slow and Steady.

What I Built

My Downloads folder was full of files with names like final_final_v2.zip and IMG_8841.png. I kept postponing the cleanup, so I built SlothSort — a local AI agent that organizes files for me.

It reads supported file contents, suggests meaningful filenames, and moves files into sensible folders. It never deletes files, and every operation is logged so I can undo changes.

Demo

How It Works

  1. Scan: Python scans files and extracts text from supported text files and PDFs. Images are currently classified using their filenames and extensions because OCR isn't implemented yet.
  2. Understand: Gemma runs locally through Ollama and returns structured JSON with a category, suggested filename, and explanation.
  3. Plan first: The plan command previews proposed changes without moving anything.
  4. Move and undo: The apply command moves files, while SQLite logs operations so undo can restore their previous locations.

Stack: Python, Gemma via Ollama, SQLite, and an optional PDF reader.

Why Open-Source AI Matters

Downloads folders can contain private documents, resumes, marksheets, and financial records. Uploading them to a cloud AI service just to organize files isn't ideal.

With Gemma running locally through Ollama, SlothSort can process supported content on my own machine. Once the model and dependencies are installed, the workflow can operate offline without requiring a paid AI API for every request.

Open-weight AI also gives me the freedom to experiment with models and customize the workflow while keeping greater control over my data.

Safety First

  • Dry-run mode previews changes before execution.
  • Files are moved, never deleted.
  • Model output is validated, and filenames are sanitized to prevent unsafe paths.
  • Rule-based fallback handles cases where Ollama is unavailable.
  • Automated tests cover dry-run, apply/undo, and invalid model output.

What Worked and What Didn't

  • Worked: [Add your actual test results: files correctly classified out of total files tested.]
  • Didn't: Without OCR, images are classified using filenames and extensions, so their actual contents aren't understood.
  • Next: Add OCR and a review step for uncertain classifications.

What I Learned

Building SlothSort showed me that reliable AI automation needs more than a good prompt. Validating model output, previewing changes, and supporting undo are essential for making an agent safer and more useful.

The goal: Spend less time organizing files and more time doing what matters. Let the sloth take care of the boring stuff. 🦥

devchallenges #hf26challenge #Gemma #Ollama

Top comments (0)