LazyFiles:以本地 AI 協助整理檔案的工具
lazy-files
LazyFiles 是一款以 Ollama 本地推理協助整理檔案的工具,可掃描資料夾、以 SHA-256 檢測重複檔案,並提出分類及檔名建議。用戶可預覽操作、以 dry-run 模擬變更,並透過 JSON 操作紀錄及回滾功能管理檔案;本地推理不代表應用程式不會連接網絡,網絡行為仍須另行核實。
LazyFiles: A Privacy-First AI File Organizer That Does the Boring Work for You
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
Have you ever opened your Downloads folder and found hundreds of files scattered everywhere—duplicate documents, confusing filenames, screenshots, and files you forgot even existed?
I built LazyFiles, a privacy-first, AI-powered file organizer designed to make file management less tedious.
Instead of manually inspecting every file, deciding where it belongs, and renaming it one by one, LazyFiles helps automate the repetitive parts while keeping the user in control.
Here’s what it can do:
- Scan folders: Build a file inventory with useful metadata.
- Find duplicates: Use SHA-256 hashes to identify files with identical content.
- Suggest categories: Use a locally running AI model to propose sensible file categories and filenames.
- Preview changes: Review proposed operations before applying them.
- Move files safely: Use collision-safe file operations and dry-run simulation.
- Keep an audit trail: Record operations in JSON logs and provide a rollback option.
The central idea is simple: let AI handle the tedious suggestions, but let the user make the final decisions.
LazyFiles is built for people who want a more organized computer without handing control of their files to an external service.
The demo will show the folder scanner, duplicate inspector, AI-generated suggestions, operation preview, and rollback workflow.
Code
GitHub repository: [https://github.com/shanaldo7/lazy-files]
The project includes a Streamlit interface, modular Python components, setup instructions, and tests.
How I Built It
I built LazyFiles with Python and Streamlit, using open-source tools and local AI inference.
The main components are:
- Python and pathlib for folder traversal and file management.
- SHA-256 hashing for content-based duplicate detection.
- Ollama to run an AI model locally.
- Streamlit for the interactive dashboard.
- JSON audit logs to record file operations.
- Pytest for testing core functionality.
The AI component integrates with Ollama and supports local model options such as qwen2.5:0.5b, llama3.2:1b, and phi3:mini, depending on the model installed and available system resources.
The application separates scanning, duplicate detection, categorization, and file operations into individual modules. This makes the project easier to maintain and test.
I also designed it with modest hardware in mind. My development environment uses Windows 10, an Intel Core i5-8500, 8 GB of RAM, and integrated graphics, so lightweight local inference matters.
Safety was an important design goal. LazyFiles provides dry-run simulation, previews proposed changes, uses collision-safe moves, and maintains operation logs with rollback support. It is intended to assist with organization rather than silently make destructive decisions.
Why Does Open Innovation Matter?
Open innovation made it possible for me to build an AI-assisted tool around local inference rather than depending on a paid, cloud-hosted AI API.
Using open-source software and open-weight models gives developers more flexibility over model selection, hardware requirements, and how AI fits into an application.
For a tool that works with personal files, local inference is especially useful because file contents do not need to be sent to a third-party AI API for the categorization workflow described here.
Running locally is not, by itself, proof that an application makes no network connections, so network behavior should be verified separately before making absolute privacy claims.
Open innovation also makes projects like LazyFiles easier to experiment with, inspect, adapt, and improve. Developers can build useful AI features without necessarily needing an expensive GPU or a commercial API subscription.
My Agent Session
[Optional: Add your DevRelay agent session link here.]
I can use this section to show how the project was developed, including the implementation process, debugging, and decisions made along the way.
The Lazy Payoff
The goal of LazyFiles is to reduce the repetitive work involved in organizing files.
Instead of manually checking every file, comparing possible duplicates, and thinking up filenames, users can start with a scan, review AI suggestions, and approve the changes they want.
I have implemented the core workflow, including scanning, duplicate detection, categorization suggestions, safe file operations, and rollback support.
I have not included a measured time-saving figure here because I have not established a reliable before-and-after benchmark yet. A useful next step would be to compare the time required to organize the same sample folder manually and with LazyFiles.
What's Next?
I want to keep improving LazyFiles with better categorization, more comprehensive tests, clearer operation previews, and stronger safety checks.
My goal is to make local AI practical for everyday tasks—not just impressive demos.
LazyFiles is my attempt to make file organization a little less work, one folder at a time.
來源:DEV Community · dev.to