跳到正文
DEV Community· Brage Mellesdal·· 2 小時前AI 評分53

Sloth Sorter 推出本機 AI 檔案整理桌面應用程式

I got too lazy to name my files, so a local AI does it now.

AI 導讀

Brage Mellesdal 開發 Sloth Sorter,一款利用本機 AI 為檔案重新命名並分類的桌面應用程式。它透過 Ollama 執行 Gemma 3(gemma3:4b),支援 Windows、macOS 和 Linux,設定後毋須連接互聯網,檔案不會離開電腦。用戶可先審核整理計劃再執行,並一鍵復原;28 項自動測試使用模擬 Ollama 伺服器,沒有評估模型的判斷品質。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Everyone has a Downloads folder like mine: IMG_2231.png, document (1).docx, scan0412.pdf, asdf.png, and a manual named just manual.pdf. Tidying it by hand means opening every file to remember what it is. So I never do it.

Sloth Sorter is a desktop app that does it for you. You pick a folder, and an AI that runs on your own computer reads what is inside each file, gives the cryptic ones a readable name, and sorts everything into sensible folders: Bills & Receipts, School, Work, Photos, and so on. Nothing moves until you have looked at the plan. You can edit any name, change any folder, or untick files you want left alone. Once you press Tidy, one click on Undo puts everything back.

The laziest part is Sleep mode: switch it on, close the window, and the app quietly tidies your Downloads folder in the background, only touching files you have left alone for a few minutes. Every automatic tidy shows up in History, where you can undo it.

It is meant for people who do not want to touch a terminal. It installs like any other program on Windows, macOS and Linux, and a guided first-run screen walks you through setting up the AI. There is no account, no subscription, and no API key.

The plan screen, where you review every rename before anything moves

The screenshots use a folder of made-up demo files.

Demo

The video walks through the Windows installer: first-run setup, scanning a folder, reviewing the plan, tidying, and undoing. You can also download the installer yourself from the latest release, and try it safely on the sample-files folder in the repo. It is a made-up messy folder with invoices, a scanned receipt, and a manual whose product name only appears on the last page.

Code

Sloth Sorter

A lazy, private file tidier. An AI that lives on your computer reads your messy folder, renames the cryptic files, sorts everything into sensible folders, and lets you undo it all with one click.

No account. No subscription. No internet needed after setup. Your files never leave your computer.

Review screen

Pick a folder Done, with undo

Sleep mode Settings

The screenshots show the app in its default dark look, on a folder of made-up demo files. Light mode is one click away in Settings.

For everyone: install it

Download the latest version

Open that page, scroll to Assets, and download the file for your computer:

Your computer Download
Windows 10 or 11 Sloth-Sorter-1.0.0-win-x64.exe
Mac with an Apple chip (2020 and newer) Sloth-Sorter-1.0.0-mac-arm64.dmg
Mac with an Intel chip Sloth-Sorter-1.0.0-mac-x64.dmg
Linux Sloth-Sorter-1.0.0-linux-x86_64.AppImage

The version number in the file name changes with each release. Don't download "Source code" unless you want to build it yourself (see below).

Install and first

…

MIT licensed. The README has install steps for every system and an honest "what it can't do yet" section.

How I Built It

The open model. Sloth Sorter runs Gemma 3 (gemma3:4b, Google's open-weight model) through Ollama. It is small enough for an ordinary laptop, and it can look at pictures as well as read text. The app lets you pick any other model from the Ollama library in Settings, so a better small model next month is a one-line change.

The app. Electron for the window, tray icon and installers, with a plain HTML, CSS and JavaScript interface (no build step, no CDN, so it works offline). The code that decides things lives in a separate folder with no Electron in it, which is what makes it testable.

How a file gets classified:

  1. The app extracts a short snippet locally: the text of a text file, Word file or PDF, or a shrunken copy of a picture.
  2. It asks the model for a summary, a category, a title and a date, using Ollama's structured output with a JSON schema. The category field is an enum made from your folder list, so a 4B model cannot ramble or invent a category. It can only choose one of your folders.
  3. The answer is checked and cleaned, then turned into a plan that you review before anything moves.

What real testing taught me. My first version looked fine in a mock and then did silly things on real files. A few fixes that mattered:

  • Manuals. A game manual opens with pages of health warnings, so the model named it after the warning. The app now reads sampled pages from the start, middle and end, and also collects clues from the whole document, such as "X is a trademark of Y" and copyright lines, which usually sit on the last page. That is how a manual gets named after its product.
  • Scanned PDFs. A PDF with no text layer has nothing to read. The app renders the first page to a picture and shows it to the vision model.
  • Invented dates. The model kept putting today's date in file names. A date now only goes in a name if the year really appears in the document's text. Dates read off pictures are thrown away, because small vision models misread digits.
  • Lazy models. Small models over-use "Other". The app corrects obvious cases using the file type.

Safety, because it touches real files. It never deletes or overwrites anything (a name clash gets a (2)), only touches the top level of the chosen folder, skips hidden files and unfinished downloads, never changes a file extension, and writes every move to an undo history. The destination of every move is rebuilt from validated pieces, so a clever file name cannot escape the target folder.

Testing, and what it doesn't prove. There are 28 automated tests. They run on Windows, macOS and Linux for every push, and they use a mock Ollama server instead of a real model. That checks the app's logic and safety rules, not the AI's judgement. I checked the quality of the real model's names and folders by hand on real files. The cross-platform tests were worth it: they caught a bug where files created a moment ago were skipped on Windows and macOS because of clock rounding, and a PDF that one PDF engine would not open on Windows.

Why Does Open Innovation Matter?

A file tidier has to read your files: invoices, lease letters, tax papers, receipts. That is exactly what you should not upload to someone else's server, and it is why this project only works with an open model:

  • Private by construction. There is no server to trust, because there is no server. The app only ever talks to Ollama on your own computer.
  • Works offline. After the one-time download, no internet is needed.
  • Free to leave running. Sleep mode may classify files all day. With a paid API that would be a bill that grows every time a file lands in Downloads, plus a key to manage. Locally it costs a little electricity.
  • Swappable. Different computers need different models. Someone with an old laptop can pick a tiny one, and someone with a good graphics card can pick a smarter one. A closed API gives you one model, one price and one set of terms.
  • Reliable even when small. Local structured output is what turns a small model into a dependable tool.

The Lazy Payoff

The honest numbers: on my computer, which has no supported graphics card, the AI takes roughly 20 seconds per text file and about a minute per photo. My first full test of 18 mixed files took around 15 minutes. That sounds slow, but it is 15 minutes I did not spend. I pressed a button and walked away. With a graphics card it is much faster, and Sleep mode makes the speed almost irrelevant, because it works in the background while you do something else.

The real saving is attention. The files in my test folder were the kind I would never have renamed by hand: receipts called download (1).png, a manual called manual.pdf, a story called asdgawgwagasdf.docx. Afterwards they were named and filed. The one thing I never had to do was decide, file by file, what to call them.

I also listed the limits in the README (slow on computers without a graphics card, small models can still get a name wrong, only the top level of a folder is tidied, unsigned installers). That is why the app shows you the plan first and keeps an undo history.

Prize Categories

  • Best Use of Gemma: Use Gemma, Google's open-weight model, in building your project: run it locally, fine-tune it, or serve it through Google Cloud or another provider.

來源:DEV Community · dev.to