This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Everyone's default Downloads and Desktop folders quickly become digital landfills of chaos. Cryptic files like download (1).pdf, scan_0042.jpg, W2_Tax_Year_2025.txt, and untitled_notes_oct.md pile up over months. We all know we should organize them, but manual file triage is one of the most soul-crushing, procrastination-inducing chores on a computer.

SlothSort is built to let you channel your inner sloth. It is an autonomous, 100% local file and clutter organizer powered by quantized open-weight Small Language Models (SLMs) such as Llama 3.2 3B and Qwen 2.5 3B running through Ollama.

What It Does:

  1. Sniffs 2KB File Headers: Instead of freezing your computer by reading massive files, SlothSort safely samples the first 2,048 bytes of documents, scripts, and media metadata.
  2. Understands Document Intent: The local open-weight model analyzes the snippet, infers the true semantic purpose of the file, assigns it to one of 18 structured vault domains, and generates a clean, normalized, date-stamped title (e.g., transforming download (1).txt into 2026-10-22_Cloud_Compute_Invoice.txt).
  3. Reversible Safe Move: Files are moved into structured category vaults with automatic collision prevention.
  4. Append-Only Audit Manifest: Every single file operation is logged into an immutable JSONL manifest (slothsort_manifest.jsonl), enabling instant 1-click total undo.
  5. Modern Glassmorphic Web Dashboard: A viewport-fitted (100vh) dashboard with dense ~38px file tiles, in-app file modal previewer (image rendering, syntax highlighting), batch operations (move, bulk delete, ZIP archive download), and a collapsible real-time engine stream terminal.

Who gets to be lazier?
Developers, students, remote workers, accountants, and anyone who has ever stared at a 500-item Downloads folder in quiet despair. You click "Sort Now" once, and your clutter vanishes into organized vaults while you relax.

Demo

Visual Dashboard Highlights:

  1. Autonomous Sorting in Action:
    The dashboard displays a dual-panel workspace: messy inbox on the left with instant AI pre-scan confidence, and the categorized Organized Vault on the right.

  2. High-Density Compact Tiles:
    File cards are condensed down to sleek ~38px two-line tiles showing category icons, original vs. new filenames, file size, truncated AI reasoning snippets (💡 ...), and micro-action toolbars (Copy Path, Move, Rename, Download, Preview, Delete).

  3. In-App Modal Previewer & Batch Actions:
    Inspect syntax-highlighted code, Markdown notes, or images directly in-browser. Multi-select files to batch-move across categories or download as a bundled ZIP archive.

Code

GitHub logo tharu200304 / SlothSort

SlothSort is an autonomous local file and clutter tidier.

SlothSort

SlothSort AI Cover Banner

Autonomous Local AI File & Clutter Tidier powered by Open-Weight Models.
100% Offline • Zero Cloud Egress • Zero Marginal Token Fees • Complete Reversibility

Python FastAPI Ollama Privacy Air-Gapped License

📑 Table of Contents


💡 The Problem & The Vision

Every developer, knowledge worker, and student knows the "Downloads Folder Graveyard." Over weeks and months, our default download and desktop directories become chaotic dumping grounds for hundreds of files:

Downloads/ ├── download (1).pdf <-- Actually a quarterly cloud compute invoice ├── scan_0042.jpg <-- Prescription blood test lab results ├── W2_Tax_Year_2025.txt <-- Personal income tax
…

The repository is structured with clean separation of concerns and zero unnecessary dependencies:

slothsort/ ├── app.py # FastAPI backend server with REST endpoints & file management ├── slothsort.py # Core local AI sorting engine, CLI, & heuristic classification ├── requirements.txt # Minimal Python dependencies (FastAPI, Uvicorn, Requests) ├── LICENSE # MIT License ├── README.md # Comprehensive documentation & architectural diagrams ├── assets/ # Cover banners & media assets ├── messy_inbox/ # Default sandbox input directory for unorganized files ├── organized_vault/ # Default output directory with categorized subvaults └── static/ # Modern Glassmorphic Web Dashboard ├── index.html # Viewport-fitted semantic HTML interface ├── style.css # Vanilla CSS design system (Dark mode, glassmorphism) └── app.js # Reactive vanilla client with preview & batch workflows 

