跳到正文
DEV Community· Laiba Ashfaq·· 4 小時前AI 評分54

lazy-downloads-tidier 用本地 LLM 完全離線整理 Downloads 資料夾

I built a sloth-brained Downloads folder tidier that runs 100% offline

AI 導讀

lazy-downloads-tidier 使用 Ollama 執行本地 LLM,為 Downloads 資料夾中的檔案分類、命名並移入對應資料夾,全程離線處理,檔案不會離開用戶的裝置。

正文

Cover image for I built a sloth-brained Downloads folder tidier that runs 100% offline

Laiba Ashfaq

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

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

What I Built

My Downloads folder is a landfill: scan0001.pdf, final_v3(2).docx, IMG_4471.png. I never clean it because deciding where each file goes is exactly the kind of tiny chore I avoid.

lazy-downloads-tidier watches the folder, reads each file, and asks a local LLM two questions: which of my categories does this belong in? and what should it be called? Then it moves it to Tidy/<Category>/YYYY-MM-DD_descriptive-title.ext. I set it up once, and the chore is gone.

Demo

Code

🦥 lazy-downloads-tidier

A local LLM that reads your messy Downloads folder, gives each file a meaningful name, and files it into folders. Runs fully offline. Your files never leave your machine.

Downloads/scan0001.pdf   ->  Tidy/Finance/2026-10-19_electricity-bill-september.pdf
Downloads/IMG_4471.png   ->  Tidy/Media/2026-10-18_whiteboard-sprint-plan.png
Downloads/final_v3(2).docx -> Tidy/Work/2026-10-12_q3-marketing-report.docx

Setup (about 3 minutes)

  1. Install Ollama and pull a model
    ollama pull qwen2.5:7b      # or gemma3:4b / llama3.2:3b for less RAM
    
  2. Python 3.11+. No pip packages needed. (Optional: pdftotext from poppler for PDF reading.)
  3. Edit config.toml: set your folders, model, and categories.

Use

python tidier.py run             # dry run, prints the plan, moves nothing
python tidier.py run --apply     # do it
python tidier.py watch --apply   # leave it running, tidies new downloads
python tidier.py undo            # reverse the last batch

Safety, because lazy shouldn't mean reckless

  • Dry run by default. You must pass --apply to move anything.
  • Undo log. Every move is recorded in Tidy/.tidier-log.jsonl.
  • Never overwrites. Name…

How I Built It

  • Model: an open-weight model served by Ollama (default qwen2.5:7b; gemma3:4b or llama3.2:3b for smaller machines).
  • Zero dependencies: one stdlib-only Python file. It calls Ollama's local HTTP API and asks for JSON output at temperature 0.
  • Text extraction: plain text and code directly, .docx by reading the XML inside the zip, PDFs via pdftotext. Images and binaries are classified from filename and extension.
  • Guardrails: the model can only choose from the categories in my config.toml; anything else falls back to Misc. Filenames are slugified, collisions get _v2, and in-progress downloads are skipped.
  • Safety: dry run by default, plus an append-only log that powers undo.

Why Does Open Innovation Matter?

  • Privacy. This tool reads my tax PDFs, contracts, and personal photos. Sending those to someone else's API to get a better filename isn't a trade I'd make. With a local model, the files never leave the disk.
  • Cost. Per-file API pricing is a bad fit for "process my whole backlog of 3,000 files." Locally, the marginal cost is zero, so I can run it on everything, repeatedly, while tuning it.
  • Works offline. No internet means no problem.
  • Swappable and tunable. Changing models is one line in the config. My filing rules are plain-English category descriptions I can rewrite whenever I like, and with open weights I could fine-tune on my own past filing decisions.
  • No rug-pull. The model on my machine won't be deprecated, repriced, or silently changed under my script.

The Lazy Payoff

Prize Categories

_Best Use of Gemma: _the whole tool runs on Gemma (gemma3:1b) locally through Ollama, with no cloud calls.

Best Use of GitHub Copilot / GitHub: the project is automated with GitHub Actions, which runs the tests on every push on Ubuntu and Windows.

_Best Use of ElevenLabs: _the demo narration was generated with ElevenLabs.

來源:DEV Community · dev.to