SlothAI:為懶人而設的離線開源 AI 工具
SlothAI: Offline, Open-Source AI Tools for the Gloriously Lazy 🦥
SlothAI 是一款離線、本機優先的開源網頁工具,透過 Ollama 在本機硬件執行 Llama 3.2 等開放權重模型,並整合 6 款工具,協助摘要電郵與文章、撰寫訊息及規劃待辦事項。專案以純 HTML5、CSS3 和原生 JavaScript 建構,總大小低於 40 KB,無需網絡連線或雲端訂閲。文章稱,工具可在典型一週節省每日超過 45 分鐘。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
Meet SlothAI 🦥 — an offline, local-first web companion designed for anyone who believes sloths have life figured out.
Instead of paying recurring cloud subscriptions or giving away personal correspondence to remote servers, SlothAI runs open-weight models (like Llama 3.2) locally on your hardware via Ollama. It packages 6 micro-tools dedicated to taking over the tedious mental chores that drain your energy throughout the day:
- 📝 TL;DR Machine — Summarizes long emails and articles into 2–3 key bullet points so you never read fluff again.
- ✉️ Ghost Writer — Transforms rough bullet points into polished, tone-adjusted emails and messages in seconds.
- 🎲 The Decider — Eliminates decision fatigue by making definitive, reasoned choices (no endless debates).
- 🛋️ Lazy Planner — Reorganizes overwhelming to-do lists into relaxed schedules with built-in rest breaks.
- 😴 Bedtime Story — Generates peaceful, offline bedtime stories to help you wind down without screens.
- 💬 Smart Reply — Instantly drafts 3 ready-to-send responses: Casual 🙂, Professional 💼, and Witty 😄.
Who gets to be lazier because of it?
Anyone suffering from modern cognitive overload: developers drowning in Slack messages, students tired of drafting polite emails, or anyone who just wants to close their laptop and take a nap without leaving unfinished mental tasks hanging.
Demo
Quick Local Run:
- Clone the repo and run
python -m http.server 3000- Run
ollama run llama3.2- Open
http://localhost:3000— that's it!
Code
https://github.com/GRANDSONOFSITARAM/slothai
The entire project is built with zero framework bloat:
- Zero build steps: Pure HTML5, CSS3, and modern vanilla JavaScript.
- Zero external client libraries: No React, no Vite, no node_modules.
- Under 40 KB total: Blazing fast load times, instant startup, and runs straight from disk.
How I Built It
SlothAI was built around the principle of open-source local inference:
1. The Open-Weight Core: Ollama + Llama 3.2
The AI engine runs entirely on Ollama, an open-source framework that runs quantized open-weight GGUF models directly on consumer CPUs and GPUs.
- We utilize Llama 3.2 (3.2B / 1B), Meta's open-weight model optimized for edge devices and low-latency instruction following.
- Any open model supported by Ollama works out-of-the-box: Mistral, Gemma 2, Phi-3, or Qwen 2.5. SlothAI auto-detects installed models via
/api/tagsand populates them in a single-click dropdown.
2. Client-Side NDJSON Streaming
Rather than waiting for full completions, SlothAI streams responses directly into the DOM using an asynchronous generator over Ollama’s /api/chat endpoint:
async *streamChat(messages, model, options = {}) {
const res = await fetch(`${this.host}/api/chat`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ model, messages, stream: true, options })
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
// Decode and yield NDJSON tokens in real-time
}
Tokens render live with a blinking cursor and typewriter fluidity, giving real-time feedback with zero latency.
3. Glassmorphism Design System
Built from scratch with CSS custom properties, responsive grid/flex layouts, keyboard shortcuts (Ctrl+Enter to generate, Esc to cancel), animated ambient gradient orbs, and copy-to-clipboard functionality.
Why Does Open Innovation Matter?
Open-source AI isn't just an alternative to closed APIs; for a utility like SlothAI, open innovation is the only architecture that makes sense:
- 🔒 Absolute Privacy by Architecture: To summarize private emails, draft sensitive work messages, or plan daily routines, users shouldn't have to beam personal life data to proprietary cloud servers where it might be logged or used to train third-party models. With open-weight models, your data never leaves your laptop.
- 📴 True Offline Capability (Zero Internet Needed): Closed APIs turn your software into a useless brick the moment WiFi drops or you step on an airplane. Open-weight inference runs completely offline. Once your weights are on your SSD, you can generate bedtime stories or write emails in an off-grid cabin.
- 💰 Zero Subscription & Zero Token Anxiety: Closed LLM APIs introduce rate limits, credit cards, and per-token anxiety. With open models, inference costs exactly \$0. Run 10 tokens or 100,000 tokens — you never get an unexpected bill at the end of the month.
-
🔄 Freedom to Swap & Hack:
No vendor lock-in. Want a smaller 0.5B model for an old laptop? Swap it. Want a specialized uncensored model or domain-specific fine-tune? Just pull it. Every prompt is transparently editable in
app.js.
The Lazy Payoff
Here is the actual mental energy SlothAI saves in a typical week:
- Drafting routine emails: 8 minutes → 15 seconds with Ghost Writer.
- Catching up on 50-message Slack threads: 5 minutes → 10 seconds with TL;DR Machine.
- Deciding dinner / weekend plans: 10+ minutes of deliberation → 5 seconds with The Decider.
- Structuring tomorrow’s chaotic to-do list: 15 minutes → 20 seconds with Lazy Planner.
That adds up to over 45 minutes saved every single day. More importantly, it eliminates the micro-friction and procrastination of starting tasks. The sloth would be proud. 🦥
Prize Categories
- Open-Source AI at its Core (runs fully open-weight models via Ollama)
- Local-First & Offline Innovation (zero internet required, zero cloud leakage)
來源:DEV Community · dev.to




