<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tushar Singla</title>
    <description>The latest articles on DEV Community by Tushar Singla (@tushar_singla_bb0139bcffd).</description>
    <link>https://dev.to/tushar_singla_bb0139bcffd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4173899%2F911f1598-c21c-491b-9dd2-54a50bb12a43.jpg</url>
      <title>DEV Community: Tushar Singla</title>
      <link>https://dev.to/tushar_singla_bb0139bcffd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tushar_singla_bb0139bcffd"/>
    <language>en</language>
    <item>
      <title>SlothSort</title>
      <dc:creator>Tushar Singla</dc:creator>
      <pubDate>Sun, 25 Oct 2026 17:11:48 +0000</pubDate>
      <link>https://dev.to/tushar_singla_bb0139bcffd/slothsort-epg</link>
      <guid>https://dev.to/tushar_singla_bb0139bcffd/slothsort-epg</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I have a Downloads folder I'm not proud of: &lt;code&gt;IMG_2043.png&lt;/code&gt;, &lt;code&gt;scan0012.pdf&lt;/code&gt;, &lt;code&gt;final_v3_REAL.docx&lt;/code&gt;. Every few months I promise to clean it up, and every few months I don't.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;SlothSort 🦥&lt;/strong&gt;, a lazy, fully local file tidier. It watches a folder, reads each file with an open-weight model running on my own machine, renames it to something sensible, and files it into a category folder (Documents, Receipts, Screenshots, Images, and so on).&lt;/p&gt;

&lt;p&gt;It's named after the sloth because it's deliberately slow. In &lt;strong&gt;sloth mode&lt;/strong&gt;, it waits until the folder has been quiet for 10 minutes, then tidies everything in one calm batch. Anyone with a chaotic Downloads or Desktop folder gets to be a little lazier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IMG_2043.png
scan0012.pdf
final_v3_REAL.docx
Screenshot 2026-10-19.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Receipts/2026-09-14-electricity-bill.pdf
Documents/project-proposal-draft.docx
Screenshots/2026-10-19-dashboard-error.png
Images/[beach-sunset-goa].png
``

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
ollama pull [qwen2.5:7b]&lt;br&gt;
pip install -e .&lt;br&gt;
python demo/make_messy_folder.py&lt;br&gt;
slothsort once            # dry run (default): shows what it would do&lt;br&gt;
slothsort once --apply    # actually does it&lt;br&gt;
slothsort undo            # changed your mind? reverse the last batch&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
## Code

{% embed https://github.com/YOUR-USERNAME/slothsort %}

## How I Built It

- **Model:** [Qwen2.5 7B], an open-weight model, served locally through **Ollama**. [Add a vision model if you used one for images.]
- **Pipeline:** `watchdog` detects files, then text is extracted (`pypdf` for the first ~2 PDF pages, plain reads for docs and code). The model returns strict JSON: `{"new_name": "...", "category": "..."}`.
- **Validation:** filenames are sanitized, original extensions are kept, and malformed JSON gets one retry before the file is simply left alone.
- **Safety first:** dry-run is the default and `--apply` is required to move anything. It never overwrites (collisions get a counter), never deletes, and never touches anything outside the watched folder. Every move is written to `~/.slothsort/log.jsonl`, and `slothsort undo` reverses it.
- **Sloth mode:** files are queued and processed only after the folder has been quiet for N minutes, so it doesn't fight with files that are still downloading.
- **Stack:** Python, Ollama, watchdog, pypdf, Typer, pytest (model calls mocked, so tests run without Ollama).

[Add one real "this surprised me" moment, e.g. a model returning filenames with slashes, or the 3B model being faster but weaker on receipts.]

## Why Does Open Innovation Matter?

**Your files never leave your machine.** SlothSort reads tax PDFs, ID scans, bank statements, and screenshots of private chats. A closed-API version would mean uploading all of that to a server I don't control just to rename a file. Here, the only network call is to `localhost`.

**It works offline.** [I tested it with Wi-Fi off and it worked. Confirm this before posting.]

**It costs $0 per file.** A tidier runs constantly on lots of small files, exactly the usage pattern that makes API bills creep up. After the one-time model download, mine is free.

**Swapping models is one line.** In `config.yaml`:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
yaml&lt;br&gt;
model: qwen2.5:7b   # try a Gemma, Llama, or a smaller 3B model&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


I tried [model A] and [model B]: [what you observed]. With a closed API, the model can be changed or deprecated underneath you. Here, I choose, and my setup keeps working.

## My Agent Session

[Optional. If you built this with Claude Code, save the session with DevRelay and embed it with the `agent_session` tag as described on the challenge page. Otherwise delete this section.]

## The Lazy Payoff

[Optional. Use real numbers only. For example: "My Downloads folder had 214 files. SlothSort sorted them in about X minutes, and I'd put that off for months." If you haven't run it on a real folder yet, do that first, or delete this section.]

## Prize Categories

[Check the challenge page and list only the partner categories that genuinely apply. If none fit, delete this section.]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
