My Laptop Is Too Slow to Chat With an AI, So I Gave It the Night Shift
Description and use
The sloth script automatically renames and organizes Downloads folder files overnight using a local Gemma 4 model, suitable for low‑spec laptops.
Problem
A laptop with limited CPU, RAM and no GPU cannot run an AI chat in real time, but can run a slow inference job overnight to tidy the Downloads folder.
Outcome
On a low‑spec laptop, the script processes 13 files in 8–26 s each, totaling 2–4 min per run, while keeping memory usage low. The "think":false flag reduces token generation from ~500 to ~30 per file, cutting runtime by 7–30×.
Workflow
- 1. Skip files modified in the last 24 h or with .crdownload/.part extensions.
- 2. Skip installers, archives, audio/video by extension; keep original names.
- 3. Read file preview: first two PDF pages, DOCX text, first 1,500 chars of text files, or full image.
- 4. Send preview to Gemma 4 (gemma4:e2b‑it‑qat) via Ollama with a JSON schema that forces a category (one of eight folders).
- 5. Prefix new name with file’s timestamp (YYYY‑MM‑DD_).
- 6. Move file to the chosen folder and record the move.
- 7. After all files processed, generate SLOTH_REPORT.md.
- 8. Provide python sloth.py undo
<path>to revert the last run.
Evidence
Gemma 4 has a thinking mode, and it's on by default.
It reads each document, looks at each image, gives the file a name a human would pick, and moves it into a folder.
The heart of it is a single HTTP request to Ollama: ... "think": False ...
- Record date: 2026-10-21T18:11:43.459Z