# I Used Too Much AI, So Now It Names My Files

> Source: <https://dev.to/arkaprava_bhattacharya_0d/i-used-too-much-ai-so-now-it-names-my-files-3bpo>
> Published: 2026-10-24 09:31:55+00:00

*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady](https://dev.to/challenges/hacktoberfest-week3-2026-10-19)*

I may have used AI too much: now I'm asking it what to call `scan0004.pdf`. The sample folder also has `document_001.txt` and `notes_final_v3.md`. Those names tell me almost nothing about the contents. To improve a whole folder by hand, I would have to open each file, figure out what it is, and check that the new name will not collide with something already there. That is the sort of chore I put off.

LazyRename does the reading. It scans a local folder for PDF, TXT, MD, and PY files, then asks an installed Ollama model for a short filename based on each file's contents. I get a table with the old and suggested names, and I can edit or deselect any row. The rename button stays unavailable until I check a confirmation box.

It keeps each file in its original folder and preserves its extension. It also checks Windows filename rules and collisions, writes a JSON transaction log, and offers an undo button for the latest batch. The code never executes a scanned Python file.

With `qwen3.5:4b`, one of the included samples was renamed like this:

| Before | Suggested name | 
|---|---|
| `scan0004.pdf` | `quarterly-accessibility-audit-checkout-forms-labels-focus.pdf` | 

That PDF contains a short note about checkout form labels and keyboard focus. The model did not receive `scan0004.pdf` in its prompt. In the same disposable-folder test, four suggestions were confirmed and renamed, then Undo restored every original name. The exact words a model suggests can vary by model and run.

This is a local desktop workflow, so there is no hosted app link. To try it, copy `sample_files` to a disposable folder, follow the [Windows setup instructions](https://github.com/ABhattacharya-dev/LazyRename#readme), select that folder in LazyRename, and choose an installed Ollama model.

[LazyRename on GitHub](https://github.com/ABhattacharya-dev/LazyRename) is MIT licensed. The main pieces are the [Streamlit interface](https://github.com/ABhattacharya-dev/LazyRename/blob/main/app.py), [file handling and undo logic](https://github.com/ABhattacharya-dev/LazyRename/blob/main/lazyrename/core.py), and [Ollama client](https://github.com/ABhattacharya-dev/LazyRename/blob/main/lazyrename/ollama.py). The repository also has sample files and tests for filename validation, collisions, encrypted PDFs, interrupted batches, and undo.

The app uses Python 3.11+, Streamlit for the review screen, PyMuPDF for PDF text extraction, and Ollama's local API for suggestions. The user can pick from models already installed in Ollama. The local demo used `qwen3.5:4b`; the setup guide also shows how to install `gemma3:4b`.

The model gets a bounded excerpt of the file's contents, with no original filename in the prompt. LazyRename reads up to three PDF pages or 64 KB of a text file and sends no more than 4,500 characters to Ollama. It skips empty files, encrypted PDFs, binary files, and files over 25 MB. Those limits keep a stray large file from turning a quick folder cleanup into a huge inference job.

Each model request handles one file. I later found [a report of a small model mixing up names across a batch](https://dev.to/sank8/my-1b-model-renamed-one-file-to-another-files-name-the-fix-was-a-provenance-guard-3ekm), which reinforced that choice and the need for a preview.

After inference, Python sanitizes the proposed name and keeps the original extension. Before applying a batch, it checks for collisions and verifies that the source files have not changed since the preview. The transaction log records the moves so Undo can check the paths again before restoring them. If the original name is occupied or a renamed file has changed, Undo stops instead of overwriting it.

The model can still misunderstand a file, especially when useful details fall outside the excerpt. That is why the preview is editable and every rename needs a deliberate confirmation. Image-only PDFs need OCR, which this version does not have.

These files can contain private notes, code, or work documents. With Ollama, the excerpt goes to a model running on the same computer, through `127.0.0.1`; it does not have to go to a paid hosted API. There is no API key, and I can switch models without rebuilding the app around one provider.

The source is open, too. Someone can inspect the extraction limits, change the prompt, add OCR, or tighten the rename checks. The app disables Streamlit usage stats and implements no telemetry. Packages and models need to be downloaded first; I have not tested a full run with network connectivity disabled, so I am not claiming an offline test result.

I used an AI coding assistant while building and testing LazyRename. I have not shared the session transcript yet. If I add it, I will review it first and link it here.

LazyRename displays a potential saving of 30 seconds per selected file. In the four-file sample run, that showed **two minutes**. It is an assumption for illustrating the manual work, not a measured speedup. I have not timed the full process against hand-renaming a real folder, including model loading and reviewing suggestions.
