<?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: Sudharsan B</title>
    <description>The latest articles on DEV Community by Sudharsan B (@sudharsan_b_7436013b42d2e).</description>
    <link>https://dev.to/sudharsan_b_7436013b42d2e</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%2F4185246%2F81ff4532-0320-4f39-afa0-ce39732ba779.jpg</url>
      <title>DEV Community: Sudharsan B</title>
      <link>https://dev.to/sudharsan_b_7436013b42d2e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sudharsan_b_7436013b42d2e"/>
    <language>en</language>
    <item>
      <title>I Let a Sloth Tidy My Downloads Folder (Local Gemma, No Cloud)</title>
      <dc:creator>Sudharsan B</dc:creator>
      <pubDate>Sat, 24 Oct 2026 07:11:28 +0000</pubDate>
      <link>https://dev.to/sudharsan_b_7436013b42d2e/i-let-a-sloth-tidy-my-downloads-folder-local-gemma-no-cloud-560j</link>
      <guid>https://dev.to/sudharsan_b_7436013b42d2e/i-let-a-sloth-tidy-my-downloads-folder-local-gemma-no-cloud-560j</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;&lt;code&gt;sloth-tidy&lt;/code&gt; is a small Python CLI that sorts, renames and archives a cluttered folder, like the Downloads folder I keep promising myself I'll clean up.&lt;/p&gt;

&lt;p&gt;It reads each file's name, size and the first 300 characters of text files. A local open-weight model then picks a category (Documents, Images, Receipts, ...) and proposes a clean kebab-case name. Nothing moves until you pass &lt;code&gt;--apply&lt;/code&gt;, and &lt;code&gt;--undo&lt;/code&gt; puts everything back.&lt;/p&gt;

