跳到正文
DEV Community· Tanishk·· 3 小時前AI 評分43

SlothDesk AI:用本地 AI 整理檔案的開源桌面助理

Sloath-AI

AI 導讀

SlothDesk AI 是一款開源桌面助理,利用本地 AI 整理資料夾、按文件內容建議檔名,並以自然語言搜尋檔案。它透過 Ollama 執行本地推理,主要以 qwen2.5:1.5b 測試,也可切換至 llama3.2;模型未啟動時則回退至 regex 搜尋、檔案副檔名分類及 SHA-256 去重。程式碼採用 MIT 授權,並提供本地執行方式,文件無須上傳至雲端。

正文

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

What I Built
Let’s be honest: my Downloads folder was an absolute crime scene.

Between random PDF receipts, screenshots named Screenshot 2026-10-12 at 4.23.11 PM.png, three different copies of my resume, and half-finished Python scripts, finding anything felt like digging through digital junk mail. Every few months I'd promise myself I'd sit down and organize it all, only to get bored after sorting five files and give up.

So I decided to be properly lazy and build a tool to do the chore for me: SlothDesk AI.

SlothDesk AI is a desktop productivity assistant that lives on your machine and cleans up your folders without you having to lift a finger:

It looks at a messy directory and automatically groups everything into clean folders like Documents, Code, Images, and Archives — but only after showing you a safe preview first.
It actually reads the first couple of pages of your PDFs or text documents using a local AI model and renames them from things like scan_004921.pdf to quarterly-tax-statement-2026.pdf.
It lets you ask questions like "Where is my operating systems homework from last week?" and finds the exact file without uploading your notes to any cloud.
It calculates cryptographic hashes of your files to find duplicate copies wasting gigabytes of space, staging them into a safe trash folder so nothing ever gets permanently deleted by accident.
And if you ever make a mistake, there is a full undo button backed by SQLite that puts everything back where it came from.
To keep it fun, I built the UI with an obsidian black and electric yellow theme, complete with a friendly sloth mascot named Barnaby wearing little golden spectacles.

Demo
Live Web App: https://slothdesk-ai-24yo.onrender.com
API Documentation: https://slothdesk-ai-24yo.onrender.com/docs
Running Locally (with Ollama): Just clone the repo and run ./run.sh on Ubuntu Linux.
Code

SlothDesk AI 🦥

“Work less. Let your sloth handle the boring stuff.”

Render Live License: MIT Python 3.10+ FastAPI React + Vite + TypeScript Ollama Tailwind CSS

🌐 Live Demo: https://slothdesk-ai-24yo.onrender.com

SlothDesk AI is a privacy-first desktop productivity assistant built for the “Slow and Steady” open-source AI challenge. It brings open-weight local AI directly to your operating system to organize messy folders, suggest intelligent filenames based on document excerpts, search files through natural language queries, and prepare safe storage cleanup recommendations.


🌟 Key Features

🗂️ 1. Smart File Organizer

  • Safe Dry-Run Previews: View an exact interactive preview table of where every file will be placed before anything moves.
  • Categorization Engine: Groups clutter into Documents, Images, Videos, Audio, Archives, Code, and Other.
  • Zero Data Loss Guarantee: Never overwrites files silently. Automatically resolves filename collisions (e.g. report (1).pdf).
  • Safety Boundary Checks: Prevents path traversal and skips system directories (/etc, /proc, node_modules, .git).

✍️

…

The code is completely open-source under the MIT license:
👉 github.com/tani2112/Sloathdesk-AI

It includes a full suite of 20 unit and security tests checking path traversal prevention, duplicate hash checks, and collision-safe file moves.

How I Built It
I wanted this app to be fast, safe, and above all, respectful of the user's computer:

Local Inference with Ollama: Instead of relying on an expensive cloud API, the backend hooks into a locally running Ollama instance. I tested it mainly with qwen2.5:1.5b because it’s super quick and runs smoothly even on older laptops, but you can switch to llama3.2 or any model you prefer right from the settings.
Graceful Fallbacks: One thing that bugged me about a lot of AI apps is that they completely break if the model isn't running. I built SlothDesk so that if Ollama isn't started yet, it automatically falls back to regex search, file extension mapping, and SHA-256 deduplication. It still works 100% as a solid organizer even without the AI running.
FastAPI & Python Standard Library: The backend uses FastAPI. For safety, I wrote strict path validation to make sure file operations never escape the selected folder or touch system directories like /etc or /proc. I also integrated Python's watchdog to detect when new files land in your downloads in real time.
React 19 & Tailwind CSS: The frontend is built on Vite, React, and Tailwind. I really wanted a unique look, so I went with an obsidian dark theme highlighted by neon yellow and amber gradients.
Docker & Render Deployment: To make the web demo easy to check out, I wrote a multi-stage Dockerfile and a render.yaml blueprint that compiles the React bundle and serves it all as one unified service.
Why Does Open Innovation Matter?
When you think about building a desktop assistant, the first instinct a lot of people have today is: "Just send the files to an LLM cloud API."

To me, that felt totally wrong for a tool that lives on your personal computer.

Your downloads folder has your pay stubs, bank statements, personal photos, and proprietary code. You shouldn't have to beam your private documents across the internet just to give them sensible names.

With open-weight models like Qwen and open runtime engines like Ollama, you get intelligent document understanding running right on your own CPU or GPU. It costs zero dollars in monthly API tokens, it works when your Wi-Fi drops, and your data never leaves your machine. That’s what open innovation makes possible: powerful tools that put the user in complete control.

My Agent Session
I built and debugged this project—from the FastAPI security sandbox to the React frontend and Render container deployment—pairing with Antigravity (Google DeepMind).

The Lazy Payoff
Here is my honest before-and-after:

Before building this, every Friday afternoon I’d stare at ~150 random files in my Downloads folder, squint at cryptic PDF names, open them one by one to see what they were, create five new folders, and drag things around manually. It took at least 20 minutes of brain-numbing clicking.

Now:

I open SlothDesk and click "Organize Folder".
I check the dry-run preview table to verify where everything is heading.
I hit "Apply", and in about 2 seconds, 150 files are tucked away into their proper category folders.
I hit "Scan Duplicates" and wipe out 800MB of accidental double downloads.
Total time: about 30 seconds. That leaves me with 19 and a half minutes to do what Barnaby does best: kick back and relax.

來源:DEV Community · dev.to