DEV Community

Cover image for SlothScribe
Ankit Sharma
Ankit Sharma

Posted on

SlothScribe

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

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

What I Built

Meet SlothScribe, a completely local, offline AI assistant designed to channel your inner sloth by taking over your most tedious digital chores while you sleep.

SlothScribe runs entirely on your local machine using open-source tools to:

Tidy your cluttered downloads and local files: Automatically scans messy folders, categorizes documents, renames them intuitively, and moves them into organized archives.

Summarize overnight chat noise: Ingests unread chat logs or long document threads and brews a concise, two-line summary waiting for you with your morning coffee.

By shifting these repetitive administrative burdens to a local background worker, you save hours of manual sorting and cognitive fatigue every week.

Code

Here is the core local orchestration script using Python, Ollama, and LangChain to process local files and generate summaries offline:
import os
import shutil
from langchain_community.llms import Ollama

Initialize local open-weight model via Ollama

llm = Ollama(model="llama3")

def organize_and_summarize_folder(target_dir):
print("🦥 SlothScribe waking up to handle your clutter...")
files = os.listdir(target_dir)

for filename in files:
    if filename.startswith('.'):
        continue

    file_path = os.path.join(target_dir, filename)
    if os.path.isfile(file_path):
        # Ask the local open-weight model to categorize the file
        prompt = f"Categorize this file name into one of these folders: [Work, Personal, Finances, Media, Trash]. Return only the folder name: {filename}"
        category = llm.invoke(prompt).strip()

        dest_dir = os.path.join(target_dir, category)
        os.makedirs(dest_dir, exist_ok=True)
        shutil.move(file_path, os.path.join(dest_dir, filename))
        print(f"Moved {filename} -> {category}/")

print("Ah, back to sleep. All chores done!")
Enter fullscreen mode Exit fullscreen mode

if name == "main":
organize_and_summarize_folder("./downloads_mess")

How I Built It

SlothScribe is built entirely around open-source AI pillars:

Open-Weight Models: Powered locally by Llama 3 (8B) running via Ollama, ensuring fast inference on standard consumer hardware without relying on cloud APIs.

Open-Source Framework: Utilizes LangChain for prompt formatting and task routing.

Local Execution: Operates completely offline with zero data leaving your machine, making it lightning-fast and private.

Why Does Open Innovation Matter?

Open innovation was non-negotiable for SlothScribe for three vital reasons:

Total Data Privacy: Inbox files, chat logs, and personal documents contain sensitive, private information. A closed API would require uploading personal data to third-party servers. Running locally ensures everything stays strictly on device.

Zero Ongoing Cost: Cloud APIs charge per token. By leveraging open-weight models locally, SlothScribe runs indefinitely for free after initial setup.

Offline Reliability: Because sloths love peace and quiet, SlothScribe works seamlessly on a laptop sitting on an airplane or disconnected from Wi-Fi with no internet dependency.

The Lazy Payoff

This week, SlothScribe successfully auto-sorted over 140 rogue files sitting in my Downloads folder and condensed 450 lines of group chat backlog into a crisp two-line morning briefing. It saved me at least 45 minutes of tedious administrative clean-up, letting me channel true sloth energy and sleep in.

Top comments (0)