&lt;p&gt;Anyone with a folder they dread opening gets to be a little lazier: point it at the folder, read the plan, press go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Dry-run on a sample folder (extension-rules mode, &lt;code&gt;--no-llm&lt;/code&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_0042.png  -&amp;gt;  Tidied/Images/IMG_0042.png
backup.zip  -&amp;gt;  Tidied/Archives/backup.zip
installer.dmg  -&amp;gt;  Tidied/Installers/installer.dmg
invoice-oct.pdf  -&amp;gt;  Tidied/Documents/invoice-oct.pdf
notes.txt  -&amp;gt;  Tidied/Documents/notes.txt

5 file(s) planned (dry-run; add --apply).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/sharkie3" rel="noopener noreferrer"&gt;
        sharkie3
      &lt;/a&gt; / &lt;a href="https://github.com/sharkie3/sloth-tidy" rel="noopener noreferrer"&gt;
        sloth-tidy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;sloth-tidy&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;Sorts, renames and archives a messy folder using a local open-weight model (Gemma via Ollama). No cloud, no API key, stdlib-only Python.&lt;/p&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;ollama pull gemma3:4b
python3 sloth_tidy.py &lt;span class="pl-k"&gt;~&lt;/span&gt;/Downloads            &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; dry-run: prints the plan&lt;/span&gt;
python3 sloth_tidy.py &lt;span class="pl-k"&gt;~&lt;/span&gt;/Downloads --apply    &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; moves files, writes an undo log&lt;/span&gt;
python3 sloth_tidy.py &lt;span class="pl-k"&gt;~&lt;/span&gt;/Downloads --undo     &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; puts everything back&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Safety: dry-run by default, never overwrites, skips hidden files and anything modified in the last 10 minutes, falls back to extension rules if the model is unreachable (&lt;code&gt;--no-llm&lt;/code&gt; forces this). Only the first 300 characters of text files are sent to the model, and only to &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Tests: &lt;code&gt;python3 -m pytest&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/sharkie3/sloth-tidy" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma3:4b
python3 sloth_tidy.py ~/Downloads            &lt;span class="c"&gt;# dry-run: prints the plan&lt;/span&gt;
python3 sloth_tidy.py ~/Downloads &lt;span class="nt"&gt;--apply&lt;/span&gt;    &lt;span class="c"&gt;# moves files, writes an undo log&lt;/span&gt;
python3 sloth_tidy.py ~/Downloads &lt;span class="nt"&gt;--undo&lt;/span&gt;     &lt;span class="c"&gt;# puts everything back&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; Gemma (default &lt;code&gt;gemma3:4b&lt;/code&gt;), served locally by Ollama. The &lt;code&gt;--model&lt;/code&gt; flag swaps in any other Ollama model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; plain &lt;code&gt;POST /api/chat&lt;/code&gt; to &lt;code&gt;localhost:11434&lt;/code&gt; with &lt;code&gt;format: "json"&lt;/code&gt;. No SDK and no third-party dependencies, so the whole tool is one Python file using only the standard library.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batching:&lt;/strong&gt; files go to the model 20 at a time, each with an id, so replies map back to files reliably.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't trust the model:&lt;/strong&gt; every reply is validated. Unknown categories fall back to extension rules, suggested names are re-slugified, and name collisions get &lt;code&gt;-2&lt;/code&gt;, &lt;code&gt;-3&lt;/code&gt; suffixes so nothing is overwritten.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fails soft:&lt;/strong&gt; if the server is down or returns bad JSON, that batch falls back to extension rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safety rails:&lt;/strong&gt; dry-run by default, hidden files and files modified in the last 10 minutes are skipped, and every applied run writes an undo log.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unit tests cover the fallback rules, apply/undo, model renames, collisions, invalid categories, recent-file skipping and model failure. They use a stubbed model, so they run without Ollama.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honest note:&lt;/strong&gt; I verified the model path against a stubbed response, not a live Gemma run, so I'm not claiming any naming-quality or speed numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; a Downloads folder is full of invoices, tax PDFs and screenshots. With a local model, file names and text previews only go to &lt;code&gt;localhost&lt;/code&gt;. A closed API would mean uploading that listing to a server I don't control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline and free:&lt;/strong&gt; it works without a connection and costs nothing per run, so it's fine to run on a schedule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swappable:&lt;/strong&gt; the model is one flag. A bigger model for better names, or a smaller one for speed, needs no code change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small is enough:&lt;/strong&gt; JSON-mode output plus validation means a small local model can do this job. Filing a PDF doesn't need a frontier model.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>I Built a Receipt Sorter That Never Sends Your Client Data Anywhere</title>
      <dc:creator>Sudharsan B</dc:creator>
      <pubDate>Sun, 18 Oct 2026 17:04:53 +0000</pubDate>
      <link>https://dev.to/sudharsan_b_7436013b42d2e/i-built-a-receipt-sorter-that-never-sends-your-client-data-anywhere-3b1n</link>
      <guid>https://dev.to/sudharsan_b_7436013b42d2e/i-built-a-receipt-sorter-that-never-sends-your-client-data-anywhere-3b1n</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;receipt-sorter turns a messy folder of receipts and invoices into something an accountant can use. It reads each photo, PDF, or text file, pulls out the vendor, date, total, currency, and a category, then copies the file to &lt;code&gt;sorted/&amp;lt;category&amp;gt;/2026-10-01_blue-bottle_12.50.jpg&lt;/code&gt; and writes a &lt;code&gt;summary.csv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's for freelancers and small-business owners who dread tax season. They have a year of phone photos and emailed PDFs. Their clients' invoices contain names, rates, and project details that they'd rather not upload to a third-party service. Cloud receipt apps charge a monthly fee and want those documents on their servers. This one runs entirely on the user's laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python3 receipt_sorter.py ~/Receipts -o ~/Receipts/sorted
IMG_4412.jpg -&amp;gt; sorted/meals/2026-10-01_blue-bottle_12.50.jpg
inv_0093.pdf -&amp;gt; sorted/services/2026-09-14_acme-design_850.00.pdf
...
&amp;lt;N&amp;gt; sorted, &amp;lt;M&amp;gt; failed. Summary: sorted/summary.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/sharkie3" rel="noopener noreferrer"&gt;
        sharkie3
      &lt;/a&gt; / &lt;a href="https://github.com/sharkie3/receipt-sorter" rel="noopener noreferrer"&gt;
        receipt-sorter
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Sort receipts and invoices locally with open-weight Gemma via Ollama. No cloud, no API key.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;receipt-sorter&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Sort receipts and invoices locally with an open-weight model (Gemma) running on Ollama
No cloud, no API key, and client data never leaves your laptop.&lt;/p&gt;
&lt;p&gt;Point it at a folder of receipt photos, PDFs, or text files. It extracts the vendor, date, total, currency, and category, then copies each file to &lt;code&gt;sorted/&amp;lt;category&amp;gt;/&amp;lt;date&amp;gt;_&amp;lt;vendor&amp;gt;_&amp;lt;total&amp;gt;.ext&lt;/code&gt; and writes a &lt;code&gt;summary.csv&lt;/code&gt; for your accountant.&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;IMG_4412.jpg -&amp;gt; sorted/meals/2026-10-01_blue-bottle_12.50.jpg
inv_0093.pdf -&amp;gt; sorted/services/2026-09-14_acme-design_850.00.pdf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Setup&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Install &lt;a href="https://ollama.com" rel="nofollow noopener noreferrer"&gt;Ollama&lt;/a&gt; and pull a vision model:
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;ollama pull gemma3:4b
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Python 3.9+ is the only other requirement. For PDFs, also run &lt;code&gt;pip install pypdf&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;python3 receipt_sorter.py ~/Receipts -o ~/Receipts/sorted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-o, --out&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sorted&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Output folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-m, --model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gemma3:4b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any Ollama vision model (e.g. &lt;code&gt;gemma3:12b&lt;/code&gt; for harder receipts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--host&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://localhost:11434&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ollama server&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Categories: software, travel, meals, office, equipment, services, utilities, other.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Notes&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Originals are copied, never modified or moved.&lt;/li&gt;
&lt;li&gt;Model output is validated: bad dates, unknown categories, and malformed totals…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/sharkie3/receipt-sorter" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; Gemma 3 (&lt;code&gt;gemma3:4b&lt;/code&gt; by default) served locally by &lt;a href="https://ollama.com/library/gemma3" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;. It takes image input, has a 128K context window, and is a 3.4 GB download, so it fits on an ordinary laptop. For harder receipts, &lt;code&gt;gemma3:12b&lt;/code&gt; (8.2 GB) is a one-flag swap with &lt;code&gt;-m&lt;/code&gt;. Any other Ollama vision model works too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Images&lt;/strong&gt; go to the model as base64 through Ollama's &lt;code&gt;/api/chat&lt;/code&gt;. &lt;strong&gt;PDFs and text&lt;/strong&gt; are extracted to text first (&lt;code&gt;pypdf&lt;/code&gt;) and sent as a prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured output:&lt;/strong&gt; the request uses &lt;code&gt;format: "json"&lt;/code&gt; and &lt;code&gt;temperature: 0&lt;/code&gt;. The code still treats the reply as untrusted. Dates must match &lt;code&gt;YYYY-MM-DD&lt;/code&gt;, categories must be in a fixed list, and totals are parsed defensively. Anything invalid falls back to a safe default (&lt;code&gt;other&lt;/code&gt;, undated) instead of crashing the run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safe by design:&lt;/strong&gt; originals are copied, never moved or modified. Name collisions get a numeric suffix. One bad file is reported and skipped, not fatal.&lt;/li&gt;
&lt;li&gt;The whole tool is a single Python file using only the standard library (plus optional &lt;code&gt;pypdf&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy is the product.&lt;/strong&gt; Client invoices never leave the machine. With a closed API, "we don't train on your data" is a promise. Here it's how the system is built, and it works with the network off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; Inference is free after the model download, so a one-time-purchase or low-priced tool is viable. Per-page API pricing would force a subscription.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swappable and tunable.&lt;/strong&gt; If a model misreads a particular receipt style, such as a local restaurant's handwritten tickets, I can swap in another model with one flag. I can also fine-tune later without waiting for a vendor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No lock-in.&lt;/strong&gt; A provider's price change or model retirement can't break the tool.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma&lt;/strong&gt;: Gemma runs locally and does all extraction.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>Hi</title>
      <dc:creator>Sudharsan B</dc:creator>
      <pubDate>Wed, 14 Oct 2026 18:08:28 +0000</pubDate>
      <link>https://dev.to/sudharsan_b_7436013b42d2e/hi-353o</link>
      <guid>https://dev.to/sudharsan_b_7436013b42d2e/hi-353o</guid>
      <description></description>
    </item>
  </channel>
</rss>
