DEV Community

Sagar Maurya
Sagar Maurya

Posted on

I Built an Offline AI File Organizer for a Friend | Hacktoberfest 2026

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

My friend's Downloads folder is a dumping ground: lecture notes, an invoice, code files, installers, images, all mixed together under names like doc_final and scan. Extension-based sorters put every PDF in one folder, and cloud AI tools would mean uploading her private files to someone else's server.

So I built Organizr, an offline file organizer that sorts files by what's inside them, not by their extension. It reads each file with a local Gemma model, proposes a folder and a short reason, and moves nothing until you click Apply. Every move can be undone.

Demo

The video has no voiceover (I have a cough), so it has English subtitles. The whole run is with Wi-Fi turned off.

I made a 20-file sample Downloads folder from the file names she sent me, using stand-in names because her real folder has IDs and certificates. Here is what Organizr did:

  • 12 files sorted with confidence. For example, a C assignment went to Assignments and an invoice to Fee Receipts, based on the text inside.
  • 8 files flagged "Please check this one": images, installers and a video, which have no readable text.
  • Apply moves the files, and Undo last move puts everything back.

Plan view

View panel showing the text and Gemma's reason

Done screen

The folder after sorting

What my friend said

I sent her the plan and the result screenshots and asked for her reaction. She replied: "this is actually cool 😮 my lecture notes and the invoice went where I'd put them.
timetable in Lecture Notes is fine too. I'd try it on my laptop..."

She said the lecture notes, the invoice and the timetable landed where she'd have put them, and that she'd try it on her laptop. She hasn't run it on her own folder yet, and she didn't comment on the files it got wrong, so that is all I'm claiming.

Her reply

Where it got things wrong

  • Gemma put a LinkedIn strategy document and a research CSV in Lecture Notes. Both are wrong. The plan view lets you change any category before applying.
  • Images, installers and videos can't be read, so they're flagged for review. Earlier in testing, Gemma made up a reason for a file with no text. OCR isn't included yet.
  • Gemma's wording changes from run to run.

Code

GitHub logo mauryasagar / ai-file-organizer

Offline AI file organizer that sorts files by content, not extension, using local Gemma via Ollama. Private, undoable, no uploads.

🗁 Organizr

An offline AI file organizer that sorts your files by what's inside them, not by their extension.
It reads each document with a local open-weight model (Gemma via Ollama), proposes where it belongs,
and moves files only after you approve. Your private files never leave your laptop

Problem · Solution · How it works · Getting started · Structure · Limitations

🎃 Built for the DEV Hacktoberfest Weekend Challenge: Build for a Friend.


The Problem

Downloads folders turn into a dumping ground. This project started with a friend whose folder mixed lecture PDFs, fee receipts, assignment files, scholarship letters and random images, all with names like doc_final.pdf and scan (3).pdf.

Existing options did not fit:

  • Extension-based sorters put every PDF in one folder, so a fee receipt lands next to lecture notes.
  • Cloud AI tools would mean uploading ID scans, marksheets and bank statements to someone else's…

How I Built It

Python, Streamlit, Ollama running gemma3:4b, PyMuPDF and python-docx.

  1. scanner.py finds safe files, skipping unfinished downloads and files changed in the last 5 minutes.
  2. extractor.py reads the first ~1000 characters of text from each file.
  3. classifier.py sends the content (not the filename) and her list of categories to Gemma, which returns JSON with a category and a reason. Anything invalid falls back to "Other".
  4. organizer.py builds the plan, moves files without ever overwriting or deleting, and writes an undo log.

I tested gemma3:1b and gemma3:4b on six files with misleading names. The 1B model got 4 of 6 right and the 4B model got 5 of 6, so I chose 4B. It runs on CPU on a 16 GB laptop in a few seconds per file. Removing the filename from the prompt improved the results, because the model stopped trusting names like doc_final.

Why Does Open Innovation Matter?

Her folder holds ID scans, marksheets and bank documents. With a closed API, sorting it would mean uploading all of that. With an open-weight model:

  • Her data stays on her laptop. The demo runs with Wi-Fi off.
  • It costs nothing to run after the model download, with no API keys and no per-request billing.
  • The model is swappable. Changing it is one line in classifier.py, which is how I compared 1B and 4B.

Prize Categories

Best Use of Gemma: the whole classifier runs on a local Gemma model (gemma3:4b) through Ollama.

Top comments (0)