How I Built It

SlothSort is designed around the philosophy that local Small Language Models (SLMs) are the perfect tool for local desktop automation.

1. Local Open-Weight Inference (Ollama)

I integrated Ollama to orchestrate local open-weight models:

  • Llama 3.2 3B (Meta): The default engine. At only ~2.0 GB of VRAM/RAM, it runs blisteringly fast even on low-power laptop CPUs.
  • Qwen 2.5 3B (Alibaba): Secondary model option with outstanding multilingual handling and code comprehension.
  • Phi-3.5 Mini & Mistral 7B: Available for deeper semantic understanding and strict JSON schema generation.

The model is prompted with strict JSON schema instructions:

{ "category": "Invoices & Receipts", "suggested_filename": "2026-10-22_Cloud_Compute_Invoice.txt", "summary": "Cloud infrastructure compute invoice for October billing cycle", "reasoning": "Detected compute instance charges, billing account ID, and total due", "tags": ["invoice", "cloud", "billing"], "confidence": "98% (High)" } 

2. Dual-Engine Architecture with Heuristic Fallback

If a user hasn't installed Ollama or doesn't have it running, SlothSort does not break. It features a built-in deterministic heuristic rule engine covering all 18 semantic categories with binary magic number detection, regex pattern matching, and file signature parsing.

3. Backend (FastAPI & Python 3.9+)

The backend in app.py exposes lightweight REST endpoints (/api/state, /api/sort, /api/undo, /api/file-content, /api/batch-action) with universal path resolution that supports Windows drive letters (D:\...), Unix home paths (~/...), and relative paths.

4. Viewport-Constrained Frontend (Vanilla HTML/CSS/JS)

The web interface is built with zero heavyweight frontend frameworks:

  • Strict 100vh constraint: The page fits completely inside the browser viewport with zero outer body scrolling.
  • Sub-40px Compact Tiles: Formatted to display dozens of files on screen simultaneously.
  • Docked Collapsible Terminal: The bottom engine stream stays out of the way as a 26px live status ticker, expanding via ▲ / ▼ into an audit history.

Why Does Open Innovation Matter?

Open innovation isn't just a technical preference for this project—it is the only way this project could ethically and practically exist.

1. The Ultimate Privacy Barrier

The files inside a person's Downloads or Desktop folder are the most sensitive data on their machine:

  • Personal tax returns (W-2s, 1099s)
  • Bank statements and credit card receipts
  • Proprietary source code and API credentials
  • Client non-disclosure agreements and contracts
  • Medical lab reports and prescriptions

Sending these personal documents across the internet to a third-party commercial cloud AI API violates personal privacy, GDPR, and enterprise compliance. With open-weight models running on localhost, not a single byte ever leaves the user's computer.

2. Zero Marginal Cost for Background Daemons

Continuous background automation using closed proprietary APIs creates constant token anxiety. If a script runs in the background sorting dozens of files every day, subscription bills quickly accumulate. With open-source 3B models, inference costs $0.00 forever.

3. Air-Gapped Autonomy

Closed AI fails the moment you lose internet access. Open-weight models allow SlothSort to organize files seamlessly on an airplane, on a train, or in an off-grid cabin.

4. Full Auditability and Trust

Because the code, the model weights, and the audit manifest (slothsort_manifest.jsonl) are open-source and inspectable, users don't have to take our word for it—they can verify that their files are never tampered with and can always be reverted with a single click.

My Agent Session

The entire development process of SlothSort—from initial architecture brainstorming, designing the dual-engine heuristic and local LLM pipelines, creating the FastAPI + Vanilla JS glassmorphic dashboard, to setting up reversible undo manifests and releases—was developed interactively with the AI agent.

You can inspect the full, interactive transcript of this development session directly on DEV:

Building SlothSort: Autonomous Local AI File Tidier
You

