DEV Community

Manish Kumar Yadav
Manish Kumar Yadav

Posted on

I Built SlothSort AI: A Local-First File Organizer with AI-Powered Naming Suggestions 🦥

I Built SlothSort AI: A Local-First File Organizer with AI-Powered Naming Suggestions 🦥

Have you ever opened a folder and found yourself staring at filenames like lec-3.pdf, stuff.txt, or IMG_2026.png, wondering what to rename first?

Renaming files one by one is repetitive. I wanted to build something that could make this process simpler while keeping the user in control.

That's how SlothSort AI came to life.

🔗 GitHub Repository: https://github.com/Manish010325/slothsort-ai

💡 What is SlothSort AI?

SlothSort AI is a file organizer that uses a locally running AI model to suggest clearer, more consistent filenames.

Instead of automatically renaming everything, it follows a simple principle:

AI suggests. You decide.

The user reviews the suggestions, selects the desired changes, and can undo the last rename operation.

✨ What can it do?

  • 📂 Scan folders: View filenames, extensions, file sizes, and modification dates.
  • 🧠 Generate suggestions: Use a local Gemma model through Ollama to suggest better filenames.
  • ✅ Keep control: Select which suggested renames to apply.
  • ↩️ Undo changes: Restore filenames from the most recent rename batch.
  • 🛡️ Validate requests: Check proposed changes before renaming files.
  • 🔒 Run locally: Use local AI inference instead of relying on a hosted AI API for filename suggestions.

🛠️ Tech Stack

Here's what I used to build it:

  • Frontend: HTML, CSS, JavaScript
  • Backend: Node.js and Express.js
  • Local AI: Ollama with Gemma (gemma4:e2b)
  • Testing: Node.js built-in test runner

I wanted to keep the stack straightforward while learning how a frontend, backend, file system operations, and a locally running AI model can work together.

⚙️ How does it work?

The workflow is simple:

  1. Scan the demo folder.
  2. Review the available file information.
  3. Generate filename suggestions using the local model.
  4. Select the changes you want to apply.
  5. Apply the renames or undo the last batch.

The application works with filenames and file metadata; it doesn't need to read document contents to generate suggestions.

🚀 Run it locally

You'll need Node.js, npm, and Ollama installed.

1. Clone the repository

git clone https://github.com/Manish010325/slothsort-ai.git
cd slothsort-ai
Enter fullscreen mode Exit fullscreen mode

2. Install dependencies

npm install
Enter fullscreen mode Exit fullscreen mode

3. Download the model

ollama pull gemma4:e2b
Enter fullscreen mode Exit fullscreen mode

Make sure Ollama is running.

4. Start the application

npm run dev
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000 in your browser.

5. Run the tests

npm test
Enter fullscreen mode Exit fullscreen mode

The current test suite covers folder scanning, AI suggestion validation, and rename/undo behavior. All nine tests passed in my latest local run.

🔐 Why local-first AI?

I wanted to explore a practical use of AI without making a hosted AI service a requirement for filename suggestions.

Running the model locally keeps the inference process on the user's machine. However, this doesn't replace normal file backups or eliminate every possible file-system risk, so changes should still be reviewed carefully.

🌱 What I learned

Building SlothSort AI helped me bring together several concepts:

  • Integrating a local AI model into a Node.js application
  • Validating model-generated output before using it
  • Working with file-system operations and rename conflicts
  • Writing automated tests for important application behavior
  • Designing a workflow where users approve AI-generated changes

One important lesson: getting AI to generate a suggestion is only part of the job. Building safeguards around what happens next matters just as much.

🤝 Explore the project

SlothSort AI is an open-source learning project, and I'd love for developers to explore the code, try it locally, and share constructive feedback.

🔗 Repository: https://github.com/Manish010325/slothsort-ai

I'd especially appreciate feedback on the filename suggestion workflow, file-safety checks, and ways to make the project more useful.

A question for the community: Would you prefer an AI file organizer that suggests filenames only, or one that also recommends folders and categories?

Thanks for reading! 🦥

Top comments (1)

Collapse
 
manishyadav11155 profile image
Manish Kumar Yadav •

I'd love to hear your feedback! 🦥

While building SlothSort AI, I wanted to explore how local AI could make everyday file management easier while keeping users in control.

What would you add next?

  • Smarter filename suggestions
  • Automatic folder categorization
  • Duplicate file detection

I'd appreciate your thoughts and suggestions. Thanks for checking out my project!

🔗 GitHub: github.com/Manish010325/slothsort-ai