Peresós:用本機 Gemma 4 每日協助處理一項待辦
Peresós: a sloth that eats one item of my backlog a day, with Gemma 4 on my own GPU
作者製作 Peresós,透過本機 Ollama 執行 Gemma 4,每日挑選一項待辦並準備可供用戶確認的處理內容。輸出可為代擬回覆、決定、整理後的備忘,或任務的首個五分鐘步驟;用戶可接受、丟棄、延後或要求重試。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
I have a pile. Everyone has one: the message from the landlord I haven't answered, the gym membership I keep meaning to cancel, the friend asking whether Friday still works. None of these takes long. All of them need me to sit down, think for a minute and write something, and that minute is what I keep putting off.
Peresós (Catalan for sloth, and for lazy) is a sloth that lives in my terminal and eats that pile, one item a day.
I feed it whatever I'm avoiding:
peresos feed "From my landlord: the yearly boiler check is due. The technician needs a morning next week when someone is home. Which day suits you?"
It eats files too: peresos feed bill.jpg, or right-click a photo or a PDF and Feed to Peresós. Gemma looks at photos itself. Ollama takes no PDFs, so Peresós reads them on my computer and gives Gemma the text, or pictures of a scan's first pages.
When I change my mind about an item, peresos pile edit 3 opens it in my editor, and peresos pile remove 3 takes it off. In the window, a pencil next to each item does the same.
Once a day I wake it with peresos. It takes the oldest item, and Gemma 4, running on my own machine, prepares the finished version: the reply written as me, the decision with one sentence on why, the note cleaned up, or for a task, only the first five-minute step. Then it waits, and I do the only part that needs me:
-
ytake it: the finished version is saved, and the item leaves the pile for good -
nbin it: deciding not to do something also finishes it -
llater: back to the bottom of the pile -
aanother try: Gemma writes a different version, and knows which ones I didn't want - Enter: decide another day. It keeps the item in its mouth until I come back
The rules are what make it lazy in a good way:
- One item a day, at most. It is a sloth. A pile of forty things is overwhelming; one thing, already done for you, is a five-second yes.
- It never nags. Skip a week and it simply sleeps, then tells you how long, with some pride.
-
On a lazy day, it is lazier than you.
peresos --lazy(or Something easy in the window) lets Gemma pick the easiest item on the pile and say why, then make the laziest version that still finishes it. Given a test pile with a tax return, a family trip, a gym membership and a friend asking about coffee, it picked the coffee: "Just a tiny 'yes' is all it takes, no need to rush." The next lazy wake took the gym and answered "Don't renew. At €45 per month for only 3 visits since June, the cost per visit is €15." Sometimes the laziest answer is not doing it, and it says so. The normal wake still eats the oldest item, so the tax return gets its turn. - It writes a line in its diary after every meal, in its own voice, and grows up as the pile shrinks: a baby that kicks its little legs, a young sloth chewing a leaf, a grown one yawning, and after ten items, a big round sloth asleep on its branch. Clear the whole pile and it climbs on top of its branch and sleeps there, full, until you feed it again.
And it's yours to dress up: peresos wear sunglasses coffee puts things on it, from sunglasses and a cap to a barretina (the red Catalan cap) or a steaming mug on the branch. Each item is a small drawing function, so adding your own is a good first pull request.
It also has a home. peresos window puts it in the tray, like JetBrains Toolbox: a pixel face in the top bar that shows what it's doing, and a small window with a pixel-art jungle, today's bite and a menu for everything the terminal does. The terminal can close, and the desktop tells me when Gemma is done. The leaves follow the season and the sky follows the weather outside, from fog to snow on its branch. Click the sloth and it answers: a pat and it closes its eyes, a tickle and it laughs, a poke while it chews and it says "Mmf. Mouth full."
An arrow in the title bar folds the window up to the sloth alone, so it can hang there while I work. Folded, the title bar says when a bite waits.
Getting it is one line, on Linux, macOS or Windows:
curl -fsSL https://raw.githubusercontent.com/deeptelar/peresos/main/install.sh | sh
(irm .../install.ps1 | iex in PowerShell.) It brings its own Java, then peresos doctor checks Ollama and Gemma and says what's missing. Where Ollama can't be installed, peresos gemma off still brings one item a day, as I wrote it.
Who gets to be lazier: anyone whose backlog is made of small things that each need a minute of thinking. The sloth does the minute. You do the yes.
Demo
That's a real session on Gemma 4 (12B) in Ollama, with the waiting cut short. First I tell it one fact about me, which it uses from then on: I work from home on Tuesdays and Thursdays. It turned the landlord's question into "Tuesday morning next week works well for me as I'll be at home", without me typing a day. The second peresos on the same day gets "It already ate today. One item a day is plenty."
Code
deeptelar
/
peresos
A sloth in your terminal that eats one item of your backlog a day. Gemma 4 on your own machine prepares the finished version; you only say yes or no. Built on Telar.
Peresós
A sloth that eats one item of your backlog a day. You feed it what you keep putting off, and Gemma 4, on your own machine, prepares the finished version. You only say yes or no.
Peresós is Catalan for sloth, and for lazy.
Install
# Linux and macOS (Apple silicon) curl -fsSL https://raw.githubusercontent.com/deeptelar/peresos/main/install.sh | sh
# Windows, in PowerShell irm https://raw.githubusercontent.com/deeptelar/peresos/main/install.ps1 | iex
It brings its own Java, the peresos command, a menu entry and Feed to Peresós in the
right-click menu of photos and PDFs. You also need Ollama:
peresos doctor --fix # checks everything and pulls Gemma 4 (gemma4:12b, about 8 GB)peresos update and peresos uninstall do what they say. To build it yourself, see
CONTRIBUTING.md.
Use it
peresos about "I work from home on Tuesdays and Thursdays" # facts
…
About 5,500 lines of Kotlin, plus 2,400 lines of tests. The tests run the whole workflow against a scripted model, so they need no GPU. On every release, GitHub Actions builds the installers for Linux, macOS and Windows, then installs, updates and uninstalls each one on a fresh machine. A soak test clicks the window's buttons at random through months of simulated days, while a terminal feeds and wakes the same sloth and Ollama stops halfway. It checks the pile, the checkpoint and the screen after every click, and it found four bugs in the window before I did.
How I Built It
The model: Gemma 4, in Ollama, on an 8 GB GPU (an RTX 3070). I use gemma4:12b through Ollama's OpenAI-compatible API. Gemma 4 thinks before it answers by default, and that turned out to be the most important knob:
- For preparing the finished version, I let it think. The replies are better, and the 10 to 60 seconds don't matter for something you were going to put off for a week anyway.
- For the diary line, I turn thinking off with
reasoning_effort: "none". In my test, a three-word answer took 37 seconds with thinking and 4 without.
The workflow: a small graph. Peresós is built on Telar, an open-source Kotlin library for AI workflows that I maintain. To be clear about what's new: Telar existed before this challenge, and Peresós is a new app that uses it from Maven Central like any other library. One thing I did add to Telar this week, because the sloth needed it: images and PDFs in a model call (Attachment, released in 0.1.0-alpha14). Feeding Gemma a photo is one more argument:
model.ask<Bite>(chewPrompt(sloth, plate.text, about()), system = CHEF, attachments = plate.attachments)
A wake is five nodes:
START then wake
conditionalEdge(wake, targets = setOf(pick, chew, NodeRef.END)) { sloth ->
when {
sloth.rest != Rest.NONE -> NodeRef.END // already ate today, or nothing to eat
sloth.lazy -> pick // a lazy wake: Gemma picks the easiest item first
else -> chew // a normal wake eats the oldest
}
}
pick then chew
chew then swallow
conditionalEdge(swallow, targets = setOf(chew, diary)) { sloth -> if (sloth.bite == null) chew else diary } // "another try" loops back
diary then NodeRef.END
Three things in there carry the whole idea:
The sloth is one data class, saved after every step. When it last ate, what it's chewing, its meals, its diary: all in a
@SerializableSloth, written to a checkpoint file. Its memory from one day to the next is simply the checkpoint of the last run.It waits for me by stopping, not by blocking. The graph pauses before
swallow. The process ends, the terminal can close, the computer can sleep. The nextperesosfinds the paused run and resumes it with my answer, without asking Gemma again. For a sloth, a workflow that can wait a day for a human is not an edge case, it's the main feature.Gemma answers with a typed value, not text I have to parse.
@Serializable
data class Bite(
@Description("REPLY for a message that waits for an answer, DECISION for a choice to make, NOTE for something to keep, TASK for something to do")
val kind: Kind,
@Description("A title of at most six words") val title: String,
@Description("The finished thing, ready to use as it is ...") val finished: String,
)
val bite = model.ask<Bite>(chewPrompt(sloth, about()), system = CHEF)
ask gives Gemma the JSON schema of the class and asks again, with the error, if an answer doesn't fit.
One small detail I like: swallow changes the pile and writes the finished file inside an effect, which is saved with the step. If the computer dies halfway through, the sloth never eats the same item twice.
The window runs the same graph through Telar's GraphSession: the run is a StateFlow of snapshots (running, waiting for my answer, done, stopped) that Compose draws, and the buttons call start and resume. The terminal and the window share one checkpoint, so they're two views of the same sloth.
Three lessons from the first runs:
- The sloth's voice leaked into my replies. The first reply to a friend ended with "There is no need to hurry." Charming for a sloth, odd from me. Now preparing the finished version has its own instructions, "write as that person, never as an assistant", and only the diary sounds like the sloth.
-
A good model leaves blanks instead of guessing. Asked for a day for the boiler check, Gemma wrote "Next [Day] morning". That was correct, since it didn't know my week, but it wasn't finished. So I added
peresos about: a few facts it uses every time, kept in a local file. -
Other people's computers are the hard part. The sloth took a day; installers for three systems took another. The first managed Windows PC still failed: its PowerShell blocked the .NET calls my installer used, so it now uses plain cmdlets, and CI tests that mode. That PC couldn't install Ollama either, which is where
peresos gemma offcame from.
Why Does Open Innovation Matter?
Look at what's on the pile: a message from a friend in Catalan, my landlord's email, how often I actually went to the gym, a photo of a bill. Together with the facts I gave it about myself, that's a small diary of my life. I would not paste it into a hosted API every day for the convenience of not writing a reply.
With an open-weight model, I don't have to. Gemma 4 runs on my own GPU, and the pile, the facts, the diary and the checkpoints are plain files in ~/.peresos. Nothing leaves my machine, and there's no bill. (Only two things go out, and only when I ask: my town to Open-Meteo for the weather, and peresos update to GitHub. Never the pile.) That also means a slow model is fine: the sloth can think as long as it likes, and nobody is counting tokens.
The open pieces all the way down (Gemma, Ollama, an open-source workflow library) are why this could be a toy I trust with real messages, instead of a demo I'd only feed fake ones.
And a personal opinion, since this is what the theme is about for me: open-source models like Gemma are going to redefine how we think about IoT and small devices, especially self-contained intelligence in offline environments, where privacy and security are key. Devices and programs with these capabilities, that we can interact with, will help people in their daily lives. This is the integration of AI into society that will benefit everyone.
Prize Categories
- Gemma: Gemma 4 does all the work, locally in Ollama: typed answers for the finished versions, with thinking on, reading photos and scanned PDFs, and the diary with thinking off.
來源:DEV Community · dev.to