Slow and Steady
Build something with open-source AI at its core.
That can mean running an open-weight model, building on an open-source agent harness or framework, running inference locally, or all three. Whatever you pick, the open pieces should be what makes your project work.
In your post, tell us why open innovation matters for what you built. Does it run on a laptop with no internet? Keep someone's data off a server they don't control? Let you fine-tune, swap models, or change how your agent behaves? Cost nothing to run? Tell us where your open-based approach worked better than a closed one.
This Week's Theme: Slow and Steady
Build something with open-weight models or open-source AI that rewards laziness.
Tomorrow, October 20, is International Sloth Day, and we think sloths have it figured out. They move at their own pace, conserve their energy, and even help moderate our website. This week, we want you to channel your inner sloth and build something that does the work so you don't have to.
That can mean running an open-weight model, building on an open-source agent harness or framework, running inference locally, or all three. Whatever you pick, the open pieces should be what makes your project work.
Your build could help someone relax, automate a task they dread, or just make life a little easier. A few ideas to get you going:
A local agent that reads your group chats overnight and hands you a two-line summary in the morning
A wind-down companion that generates a calming bedtime story or ambient soundscape, running entirely offline
A fridge photo to grocery list tool, so you never have to stand there with the door open again
A file and inbox tidier that automatically sorts, renames, and archives the clutter you keep putting off
In your post, tell us why open innovation matters for what you built. Does running your own model mean your automation works without an internet connection? Keep your personal messages and files on your own machine? Let you set it up once and never pay for it again? Tell us where your open-based approach worked better than a closed one.

Show more
You

I'm building a project for a hackathon-style challenge called "Slow and Steady," and I need your help designing and specifying it. Here is the full brief:

"""
Build something with open-source AI at its core. That can mean running an open-weight model, building on an open-source agent harness or framework, running inference locally, or all three. The open pieces must be what makes the project work.

Theme: Slow and Steady. Build something with open-weight models or open-source AI that rewards laziness: it does the work so I don't have to. It could help someone relax, automate a task they dread, or make life a little easier. Example directions: a local agent that reads group chats overnight and gives a two-line morning summary; a offline wind-down companion that generates bedtime stories or ambient soundscapes; a fridge-photo-to-grocery-list tool; a file and inbox tidier that sorts, renames, and archives clutter.

The final submission includes a post that explains why open innovation matters for the build: whether it runs offline, keeps personal data on my own machine, avoids recurring costs, allows fine-tuning or model swapping, or changes how the agent behaves. It should also say where the open-based approach worked better than a closed alternative.
"""

Help me produce a complete, working plan and starter implementation for this. Work from the single goal of a project that delivers real automation value while keeping the open-source components central to how it functions. Choose one concrete idea from the examples above, or propose a comparable one, and justify the choice in terms of what it lets the open pieces do that a closed service could not.

Deliver the following:

  1. Project choice and rationale. Name the idea, state the user problem it solves, and explain specifically why open-weight models or local inference make it better than a hosted closed API (offline operation, data privacy, zero marginal cost, fine-tuning, model swapping, or behavioral control, whichever actually applies).

  2. Architecture. Identify the open-weight model and runtime (for example a local inference server or an open agent framework), the input sources, the processing loop, and the output channel. Keep it as small as the problem allows. Name real, currently available open tools and models rather than generic placeholders.

  3. Working implementation. Provide runnable code for the core pipeline, with setup instructions, required dependencies, and how to run it end to end on a single laptop. Include the one or two configuration points a user would need to change, such as model name, input folder, or schedule.

  4. Verification. Give a concrete way to test that it works, using sample inputs I can run myself, and state the expected output.

  5. Submission post draft. Write a short post, in the first person, covering the points the brief asks for: what I built, why open innovation mattered for it, and one specific place the open approach beat a closed one.

Keep the scope to the single chosen project. Do not add extra features, multiple alternative projects, or a long background section. If the brief leaves a detail open, make a reasonable, clearly stated assumption and proceed.

