# Building an AI File Organizer with Python, Ollama, and Gemma 3

> Source: <https://dev.to/medhasunkad13/building-an-ai-file-organizer-with-python-ollama-and-gemma-3-2266>
> Published: 2026-10-27 07:10:46+00:00

Building an AI File Organizer with Python, Ollama, and Gemma 3

For Hacktoberfest 2026 Week 3, themed Slow and Steady, I built an AI File Organizer using Python and local AI.

The goal was simple: organize files into appropriate folders based on their file types, while exploring how a locally running AI model can assist with file classification.

What does the project do?

The AI File Organizer scans a designated folder and sorts files into categories.

The categories include:

For common file extensions, the application uses predefined rules. For unfamiliar extensions, it asks the local Gemma model for a category suggestion.

The model's response is validated against the allowed categories. If the response is invalid or an error occurs, the application falls back to Other files.

This approach taught me that AI can be useful without having to control every part of an application. Combining deterministic rules with AI suggestions makes the system more predictable.

Challenges and learnings

One challenge was that the AI model did not always return the expected category. I learned to validate model outputs instead of trusting them blindly.

I also implemented a preview-before-move workflow and tested duplicate filename handling.

This project helped me practise Python file handling, exception handling, working with a local AI model, and using Git for version control.

Project repository

🔗 GitHub: [https://github.com/MedhaSunkad13/AI-File-Organizer](https://github.com/MedhaSunkad13/AI-File-Organizer)

What's next?

I would like to improve the project with better classification, additional file categories, and more comprehensive tests.

Building this project reminded me that consistent progress, even through small steps, can lead to a working application.

I'd love to hear suggestions from the community!
