跳到正文
DEV Community· Sandeep Chakravartty·· 4 小時前AI 評分33

SlothMode:讓你安心少做一點的任務生成器

SlothMode: A Quest Generator That Gives You Permission to Do Less

AI 導讀

SlothMode 把用戶的精力、心情、可用時間、地點和限制轉化為輕鬆的小任務,亦容許用戶重抽、標記為「Done-ish」或選擇休息。應用程式以 Gemma 3 4B 和 Ollama 在本機生成任務,模型輸出須符合指定結構並經驗證;目前即時推理尚未驗證,公開示範使用明確標示為手工製作的任務。用戶毋須帳戶,偏好設定和任務記錄會儲存在瀏覽器。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
SlothMode turns a few choices—your energy, mood, available time, location, and constraints—into a tiny, playful quest. You can accept it, reroll it, mark it “Done-ish,” or choose to do nothing. There are no streaks or deadlines. Even intentional rest earns fictional points.

The app saves your preferences and adventures in your browser. You can export your history as JSON or download a personalized PNG certificate. No account is needed.
Demo
There isn’t a deployed demo or video yet. You can run the handcrafted demo locally without installing a model:
git clone https://github.com/scha54/SlothMode.git
cd SlothMode
npm ci
npm run dev
Open http://localhost:3000, select Demo · handcrafted quests, and click Find My Perfect Nothing. These quests are clearly labeled as handcrafted; they are not AI-generated.

Desktop screenshot · Mobile screenshot · Example certificate
Code
The source, setup instructions, tests, and architecture notes are in the SlothMode GitHub repository.

The central AI boundary is deliberately small. The model selects values for a versioned activity plan:
const activityPlanSchema = z.object({
version: z.literal(1),
activity: z.enum(["imagine", "remember", "observe", "rest"]),
subject: z.enum([/* 16 reviewed subjects /]),
setting: z.enum([/
12 reviewed settings /]),
twist: z.enum([/
12 reviewed twists */]),
}).strict();
Application code turns that plan into the words the user sees. The model cannot supply unrestricted instructions. If its response fails validation, SlothMode reports an error instead of quietly passing off a handcrafted quest as AI output.
How I Built It
SlothMode uses Next.js, React, TypeScript, Zod, and Dexie. IndexedDB stores preferences, quest history, rewards, and certificate details locally in the browser. The interface includes keyboard controls, reduced-motion support, and an original animated SVG sloth.

For local AI, the server adapter targets Gemma 3 4B through Ollama. It sends the user’s preferences and recent quest titles to Ollama’s structured JSON chat endpoint. The response must match the activity-plan schema before the app compiles it into a quest. The separate handcrafted catalog keeps the demo usable when Ollama is unavailable.

The default model’s manifest digest is pinned, but a full model download and live Gemma inference have not yet been validated. The completed checks cover the app and handcrafted demo: 33 unit tests, nine production browser tests, a production build, and a demo API smoke test. They establish that the demo workflow works; they do not establish live AI output quality or latency.
Why Does Open Innovation Matter?
A local, open-weight model lets this project explore playful generation without requiring users to create an API account or send their preferences to a hosted model provider. The model, prompt, output schema, and validation code are inspectable and changeable. Someone can run the app locally, swap in a compatible model, or improve the activity vocabulary.

That openness also makes the limits visible. The current AI design is intended for local use; it should not be presented as a working Vercel AI deployment. For now, the reliable public-facing path is the clearly labeled handcrafted demo, while the open-source code provides a foundation for testing and improving local inference.

來源:DEV Community · dev.to