Show more
Agent
▸ list_dir {"DirectoryPath": "\"d:\\\\aaa\\\\AI\\\\4\"", "toolAction": "\"Listing worksp...
{ "DirectoryPath": "\"d:\\\\aaa\\\\AI\\\\4\"", "toolAction": "\"Listing workspace directory\"", "toolSummary": "\"Workspace directory contents\"" }
executed
Agent
▸ run_command {"CommandLine": "\"python --version; ollama --version; git --version\"", "Cwd...
$ {"CommandLine": "\"python --version; ollama --version; git --version\"", "Cwd": "\"d:\\\\aaa\\\\AI\\\\4\"", "WaitMsBeforeAsync": "5000", "toolAction": "\"Checking environment tools\"", "toolSummary": "\"Environment tool version check\""}
executed
Agent
▸ run_command {"CommandLine": "\"pip list\"", "Cwd": "\"d:\\\\aaa\\\\AI\\\\4\"", "WaitMsBef...
$ {"CommandLine": "\"pip list\"", "Cwd": "\"d:\\\\aaa\\\\AI\\\\4\"", "WaitMsBeforeAsync": "5000", "toolAction": "\"Checking installed pip packages\"", "toolSummary": "\"Pip package list check\""}
executed
Agent
▸ manage_task {"Action": "\"status\"", "TaskId": "\"26353929-97e8-4ec0-8ac0-adf24b86d9f3/ta...
{ "Action": "\"status\"", "TaskId": "\"26353929-97e8-4ec0-8ac0-adf24b86d9f3/task-11\"", "toolAction": "\"Checking task status\"", "toolSummary": "\"Pip list status check\"" }
executed
Agent
▸ run_command {"CommandLine": "\"python -c \\\"import urllib.request; print(urllib.request....
$ {"CommandLine": "\"python -c \\\"import urllib.request; print(urllib.request.urlopen('http://localhost:11434/api/tags').read().decode('utf-8'))\\\"\"", "Cwd": "\"d:\\\\aaa\\\\AI\\\\4\"", "WaitMsBeforeAsync": "5000", "toolAction": "\"Checking local Ollama service\"", "toolSummary": "\"Ollama local service check\""}
executed
Agent
▸ manage_task {"Action": "\"status\"", "TaskId": "\"26353929-97e8-4ec0-8ac0-adf24b86d9f3/ta...
{ "Action": "\"status\"", "TaskId": "\"26353929-97e8-4ec0-8ac0-adf24b86d9f3/task-16\"", "toolAction": "\"Checking task status\"", "toolSummary": "\"Ollama status check\"" }
executed
Agent
▸ run_command {"CommandLine": "\"Get-Command ollama -ErrorAction SilentlyContinue; Test-Pat...
$ {"CommandLine": "\"Get-Command ollama -ErrorAction SilentlyContinue; Test-Path \\\"$env:LOCALAPPDATA\\\\Programs\\\\Ollama\\\\ollama.exe\\\"\"", "Cwd": "\"d:\\\\aaa\\\\AI\\\\4\"", "WaitMsBeforeAsync": "5000", "toolAction": "\"Checking Ollama executable path\"", "toolSummary": "\"Ollama path check\""}
executed
Agent
▸ write_to_file {"CodeContent": "\"#!/usr/bin/env python3\\n\\\"\\\"\\\"\\nSlothSort: The Zer...
{ "CodeContent": "\"#!/usr/bin/env python3\\n\\\"\\\"\\\"\\nSlothSort: The Zero-Leak Local File & Clutter Tidier\\nBuilt for the \\\"Slow and Steady\\\" Hackathon Challenge.\\n\\nAn autonomous local agent powered by open-weight models (Llama 3.2 / Qwen 2.5 / Phi-3.5)\\nvia Ollama. It reads messy downloads/desktop files, understands their content,\\ngenerates descriptive names, and sorts them into organized folders.\\n100% offline, zero cloud API fees, and absolute privacy for your personal files.\\n\\\"\\\"\\\"\\n\\nimport os\\nimport sys\\nimport json\\nimport shutil\\nimport urllib.request\\nimport urllib.error\\nfrom pathlib import Path\\nfrom datetime import datetime\\nfrom typing import Dict, Any, Optional\\n\\n# ==============================================================================\\n# CONFIGURATION\\n# ==============================================================================\\nDEFAULT_MODEL = \\\"llama3.2:3b\\\" # Fast, 2GB VRAM footprint, excellent at JSON\\nOLLAMA_HOST = os.getenv(\\\"OLLAMA_HOST\\\", \\\"http://localhost:11434\\\")\\nDEFAULT_INBOX_DIR = \\\"./messy_inbox\\\"\\nDEFAULT_SORTED_DIR = \\\"./organized_vault\\\"\\nMANIFEST_FILE = \\\"slothsort_manifest.jsonl\\\"\\nCONTENT_SNIPPET_LIMIT = 2000 # Read first 2KB for fast, safe categorization\\n\\n# System prompt forcing deterministic, machine-readable JSON output\\nSYSTEM_PROMPT = \\\"\\\"\\\"You are SlothSort, an autonomous file organizer that rewards laziness.\\nAnalyze the provided file metadata and content snippet.\\nCategorize the file into one of these standard folders:\\n- Invoices & Receipts\\n- Work & Documents\\n- Code & Development\\n- Notes & Ideas\\n- Personal & Health\\n- Miscellaneous\\n\\nGenerate a clean, standardized filename in the format:\\nYYYY-MM-DD_<Brief_Description>.<ext> or <Clean_Name>.<ext>\\nDo not use spaces in filenames; use underscores or hyphens.\\n\\nReturn ONLY a valid JSON object with EXACTLY this structure:\\n{\\n \\\"category\\\": \\\"Folder Category\\\",\\n \\\"suggested_filename\\\": \\\"cleaned_filename.ext\\\",\\n \\\"summary\\\": \\\"One sentence explaining what this file is\\\"\\n}\\nOutput strictly JSON. Do not write intr\n<truncated 11898 bytes>", "Description": "\"Create SlothSort core pipeline script\"", "Overwrite": "true", "TargetFile": "\"d:\\\\aaa\\\\AI\\\\4\\\\slothsort.py\"", "toolAction": "\"Creating Python script\"", "toolSummary": "\"SlothSort core pipeline script\"" }
executed
Agent
▸ run_command {"CommandLine": "\"python slothsort.py --seed --dry-run\"", "Cwd": "\"d:\\\\a...
$ {"CommandLine": "\"python slothsort.py --seed --dry-run\"", "Cwd": "\"d:\\\\aaa\\\\AI\\\\4\"", "WaitMsBeforeAsync": "5000", "toolAction": "\"Running dry run test on SlothSort\"", "toolSummary": "\"SlothSort dry-run verification\""}
executed
Agent
▸ replace_file_content {"AllowMultiple": "false", "Description": "\"Ensure safe utf-8 stdout encodin...
{ "AllowMultiple": "false", "Description": "\"Ensure safe utf-8 stdout encoding for Windows console compatibility\"", "EndLine": "25", "Instruction": "\"Reconfigure stdout/stderr encoding or use safe output\"", "ReplacementContent": "\"import os\\nimport sys\\nimport json\\nimport shutil\\nimport urllib.request\\nimport urllib.error\\nfrom pathlib import Path\\nfrom datetime import datetime\\nfrom typing import Dict, Any, Optional\\n\\n# Ensure UTF-8 output on Windows consoles\\nif sys.platform == \\\"win32\\\":\\n try:\\n sys.stdout.reconfigure(encoding=\\\"utf-8\\\", errors=\\\"replace\\\")\\n sys.stderr.reconfigure(encoding=\\\"utf-8\\\", errors=\\\"replace\\\")\\n except Exception:\\n pass\"", "StartLine": "10", "TargetContent": "\"import os\\nimport sys\\nimport json\\nimport shutil\\nimport urllib.request\\nimport urllib.error\\nfrom pathlib import Path\\nfrom datetime import datetime\\nfrom typing import Dict, Any, Optional\"", "TargetFile": "\"d:\\\\aaa\\\\AI\\\\4\\\\Source:https://dev.to/projects_only_48b9d3271bb/slothsort-autonomous-local-ai-file-clutter-tidier-1ahk

Related posts