跳到正文
DEV Community· Iqbal Taufiqurrochman·· 3 小時前AI 評分41

Sloth Handover:用開放權重模型生成站會三行摘要

Sloth Handover: three lines for standup from an open-weight model

AI 導讀

Sloth Handover 將 Git 提交記錄整理成站會可用的 Done、Next、Blocked 三行摘要,並估算節省的時間。它以 Gemma 3 27B 配合 OpenRouter 或 Ollama;測試以 12 個提交產生摘要,耗時 3.4 秒。使用 Ollama 時,提交記錄不會離開本機;使用託管示範時,提交標題會傳送至 OpenRouter,應用程式不儲存記錄。

正文

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

What I Built

Sloth Handover turns a messy git log into the three lines you actually say at standup.

Paste your commits, or press Use the sample repo, and an open-weight model returns:

  • Done — what the week actually finished
  • Next — what the log implies is still open
  • Blocked — or "Nothing blocked", when the log says so
  • Minutes saved — a deliberately rough estimate, clamped between 5 and 45

Sloth Handover with a real model reply

No account, no database, no stored history. The log goes to the model, the reply is checked against a schema, and nothing is written down. The empty state is one screen and one textarea:

The empty state

Demo

  • Live: https://sloth-handover.vercel.app
  • The sample button loads a 12-commit week from a fictional project, complete with a merge, a revert and a version bump, so the whole thing runs in one click.

Code

git clone https://gitlab.com/iqbal_taufiqurrochman/sloth-handover.git
cd sloth-handover
nvm use
npm install
cp .env.example .env   # add OPENROUTER_API_KEY
npm run dev

To run the same prompt with no API key and no network:

ollama pull gemma3:27b
AI_PROVIDER=ollama npm run dev

To have the server read a repository directly instead of pasting:

GIT_REPO_PATH=/path/to/repo npm run dev

How I Built It

SvelteKit 3 with Svelte 5 runes, Tailwind 4, adapter-vercel, Node 22. One page, one endpoint, no database.

The AI layer is a small provider interface with two implementations: OpenRouter calling google/gemma-3-27b-it (open weights), and Ollama running the same model family locally. One prompt, one schema, two transports; switching is one environment variable.

The prompt is strict on purpose: three lines, past tense, start with a verb, no file paths, no invented work, and "Nothing blocked" when the log is quiet. The reply must parse as JSON and pass a shape check; minutes_saved is clamped so the model cannot claim it saved four hours. The endpoint sanitises the log, caps it at 8,000 characters, rate-limits eight requests per IP per ten minutes in memory, and answers 400, 429 or 502 with a sentence instead of a stack trace.

I tested the plumbing with a local OpenAI-compatible stub before spending a real model call: happy path, one-character log (400), malformed JSON (400), rate limit (429). Then the real call: 12 commits in, three accurate lines out, 3.4 seconds. It ignored the merge and the version bump, noticed the revert, and correctly said nothing was blocked.

Two things that bit me along the way:

  1. Vite loads .env into import.meta.env, not process.env, while the server code reads process.env. I load the file in vite.config.js; on Vercel the platform supplies the variables and there is no file to load.
  2. The GitLab repository already had an initial commit, so the first push was rejected. Rebased onto origin/main, kept the project README, pushed again.

Why Does Open Innovation Matter?

The model is the point, not a black box behind a paywall. Gemma 3 27B has open weights, so the same prompt can run through a hosted API for a public demo or through Ollama on a laptop with the network unplugged. A reader can check the licence, swap the provider in one file, or self-host the whole thing for free. That is the difference between an AI feature and AI you can own.

It changes the privacy story too. With Ollama, the commit log never leaves the machine. With the hosted demo, commit subjects do go to OpenRouter, which is why the app stores nothing and says so plainly. I would rather state that trade-off than pretend a thin wrapper is local-first.

The code is MIT, and the prompt, the schema and the failure paths are all in the repository. If the model gets a line wrong, you can see exactly what it was asked and change it.

My Agent Session

The Lazy Payoff

Standup is a short meeting wrapped in a long act of remembering. Here it is one paste and 3.4 seconds, and the result is short enough to read out loud. The laziness is aimed at the chore, not the work: the model summarises what the log already proves, and the minutes-saved number stays an estimate rather than a metric.

If it saves one round of "wait, what did I do yesterday?", it did its job.

Prize Categories

No partner technology is used, so this is entered for the overall prize only.

來源:DEV Community · dev.to