This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.
What I Built
You sit down to make a small change. A few prompts, a couple of retries, and suddenly you're watching your remaining AI credits instead of building your project.
Should you switch models? Rewrite the request? Wait for your allowance to reset?
Choosing how to ask for help has become another task.
Sloth Code is a desktop companion that helps you prepare coding requests using Gemma running locally. Describe your task, choose your coding assistant, and get a suggested model and thinking level alongside a ready-to-copy prompt.
One issue remains…
Sloth is even lazier than you.
The first click gets you a yawn. The second? Still sleeping. Somewhere between your third and fifth click, Sloth finally wakes up and agrees to help.
Even your productivity assistant needs a little encouragement.
Once awake, it helps with the preparation: assessing the task, explaining a recommendation, and assembling instructions while preserving your original requirements. You can override its suggestions without another model call.
Demo
The recording shows entering a React request, preparing it locally, viewing a recommendation, expanding the assistant, and copying the prompt.
Recommendations are heuristic. The recording suggests ChatGPT Chat for an implementation request; selecting Codex explicitly gives you the project-inspection workflow.
Original recording and MP4 download.
Code
The first version targets Apple Silicon macOS and uses Electron, React, TypeScript, Mastra, Ollama, and Gemma 3 4B.
How I Built It
Gemma handles the local analysis. Each preparation makes one structured-output request through Ollama. The application validates the response and maps the assessment to a curated catalog of models and thinking settings.
Mastra runs a two-step workflow: analyze the request, then validate and assemble the result.
One lesson shaped the design: a polished rewrite can quietly add requirements the user never requested. Sloth therefore builds the copyable prompt deterministically and includes the complete original request verbatim. Generated rewrites and possible unknowns stay outside the copied instructions.
Sentry Agent Tracing provides optional observability. It records agent/model spans, elapsed time, and available token counts. Telemetry is off by default, and prompt content is excluded.
A real Gemma call produced this locally captured trace:
invoke_agent Sloth Code 3,290 ms
└─ chat gemma3:4b 3,280 ms
Input tokens: 736
Output tokens: 132
The verification checked the span relationship, matched token counts to the runtime response, and confirmed that the private test marker and copied prompt were absent. Hosted Sentry dashboard delivery remains unverified.
The current build passes 31 automated tests. Six real Gemma requests also passed preservation and recommendation checks, with inference taking approximately 3.5–8.9 seconds in this small sample on my Mac.
I used Codex to help implement and verify the application. The supplied mascot artwork was retained, with transparent cutouts prepared using OpenAI image generation.
Why Does Open Innovation Matter?
A helper intended to conserve AI usage would make an awkward tradeoff if every request first needed another paid cloud inference call.
Gemma's open weights let Sloth perform its analysis locally. Mastra makes the workflow inspectable, and the model configuration, validation, and recommendation rules can be examined and changed.
The core requires no cloud API key and sends task text to a local model endpoint. Optional telemetry is a separate choice.
Local inference still uses hardware and electricity. The destination assistant may still charge for its own usage. I have not demonstrated downstream cost savings or fewer retries, and a network-disconnected test remains future work.
What works today is the local task-to-copy flow: a little less preparation before asking an assistant for help.
Sloths conserve their energy. Sloth Code helps you conserve yours.
Prize Categories
- Best Use of Gemma: Gemma 3 4B performs the core analysis locally.
- Best Use of Mastra: A two-step workflow handles analysis, validation, and prompt assembly.
- Best Use of Sentry Agent Tracing: Agent/model spans capture timing and token usage, with prompt exclusion verified through a local receiver.
Top comments (0)