SlothSort:Gemma 提議 Telegram 資料夾,經我審批後才套用
SlothSort: Gemma proposes Telegram folders, I approve the changes
SlothSort 使用本機 Gemma 3 4B 為帳戶可存取的 Telegram 對話建議分類資料夾,經用戶明確審批後才透過 MTProto 建立 Telegram 原生聊天資料夾。預設只使用中繼資料和描述;用戶亦可選取每個聊天室最近 5、10 或 20 則文字訊息供模型分析,應用程式不會下載媒體。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.
What I Built
I kept putting off the same small Telegram chore: opening each chat or channel, deciding where it belonged, then manually maintaining chat folders. SlothSort does the first pass for me. It reads the Telegram dialogs my account can access, asks a local Gemma 3 model to propose folders, and shows a review screen before changing anything.
It does not blindly sort by title. I can choose metadata alone, add group and channel descriptions, or sample 5, 10, or 20 recent text messages per chat. Each proposed assignment includes a reason and an estimated confidence. Clear suggestions are preselected; uncertain ones wait for my decision; weak ones remain unassigned. I can move chats, rename folders, or leave them out. Only my explicit approval creates Telegram's native chat folders through MTProto. I can undo the latest creation while those folders remain unchanged.
The lazy payoff is fewer repetitive folder decisions, not zero responsibility. I have not measured a reliable number of minutes saved yet.
Demo
Watch the 16-second video demo
The video uses invented chats and a proposal previously computed with Gemma 3 4B on my machine. I omitted the CPU inference wait to keep it short. Reviewing assignments, simulated folder creation, and undo were recorded live. The demo adapter never connects to Telegram or touches a real account.
Code
SlothSort on GitHub — MIT-licensed, with setup instructions, a synthetic-data demo, and 21 automated tests that do not require Telegram credentials.
How I Built It
The default path is Telegram via Telethon/MTProto → a FastAPI service → Gemma 3 4B through local Ollama → a browser review screen → explicit approval → Telegram dialog filters. The model proposes; it never sends Telegram API requests itself.
I made the context budget visible. The initial mode uses metadata and descriptions, not private messages. If I enable message sampling, the app sends only the selected recent text to the chosen model, truncates each message, and never downloads media. With local Ollama, inference stays on my machine. Optional Codex, OpenCode, and Antigravity CLI connectors are experimental and require separate consent because their providers may process data remotely.
Gemma returns structured JSON. The server validates the proposed chat identifiers against the current snapshot, prevents duplicate assignments, and does not automatically accept low-confidence predictions. It also checks existing Telegram folders before proposing new ones. Undo is deliberately guarded: it removes only folders created by the last operation that still match their saved state, so a folder edited elsewhere is left alone.
The rough edges matter. A short sample can misrepresent a chat, confidence is a model estimate rather than a calibrated probability, Telegram imposes its own limits, and undo history currently lives only in server memory.
Why Does Open Innovation Matter?
The default classifier is an open-weight model I can run locally, inspect, and replace. That is especially useful when the input may include other people's messages: I do not need to send their text to a closed hosted AI API just to tidy my sidebar. Local inference can be slower on CPU, but the tradeoff is visible and under my control. Telegram itself still requires a network connection, and choosing an optional CLI engine changes the privacy picture; the interface says so before analysis.
Prize Categories
Best Use of Gemma — Gemma 3 4B powers the default classification flow. The synthetic demo uses its real proposal, and the source shows the schema, prompt, and validation around its output.
For adjacent approaches, Ishaan Chowdhury's SlothBrief uses local Gemma to brief group chats, while Preetam's TGLoader explores Telethon for Telegram channels. SlothSort focuses on reviewable changes to Telegram's own chat folders.
來源:DEV Community · dev.to
