DEV Community

Cover image for A file manager for the lazy
Aryan Garg
Aryan Garg

Posted on

A file manager for the lazy

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady πŸ¦₯

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
20th August is the international Sloth day, and so we shall evolve to sloth. I'm part sloth myself, so I consider myself at home with this challenge.

What I Built

Sloth(epic name ik) is a file manager that automatically sorts files based on name and content, so you will never have to.
This is for anyone who downloads a bunch of files and is too lazy to organise them before it becomes into an absolute mess.

Demo

Code

sloth πŸ¦₯

A slow, careful, local file organizer for college material.

sloth reads what's inside your notes, slides and scanned handouts. It asks a local Gemma model (through Ollama) which subject and unit each file belongs to, and files it under:

~/Documents/College/<Subject>/Unit <N>/<original filename&gt
  • Nothing leaves your laptop. sloth only talks to Ollama on 127.0.0.1.
  • Nothing is deleted or overwritten. Files are only moved. If a name is taken, the file becomes name (2).pdf.
  • Nothing moves until you say so. Every run is a dry-run plan first.
  • Everything can be undone. Every batch of moves is logged, and sloth undo puts the files back exactly where they were.

Built for the DEV Hacktoberfest "Slow and Steady" challenge.


Why

A semester leaves you with files called unit 3.pdf, document(3).pdf, scan_0042.pdf and notes_final(1).pdf, all in Downloads. The filename usually doesn't say which subject a file is…

How I Built It

For this, I have used gemma4:gemma4:e4b-it-qat, which provided small size, fast speeds(average 5-6 secs per file on an intel core ultra 7 256V laptop CPU) with a low memory footprint (4.3GB), while having enough intelligence to not make too many errors (tested against gemma4:e2b and gemma4:a4b-26b)

Libreoffice is used to determine action based on file-type
Tesseract is used to scan the file via OCR, which allows the program to detect data from any file, like pdfs, excel sheets, pictures etc.
first few pages(around 3000 character) are scanned to extract meaning. (because file names are often just a random mix of characters)
This data goes to gemma, which decides what to do.

Why Does Open Innovation Matter?

Biggest one is keeping everything on the system. I dont have the energy to keep vetting the files i'll hand an AI to sort. And I don't wanna worry about giving some sensitive files to an external party either.

Its mine, and I can do whatever I want with it. I made it, I know how it works, I can change it however I want.

The Lazy Payoff

I used to look at my files, sigh, before struggling to find one i need. And this happens a lot, since im too lazy to to actually sort them. This saved me from it all.

Prize Categories

Best use of gemma - Downloaded and tested like 40 gigs of models. Lots of inferencing tricks from their docs are also involved.

Top comments (0)