跳到正文
DEV Community· Sub Engel·· 4 小時前AI 評分50

slothnotes 用本機小模型讀取筆記並生成摘要

slothnotes: let a tiny local model read your notes so you don't have to

AI 導讀

Sub Engel 開發開源 Python CLI 工具 slothnotes,可為指定資料夾內的 .md 或 .txt 筆記逐篇生成摘要,並可選擇寫入 digest.md。

正文

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

What I Built

I have a folder full of notes I never reread. Standups. A grocery list. An email to my landlord. Book club plans.

slothnotes is a small Python CLI that reads that folder for me. You point it at a folder of .md or .txt files. It prints one summary line per note. If you want, it also writes a digest.md you can skim in about ten seconds.

It runs a small open-weight model (Qwen2.5-0.5B-Instruct, Q4_K_M GGUF, about 490 MB) on the CPU through llama.cpp. After the model download, it needs no API key and no network.

The effort it saves is the boring part: opening every file to remember what was in it. One command does that.

Demo

slothnotes summarizing four sample notes in a terminal

This is a real run on four sample notes: standup, groceries, landlord, book club. On an 8-core CPU with no GPU, it summarized all four in about 3 seconds.

One honest limit: the tiny model got a grocery detail wrong. It listed "half a loaf of bread" when the note actually says to skip bread. A bigger GGUF should be more accurate, but it will be slower. For a quick skim it's fine. For anything that matters, read the note.

Code

https://gitlab.com/engelstands-hue/slothnotes

MIT licensed. It has a README, three pytest tests that run without the model, and a GitLab CI job.

How I Built It

  • Python and llama-cpp-python, running on the CPU.
  • Qwen2.5-0.5B-Instruct (Apache-2.0) as a quantized GGUF.
  • One prompt per note, one line back, then an optional markdown digest.
  • --model takes any GGUF, so you can swap models without touching code.

To try it:

pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
curl -L -o models/qwen2.5-0.5b-instruct-q4_k_m.gguf https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q4_k_m.gguf
python slothnotes.py demo_notes --out digest.md

Why Open Innovation Matters Here

Notes are personal. Standups, landlord emails, grocery lists. Because slothnotes runs an open-weight model locally, none of that leaves the machine. It works offline, and each run costs nothing. Since the model is open, you can swap in a bigger or fine-tuned one with a single flag.

A closed API would mean an account, a key, a bill, and sending my notes to someone else's server. For a tool whose whole point is being lazy, that's too much setup.

Prize Categories

None. This entry doesn't use partner technology.


More of what I build: https://engelailabs.com

來源:DEV Community · dev.to