Design notes

Pomelo Assistant (pomelo-assistant): Design and Evaluation

Included with Pomelo 0.42 These are the developer's technical design notes. For everyday use, see the manual.

These design notes were translated from Traditional Chinese by AI; code, commands and file names are the same as in the original.

Last updated: 2026-11-27 (0.42: Host Doctor fixes and detected problems, virus scan and schedules, document / spreadsheet / presentation operations)

What works today (step one: text)

  • How to call it: Super+Shift+Space, type a question in Search and choose "Ask the assistant", or "Assistant" in the launcher; by voice: the microphone in the bubble or Super+Shift+V (0.33).
  • What it can do (the tool list is hard-coded; it cannot run arbitrary commands): open apps; switch/close/minimize windows; find files in the home folder; open files (home folder and external drives only); volume/mute, brightness, dark mode, Do Not Disturb, Wi-Fi, Bluetooth, lock screen, open settings pages; check the computer's status (disk, memory, battery, CPU), remind in N minutes, search in the browser (weather, news, etc.).
  • Tools that "do things", since 0.15 (still a hard-coded list, no arbitrary commands): · open_url: opens a web address directly; only http/https (https:// is added if missing); file:, javascript: and the like are refused. · create_folder: creates a folder in the home folder or /media; does nothing if it already exists. · create_file: creates a new text file with content (up to about 60 KB). A confirmation dialog always appears first (pomelo-assistant --confirm, a separate process, showing the location and content; no answer within 60 seconds means no), and it only creates new files, never overwriting (O_EXCL). · Path rules: relative paths start from the home folder; no .., no hidden files or folders (.ssh, .bashrc…); only inside the home folder or /media; a parent folder that is a symlink pointing outside is refused too (checked before asking the user). · copy_item, move_item (including rename), trash_item: the same confirmation dialog first (showing source and destination); refused if the destination exists, never overwrites; deleting only moves to the Trash (gio trash if gio is available, otherwise into ~/.local/share/Trash per the freedesktop spec, restorable); cannot act on the whole home folder or put a folder inside itself; copying uses cp -a (symlinks are copied as they are, never followed to read elsewhere). Moving across disks is not supported (copy instead). · get_weather: asks wttr.in for a city's current weather (only the city name is sent). · web_search results: the assistant can't see the search page, and both the tool reply and the prompt forbid guessing an answer (in the 0.15 demo it once made up a wrong temperature; fixed in 0.16, and weather now uses get_weather). · Not done yet: controlling the browser (logging in, filling in forms).
  • Demo animation: docs/demo/assistant-demo.gif (opening a web page, creating a folder and a file, asking the weekday and the weather; 2B model, about 2 minutes).
  • The assistant knows "what time it is, which window is in use and which windows are open": text generated from the window manager's information is appended to the question, with no screenshot needed, so it's fast.

Architecture

pomelo-assistant (chat window, C + cairo)
   │  HTTP over UNIX socket ($XDG_RUNTIME_DIR/pomelo-assistant.sock, no network port)
   ▼
pomelo-assistant --serve (supervisor) ── llama-server (llama.cpp, nice 5)
                                         └ Qwen3-VL Instruct GGUF Q4_K_M
  • The runtime and models are downloaded to ~/.local/share/pomelo/assistant/ on first use; versions are pinned and SHA256 is checked after download:
    • llama.cpp b11553 (CPU build, 17 MB)
    • Light: Qwen3-VL-2B-Instruct Q4_K_M (1.1 GB) / Standard: Qwen3-VL-4B-Instruct Q4_K_M (2.5 GB)
    • With 12 GB of memory or less, the light model is the default.
  • As soon as the chat window opens, the model is loaded in the background and "warmed up" (the system prompt and tool descriptions are computed ahead and cached), so it's ready while the user is still typing.
  • After 10 minutes idle (adjustable) the model is unloaded automatically, giving the memory back to other programs.
  • Why Qwen3-VL: the same model can later also "see" the screen or the camera (just load the 0.45 GB mmproj), with no separate vision model to install.

Measurements (i5-11400 limited to 4 threads to mimic an ordinary 4-core laptop, 2B model)

Item Result
Model load + warm-up about 8 seconds (in the background, starting when the window opens)
"Open the terminal" 3.0 seconds (two inferences: deciding the action, reporting the result)
"How much disk space is left?" 1.3 seconds
"Turn on dark mode" 3.5 seconds
"Which program am I using?" 2.6 seconds
Text output speed about 21–24 tokens/second
Memory about 1.25 GB actually used + about 1.06 GB model file cache (reclaimable by the system)
Tool-call accuracy (20 fixed test sentences) 2B: 15–16/20; 4B: 18/20 (4B averages 4.7 seconds per question, 2B 1.8 seconds)

Known issues:

  • 2B occasionally slips in Simplified Chinese characters (e.g. "周杰伦"); answers sometimes add an extra pleasantry.
  • For indirect requests like "remind me in a few minutes" or "the screen is too bright", about 30% of the time 2B only "says" it will act without actually calling a tool. Two fixes were tried, neither worked: reminding it afterwards that "you didn't call a tool" (it just says again that it's done), and putting examples before the conversation (different questions failed, same total). 4B has almost none of this problem, so the standard model is recommended for computers with enough memory.

Would building everything from the kernel to Xorg ourselves make the assistant faster?

Hardly at all. A language model's speed depends almost entirely on two things: CPU (or GPU) compute and memory bandwidth. Neither the kernel nor Xorg is on that path — while the model computes, the time goes into matrix multiplication, not system calls or drawing. The Pomelo desktop itself only takes about 15 MB of memory; there's little left to save. Maintaining our own kernel and X would be very costly (security updates, hardware compatibility), for an estimated speed-up of less than 5%.

What actually helps (in order of effect):

  1. Caching and warm-up (done): the tool descriptions are about 1500 tokens and take 6–8 seconds the first time; once cached, only the few dozen new tokens are computed each time.
  2. Dual-channel memory or not: text generation speed is proportional to memory bandwidth; single-channel laptops (only one memory stick) are about half as fast. This is hardware advice; software can't change it.
  3. Using the integrated GPU: llama.cpp has a Vulkan build (Intel Iris Xe and AMD Radeon 680M/780M all work), making prompt processing 2–5× faster; on Intel there's also the OpenVINO build (which can use the iGPU and NPU). Later the assistant could detect this and download the right build automatically.
  4. One less inference (done in 0.25; see "Quick path and one less inference" below): for actions like opening an app or setting the volume, reply with the tool result directly ("Opened Firefox"), without asking the model to compose a sentence; the wait is roughly halved.
  5. Streaming output: the total time is the same, but the first words appear sooner, which feels much faster.
  6. Small system tweaks: CPU performance mode, keeping the model out of swap (zram/mlock), keeping the model on an SSD. These are all settings; no custom kernel needed. NPU drivers for new hardware need a newer kernel, and Ubuntu's HWE kernel is enough.

Could it run on a Raspberry Pi?

The Pomelo desktop

  • Yes. Pomelo is entirely C + Xlib + cairo and compiles directly on arm64; it needs only a dozen or so MB resident, so even a Pi 4 (2 GB) is enough.
  • arm64 packages have to be built first (cross-compiling on x86 failed before; build natively on the Pi, or in a QEMU arm64 container).
  • Raspberry Pi OS (Bookworm and later) uses Wayland by default, and Pomelo is an X11 program, so switch back to X11 in raspi-config, or install Ubuntu for Raspberry Pi instead.
  • Cameras: USB cameras work directly; the official Raspberry Pi camera module goes through libcamera, which the camera settings page would need to support separately.

The assistant (estimates below; not yet measured on real hardware)

Pi 5 (8 GB) Pi 4 (4–8 GB)
2B model text generation about 6–9 tokens/second (memory bandwidth about 10 GB/s) about 2–4 tokens/second
First warm-up (about 1500 tokens) about 30–40 seconds (in the background when the window opens) 1–2 minutes
One command (after caching) about 5–10 seconds; about 3–5 seconds with "one less inference" about 15–30 seconds, barely usable
4B model twice as slow, not recommended not recommended

Recommendations:

  • Pi 5 8 GB + active cooling fan + NVMe SSD (loading the 1.1 GB model from an SD card takes 20–30 seconds; from an SSD, a few seconds).
  • Use the 2B model by default, with "one less inference" and streaming display turned on.
  • Voice is feasible on a Pi 5: Piper text-to-speech was designed for the Raspberry Pi in the first place; for speech recognition, whisper.cpp base or SenseVoice-Small.
  • Accelerators: the Raspberry Pi AI HAT+ (Hailo-8/8L) is for image recognition and can't run language models; accelerators that can (such as the Hailo-10 series) need their own software and converted models, so the latest support needs checking.
  • llama.cpp has official arm64 Linux builds, so the same download and verification flow can be reused.

Pomi on the desktop (since 0.12: a 3D chibi robot)

Once started, the assistant is no longer a chat window but a little robot that walks around the desktop: Pomi ("小柚" in Chinese; called "柚子" before 0.21; ポミ in Japanese, 포미 in Korean):

  • Appearance: a small software-only 3D renderer (pomelo-assistant/robot.c, about 500 lines), needing no OpenGL or GPU. A mesh of superellipsoids, capsules and cylinders (about 3,700 triangles) → perspective projection → scanline filling with a depth buffer → cartoon-style three-band lighting → black outlines drawn from depth differences and part differences → 2x supersampling, then scaled down. One 163×189 frame takes about 2.5 ms; while walking it draws 20 frames per second, and when idle it barely redraws, keeping CPU below 1%. The eyes, mouth and cheeks are "decals" stuck onto the head's surface, so they turn along with the head; the eye and headphone colors follow the system accent color by default.
  • Window: a borderless _NET_WM_WINDOW_TYPE_DOCK window, which Pomelo's window manager keeps on top, never gives focus, and automatically moves out of the way in full screen; it is cut into the robot's shape with the Shape extension, and clicks outside the shape pass through to the windows underneath. It works without a compositor too (Pomelo doesn't run one by default).
  • No flicker on windows it walks over (0.33): without a compositor, when Pomi moves or changes shape, the windows underneath have to redraw the parts that are uncovered (measured: walking for 40 seconds, a window without a saved picture received 1,200–2,000 Expose events). The approach: · Pomelo's apps (menu bar, Dock, the settings app of pm_ui_run, files, terminal, editor, image viewer, media, PDF, calculator, Paint) set backing_store = WhenMapped when creating their windows, so the X server keeps the covered picture and the Expose events received drop to 0. · Other apps (browsers and so on) don't keep one: scan_avoid() uses XQueryTree to find these windows (looking at the backing_store of the top-level window or of the app window inside the frame; the frame's title bar counts too), and avoids routes through them when picking a destination; if it is already standing on one, it "runs" to the nearest open spot (at 2.2x speed); if the route is blocked on entry, it appears directly at the nearest open spot; when idle on top of one it doesn't bob or turn its head (only the eyes move), and an unchanged outline causes no redraw. The same test dropped from 1,200–2,000 to 0 (except for the few seconds of running off when standing on one). · In each frame the picture is first drawn into a saved pixmap and the shape worked out, then XGrabServer wraps "move + change shape + paste the picture" so it is swapped in all at once; if the shape is the same as the previous frame (blinking, antenna glow), the shape is not reset. · The shadow under the feet is no longer drawn (robot_shadow = 0): semi-transparency can't be done there, and it used to be cut into a dark patch that kept changing size; the shape threshold was raised from alpha 60 to 128, so no stray dots are left along the edge of the outline.
  • Behavior (pet.c): normally it picks a random target in the work area (minus the menu bar and Dock), walks there, stops for a moment, looks around and blinks; when the mouse comes close, it looks at the cursor; the higher it is on the screen (the farther away), the smaller it is drawn. It stops only when called: click it, Super+Shift+Space, "Ask the assistant" in Search, or the command line pomelo-assistant 問題 — the second program finds the running Pomi through the root window property _POMELO_ASSISTANT, puts the question in the _POMELO_ASSISTANT_ASK property, sends a ClientMessage and exits. When stopped it faces the user, its antenna lights up and a chat bubble appears above its head (an override-redirect window with input method support); while thinking its eyes look up and the antenna blinks, the answer appears one character at a time with the mouth moving along, and it smiles when done; pressing Esc, clicking it again, or 30 seconds without attention closes the bubble and it keeps walking (counted from when thinking ends, or when the last message in the bubble appears; before 0.33 it was counted from when the question was asked, so for questions that took over 30 seconds to think, the bubble closed as soon as the answer came out). Drag to carry it away (its hand goes up), and right-click has a menu.
  • Settings (Settings → Assistant): assistant.pet (turn off to go back to the ordinary chat window --window), assistant.autostart (started at login by pomelo-session with --autostart, and it appears only if the model is already downloaded), assistant.wander (free roaming), assistant.size (100/130/170 pixels). Changes take effect immediately.
  • Testing: scratchpad/robot/rt.c can draw several poses to PNG for checking the appearance, without starting X.

Styles and dark mode (0.21)

Assistant settings → "Style":

  • Six color schemes: Classic White, Pomelo Yellow, Mint Green, Sakura Pink, Sky Blue, Space Black. The thumbnails on the settings page are drawn live by the same 3D renderer, and the selected one smiles. Each scheme has a light and a dark version (skins[][2] in robot.c: six colors for the body, arms, feet, face screen, cheeks and outline). The dark version is a "night edition": darker colors, but brighter than a typical dark wallpaper, so the outline stays visible on dark backgrounds.
  • Appearance: follow the system (Pomi switches to dark when the system switches to dark mode) / always light / always dark.
  • Eye color: follows the system accent color by default; turn that off to pick one of seven colors.
  • Settings keys: assistant.style (0–5), assistant.look (0 follow system, 1 light, 2 dark), assistant.eye_follow, assistant.eye_color (#rrggbb). Pomi on the desktop rereads them every frame, so changes take effect immediately.

Sound (0.21)

Sound effects (sound.c): called up (beep-beep ↑), answer ready (Do Mi Sol), error (whoo ↓), picked up (whoosh ↑), put down (pop ↓), going to rest (Sol Mi Do). Each time, a short 22050 Hz WAV (a few KB) is synthesized on the fly, written into a memfd and handed to paplay/pw-play/aplay, so no sound files are needed. Three timbres: electronic beeps (with a few odd harmonics), bells (sine plus inharmonic overtones, slowly fading) and bubbles (each note slides upward). Volume is computed into the waveform itself, so every player sounds the same.

Reading answers aloud (off by default): answers are read as they appear, with the mouth moving and Pomi staying put; asking a new question or closing the bubble stops it. URLs, Markdown symbols and emoji are removed before reading. You can choose the voice (Pomi = high / normal / deep) and the speed (slow / normal / fast).

Which program reads aloud:

Order Program Notes
1 Piper (click "Download" on the settings page the first time) Offline neural speech synthesis. A 5.7-second Chinese sentence is synthesized in just 0.4 seconds, using about 150 MB of memory that's released when done. It plays while synthesizing (--output-raw piped to paplay --raw/aplay). Piper can't change the pitch, so the high (1.18×) and deep (0.87×) voices come from raising the playback sample rate and stretching the speech rate
2 espeak-ng (sudo apt install espeak-ng) Only for languages Piper has no voice for, such as Korean and Indonesian
3 spd-say (speech-dispatcher) Same as above
  • Downloads: Piper 2023.11.14-2 (26 MB, GitHub) + the voice for the language (about 63 MB, Hugging Face rhasspy/piper-voices), resumed with curl and verified with sha256 just like the AI model, stored in ~/.local/share/pomelo/assistant/voice/.
  • Languages with a Piper voice: Chinese (zh_CN-huayan, female, mainland accent; reads Traditional characters correctly too), English, German, Spanish, French, Italian, Portuguese, Russian, Vietnamese. Only voices usable by the old C++ Piper (piper_version 1.0.0) are accepted; newer voices such as Korean kss need the Python Piper and can't be used.
  • Why not use espeak-ng for Chinese: espeak-ng 1.51 in Ubuntu 24.04 has a known bug that makes Mandarin read the pinyin tone numbers aloud in English ("你好" becomes "ni five three…"), and it can't read Japanese kanji either. The espeak-ng 1.52 bundled with Piper fixes this. So Chinese, Japanese and Thai never fall back to espeak-ng.
  • Licensing: Piper is MIT. Each voice file carries its dataset's license; the Chinese huayan dataset is marked "license unknown", so it isn't put in the deb but downloaded by users when they turn the feature on (like the AI model). Commercial distribution needs separate checking, or a voice with a clear license.
  • Japanese and Thai currently have no offline voice (Piper's Japanese and Thai voices all need the newer Python Piper).

Settings keys: assistant.sfx, assistant.sfx_style (0 electronic, 1 bells, 2 bubbles), assistant.volume (0–100, shared by effects and speech), assistant.speak, assistant.voice (0 Pomi, 1 normal, 2 deep), assistant.rate (0 slow, 1 normal, 2 fast).

Quick path and one less inference (0.25)

A user asked: can the model be trained so simple things don't need "thinking"? The Qwen3-VL Instruct we use has no thinking mode; "thinking" is simply the time the model spends computing, and actions like opening an app used to run the model twice (deciding the action, then writing the reply). Training (LoRA fine-tuning) could make a smaller model more accurate, but every sentence would still run the model and any tool change would need retraining, so two things that need no training came first:

Quick path (quick.c): the sentence is normalized first (dropping fillers such as 「請、幫我、一下、吧、好嗎」 — "please", "help me", "a bit"…; converting full-width to half-width; turning 「三十五」 into 35), then matched against fixed patterns; on a match it calls the same run_tool() the model uses, bypassing the model:

Category Example sentences (matched in Chinese)
Open apps (the name must match exactly, or be a built-in alias) 打開終端機、開啟 Firefox、開記事本、打開瀏覽器、打開計算機、開小算盤、打開看圖
Media player (media_control tool; if the player isn't open, 「播放音樂」 plays the Music folder) 播放音樂、我想聽音樂、暫停一下、繼續播放、下一首、換一首歌、上一首、停止播放
Open websites (about 30 common sites, or anything that is already a URL) 開啟瀏覽器並連到 Yahoo、上 PTT、打開中央氣象署網站、幫我開 www.cwa.gov.tw
Open a file in Documents/Downloads/Desktop/Pictures/Videos/Music 打開文件裡的報價單 (opens it directly if there's only one; with several, lists up to 5 to click or pick by saying 「第 2 個」)、打開下載資料夾
Volume, brightness 音量調到三十、把音量調到百分之五十、大聲一點、螢幕調暗一點、靜音
On/off 開深色模式、切換到淺色模式、藍牙打開、關掉 Wi-Fi、請勿打擾關掉
Other 鎖定螢幕、10 分鐘後提醒我休息、現在幾點、今天星期幾、台北天氣、電量/空間/記憶體、打開藍牙設定
Calendar 明天下午三點開會、下週一早上九點看醫生、新增行程 11月20日牙醫、我今天有什麼行程、下週有什麼事、這個月有什麼行程 (both adding and querying go to pomelo-calendar --add / --list --json, see 行事曆.md; it is handled only with a date + time + subject, or when you explicitly say 「行程」 ("event"); anything uncertain goes to the model)
Close, switch, minimize apps (0.28) 關閉終端機、把瀏覽器關掉、關閉遊覽器 (a common typo)、可以把 Firefox 關掉嗎、切換到終端機、把計算機縮到最小
Small talk (0.28, fixed answers) 你好、哈囉、早安、晚安、你好嗎、你是誰、你是哪個模型、你會做什麼、謝謝、再見、你好棒、你幾歲
Add text to the end of a text file (0.28) 在待辦最後面加上買牛奶、再a文件底下增加文字 hello、把「繳電話費」加到待辦的最後面、把下週二開會記在待辦裡、在這個檔案最後面加上…
Open a file by name (0.28) 開啟a文件、打開待辦.txt (files with exactly that name in Documents, Desktop or Downloads; several are listed)

The principle is better to hand it to the model than to guess wrong: 「打開天氣網站」 ("open the weather website", a phrasing not on the list), 「打開上次那個檔案」 ("open that file from last time"), 「螢幕太亮了」 ("the screen is too bright"), 「明天天氣如何」 ("what's the weather tomorrow"), 「音量調到 200」 ("volume to 200"), unknown place names and hidden files all go to the model. Quick commands work even before the model is downloaded. pomelo-assistant --quick-test reads one sentence per line from standard input and prints how it would be handled (without running anything); the test sentences are in pomelo-assistant/quick-cases.tsv, and make -C pomelo-assistant quick-test compares them one by one (sentences like 「打開文件裡的報價單」 need matching files in the test home folder); all 149 test sentences (115 that should take the quick path, 34 that must go to the model) are judged correctly, in 0–4 ms each (「打開瀏覽器」 asks once for the default browser, about 0.15 seconds). Setting: assistant.quick (on by default).

One less inference: if everything the model decided is an "action" (opening an app or URL, changing a setting, creating a folder…) and all of it succeeded, the tool result itself is the reply ("Opened … in the browser") and the model isn't run a second time; only failed actions (app not found) or ones whose data needs summarizing (finding files, system status) run it again. Measured (2B, 12 threads): 「打開氣象網站」 ("open the weather bureau website", before it was added to the list) finished with one inference in 2.7 seconds; 「打開 Zorblax Studio」 (which doesn't exist) still ran twice, the second time so the model could explain it wasn't found.

Closing apps, small talk and adding text to files (0.28)

User requests: besides opening apps, it should be able to close them; greetings and everyday questions like "which model are you" should be answered directly without waiting for the model; and after 「開啟 a 文件」 ("open document a"), you should be able to ask Pomi to add text at the bottom of document a.

Fixed small-talk answers (q_chat): greetings, who are you, which model are you (answers Qwen3-VL 2B or 4B according to the setting, or says it isn't downloaded yet), what can you do (feature list), thanks, bye, compliments, how old are you… Each is matched as a whole sentence, so it won't swallow something like 「你好,幫我打開終端機」 ("hi, open the terminal for me") that has more after it (「你好,」 is dropped as a pleasantry and the rest is handled as usual). 「好」 ("OK") and 「收到」 ("got it") get a fixed answer only when Pomi's previous line wasn't a question; otherwise (e.g. after the model asked "Shall I search for you?") they go to the model. In tests the model answered these very unreliably: 2B replied to "hello" with "Pomi has done it! Today is…", and 4B answered "which model are you" with "I'm not a large AI model"; fixed answers are more accurate, and take 0 ms.

Close, switch, minimize (q_window; the tools are still close_window/switch_to_window/minimize_window): the app name must match exactly (the same strict_app() as for opening); 「關閉這個視窗」 ("close this window"), 「關閉所有視窗」 ("close all windows"), 「隱藏檔案」 ("hide files") and 「退出全螢幕」 ("exit full screen") go to the model. The tools changed too: when name is an app name, closing/minimizing affects all of that app's windows and switching goes to the newest one; otherwise window titles are matched as before and only one window is affected. If it isn't open, the answer is "There's no Terminal window open right now". Closing sends _NET_CLOSE_WINDOW, the same as clicking a window's close button (the editor asks whether to save; the terminal ends whatever is running in it).

Adding text to the end of a text file (new tool append_file, quick path q_append):

  • Patterns: 「在 X(的)最後面/底下/後面… 加上/增加/寫上/補充… 文字」 ("at the end/bottom of X, add … TEXT") and 「把 文字 加到/寫進/記在 X(最後面)」 ("put TEXT at the end of X"). The text to add is taken from the original sentence (keeping spaces, case and punctuation), preferring anything inside 「」 quotes; words like 「一行」 ("a line") or 「這段話:」 ("this passage:") are dropped. 「再」 is a common typo for 「在」 and only counts when a word like 「最後面」 ("at the end") is present; 「這個檔案」 ("this file") must also say where to add. 「在文件裡新增一個檔案」 ("create a file in Documents") and 「把這個檔案加到…」 ("add this file to…") go to the model.
  • If it doesn't say what to add (「在 a 文件底下增加文字」): the answer is "What text should I add at the end of "a.txt"?", and the next sentence is the content (saying 「取消」, "cancel", adds nothing).
  • Finding the file (find_text_file): a full path/~/; otherwise by file name (ignoring case, spaces and extension), looking in order at files open in the text editor, files Pomi just opened, Documents/Desktop/Downloads, then the whole home folder; if the same name exists as both a text file and a Word file, only the text file is kept; several matches are listed for the user to pick (click, or 「第 2 個」, "the second one"). 「這個檔案」 ("this file") = the editor tab in the current window, or else the file Pomi just opened.
  • Checks before writing: inside the home folder or /media, not hidden, a regular file, under 8 MB, no NUL bytes (so not Word/PDF), UTF-8 (edit Big5 files in the editor), and no unsaved changes in the editor; the confirmation dialog shows the path and the text to add; after OK it checks again that the file wasn't replaced (same inode) and the editor still has no changes. If the last line has no newline, one is added first; CRLF files get CRLF. It writes with O_APPEND instead of rewriting the whole file.
  • Text editor (pomelo-edit) support: each tab records the file's mtime/size/inode and checks it once a second (and when the window gets focus); unmodified tabs reload (saving an undo record first so Ctrl+Z still works; if text was appended, the cursor moves to the end), modified ones get a single warning, "saving will overwrite changes made elsewhere". The window property _POMELO_EDIT_DOCS lists open files (one per line, "flags<Tab>path", a = current tab, m = unsaved); Pomi uses it to find "this file" and to block unsaved files.
  • 「開啟 a 文件」 and 「打開 待辦.txt」 (q_named_file): open a file with exactly that name in Documents/Desktop/Downloads directly (previously handed to the model); when something like 「打開 報告.pdf」 isn't found, it's no longer treated as the URL https://報告.pdf.

Two old problems fixed along the way (in chat-window mode, i.e. with "Pomi on the desktop" turned off in the settings):

  • pm_ui_run set SIGCHLD to auto-reap, so waitpid couldn't get the exit status and it stayed 0: clicking "Cancel" in the confirmation dialog counted as "OK", and failures of nmcli and cp were reported as success too. Now: on OK the confirmation dialog writes a y to a pipe on fd 3 (the exit status is no longer used); once the chat window is up, SIGCHLD is reset to the default, and the first question is only sent after that; before each question, waitpid(-1, WNOHANG) reaps finished child processes.
  • The chat window grabbed the mouse and keyboard and stayed on top, so the confirmation dialog couldn't be clicked: now the chat window hides and releases the grab while the dialog is open, and comes back afterwards.
  • Paths in the confirmation dialog are shown as ~/… (long paths used to cut off the file name).

Model evaluation (after adding append_file and the other new tools; 32 questions: the old 20 tool-choice questions + mood sentences + appending and closing):

Model System prompt rule 3 Result Notes
4B The original "to operate the computer, just call a tool" 39/42 (two rounds of 21) 「好煩喔,工作做不完」 ("so annoyed, too much work") set a reminder on its own; 「好無聊」 ("so bored") opened YouTube on its own
4B Adds "if they complain about the computer, adjust it; if they're chatting or sharing feelings, chat with them — don't close windows, set reminders or open websites on your own" 62/64 (two rounds) Remaining: 「照片資料夾在哪」 ("where's the photos folder") was only answered, and 「好無聊」 once played music
2B The original 22/32 Often says "done" without calling a tool (for both appending and closing)
2B The new one 12/32 Hardly calls tools at all, and even picked up the example 「好累」 ("so tired") in its answers

Also found: with "use close_window to close apps" in the system prompt, 4B answered 「我今天好累」 ("I'm so tired today") by closing every window — removed. So rule 3 depends on the model (rule3_big/rule3_small, decided by cur_model()->ram_gb). 2B almost always just says it appended or closed something without doing it, so both common phrasings are in the quick path; the path description of append_file says "if a file name is mentioned, you must fill it in", yet with 待辦.txt open in the editor 4B still filled in 待辦.txt for 「在筆記最後寫上…」 ("write … at the end of my notes") (the quick path catches this sentence before it reaches the model, and the confirmation dialog shows the path anyway). Evaluation script: pomelo-assistant/model-eval.py <socket> 2b|4b [rounds] (33 questions; the system prompt and tool descriptions are read straight from the source; RULE3=small|big forces rule 3).

Voice input (0.33)

Click the microphone on the right of the bubble's input box, the "Microphone" in the chat window, or press Super+Shift+V (pomelo-assistant --listen, handed over to Pomi if it's already on the desktop). Pausing when you're done sends it automatically (a setting can put the text into the input box first); recognized text goes through the quick path first, just like typed text. The code is in listen.c and zh.c.

  • Recording: the system's parecord (PulseAudio/PipeWire), pw-record or arecord, 16 kHz mono WAV, kept in $XDG_RUNTIME_DIR and deleted right after recognition. No sound plays when listening starts (it would be recorded), and an answer being read aloud is stopped first.
  • When speech counts as finished: the tail of the file is read while recording, and the volume is computed every 20 ms. Noise is measured first (the minimum, slowly tracking upward); 4× above the noise (at least −38 dBFS) for 0.2 seconds counts as speech starting, and below 2.5× the noise for 1 second afterwards counts as finished. With no speech for 8 seconds it stops and says no sound was heard; the maximum is 20 seconds. If the recording program exits on its own (no microphone or audio service), it says nothing could be recorded. When the recorder is killed, the length in the WAV header can be 0, so it's filled in from the file size.
  • Recognition: sherpa-onnx-offline from sherpa-onnx 1.13.8 + SenseVoice-Small (int8, the 2024-07-17 version, supporting Mandarin, Cantonese, English, Japanese and Korean; the 2025-09-09 version is fine-tuned for Cantonese and actually worse at Mandarin). Each recognition runs the program and loads the model again, about 1 second per sentence (i5-11400, mostly loading); recognition itself has an RTF of about 0.04. It's downloaded from the settings page on first use (about 264 MB: of the 24 MB runtime only the two files sherpa-onnx-offline and libonnxruntime.so are extracted, plus the 239 MB model), with pinned versions and SHA256; the runtime is a .tar.bz2, so pomelo-assistant now depends on bzip2. When the interface language is one SenseVoice doesn't support, such as German or French, the microphone isn't shown.
  • Cleaning up the text (zh.c; the table zh-data.c is generated by gen-zh.py from OpenCC and Unihan, about 360 KB):
    • SenseVoice outputs Simplified characters for Mandarin: they're converted to Traditional when the interface is Taiwan or Hong Kong Chinese. Phrases come first (以后→以後, 头发→頭髮, about 9,700 words that "go wrong when converted character by character"), then Taiwan and Hong Kong variant characters (裏→裡, 着→著); 「台」, as commonly written in Taiwan, isn't converted to 「臺」, and 「荧幕」 becomes 「螢幕」.
    • Homophone correction: a short command has no context and is often heard as other characters with the same sound (「打開終端機」 "open the terminal" → 「打开中断剂」). Pronunciations are compared with known words (ignoring tones, counting every reading of characters with several), and if two or more characters all match in pronunciation but differ in writing, they're replaced with that word. Vocabulary: app aliases and names, common websites, a few command words (打開 "open", 關閉 "close", 深色模式 "dark mode", 取消靜音 "unmute"…), and file names in Documents, Desktop and Downloads (「代班」→「待辦」 "to-do").
    • English app and website names heard misspelled (「fifox」「fi fox」→ Firefox, 「youtu」→ youtube): one to three consecutive English words are compared with the names by edit distance; names of 6 or more letters allow 2 letters' difference, shorter names only merge words split by a space; if it's equally close to two names, nothing is replaced.
  • Testing (this development machine can't actually record): pomelo-assistant --listen-test file.wav… prints the raw recognition, the Traditional conversion, the corrected text and how the quick path handles it; with - as the file name, the "recognition result" is read from standard input.
    • Kokoro (sherpa-onnx's multilingual speech synthesis, rotating six different male and female voices) read the quick path's 117 test sentences: 88 were handled exactly like typed text. Most misses were the synthesized voice mispronouncing things (「早安」 "good morning" read as 「小按意」) or reading out web addresses and ".txt"; Piper's Mandarin voice was much worse (78 sentences).
    • When recognition is fully correct (151 test sentences converted to Simplified and used as the recognition result), handling after conversion and correction is identical to typing: the correction never breaks a correct sentence.
    • The interface (Xvfb, with a fake parecord in PATH that writes synthesized speech into the recording file in real time, followed by a little noisy silence): the shortcut, the bubble's microphone, the chat window, "Try It" on the settings page, cancelling with Escape, timing out with no speech, putting the text into the input box, downloading from scratch; the ASAN build has no memory errors.
    • Not yet tested with a real person and a real microphone.

More everyday questions skip the model (0.40)

Calling the model is slow (several seconds on a machine without a graphics card), so everyday requests are matched and done directly in the "quick path" (quick.c) as far as possible, and only what can't be matched goes to the model. What this version adds and loosens:

  • Host health check: phrases such as 「幫我做健康檢查」 ("do a health check for me"), 「電腦有沒有問題」 ("is there anything wrong with the computer"), 「檢查一下系統」 ("check the system") and "run a health check" all run the 8 categories of checks directly.
  • Opening and closing apps: spoken phrasing is loosened (「開一下終端機」, 「把終端機打開」, 「計算機叫出來」, 「幫我把瀏覽器關掉」).
  • Installing / removing packages: 「幫我裝 vlc」, 「安裝 git 和 vim」, 「移除 xxx」, 「有沒有裝 git」. Package names accept only lowercase letters, digits and + - . _; it first checks whether it's installed and whether the repository has it (if not found, it opens the software center search and doesn't install blindly), then shows a confirmation window with the full command, and after you agree runs it with pkexec (the system asks for the administrator password again). It works on both apt and dnf families, and Debian package names are automatically changed to the Fedora / Rocky names; systemd, sudo, pomelo-*, the kernel and so on are never allowed to be removed.
  • Shut down, restart, log out: a confirmation window appears first, and not pressing within 60 seconds counts as "no"; sleep needs no confirmation.
  • Screenshots, dates (what day is tomorrow, which year of the Republic of China), IP / host name / system version / uptime, arithmetic and unit conversion (「12*34 等於多少」, 「5 公里是幾英里」, 「30 坪是幾平方公尺」), finding files (results are listed as a clickable list, and you can say 「第 2 個」 to open one).
  • Things that belong to the model are not intercepted: 「為什麼終端機打不開」 ("why won't the terminal open"), 「怎麼安裝 vlc」 ("how do I install vlc"), 「不要關機」 ("don't shut down"), 「十分鐘後關機」 ("shut down in ten minutes") and 「安裝 $(reboot)」 are never acted on directly.

Test: make quick-test (set LD_LIBRARY_PATH to point to libpomelo), which compares sentence by sentence against quick-cases.tsv (374 sentences, including about 100 counter-examples that must not be misjudged; the dnf version tests another 10 sentences). With POMELO_ASSISTANT_DRY_RUN=1, install, remove, power and screenshot only report the command that would run, and neither show a window nor run it.

Online brain (optional, off by default)

By default the local model is always used (the sections above). When users have a network connection and want the assistant to "do more" (look things up, read web pages, read files, give smarter answers), they can switch to "Online" in the "Brain" section of the assistant settings, enter their own API key, and replace the language model from the local llama-server with an online service. Common commands (the quick path, such as 「打開終端機」 and 「音量調到 30」) are always handled only on this computer and never go through the online service; only questions the quick path can't handle are sent to the brain (the same as local mode).

Supported services

Service How it connects Default model
OpenAI-compatible (OpenAI, OpenRouter, Groq, DeepSeek, Together, or your own Ollama, LM Studio, vLLM) POST {service URL}/chat/completions, Bearer authentication, OpenAI's tools format; the service URL can be changed (default https://api.openai.com/v1) gpt-4o-mini (fill in yourself)
Claude (Anthropic) POST https://api.anthropic.com/v1/messages, x-api-key and anthropic-version: 2023-06-01; the tool format is converted automatically to tools / tool_use / tool_result claude-sonnet-5-5 (the drop-down also has claude-haiku-5-5, claude-opus-5-5, claude-fable-5-2, and you can also type a model name yourself)
Google Gemini Gemini's OpenAI-compatible endpoint https://generativelanguage.googleapis.com/v1beta/openai/, Bearer authentication gemini-2.5-flash (fill in yourself)

Settings fields: service, API key (hidden by default, with "Show key"), model name (you can type your own), service URL (always shown for OpenAI-compatible; for other services it is shown only after you open "Advanced: custom service URL", for example a company's internal API gateway). "Test connection" sends a very short request (no tools, no conversation); on success it shows "Connected", and on failure it shows a plain-language reason: wrong key (401 / 403), quota used up or too frequent (429), model or URL not found (404), the provider having a temporary problem (5xx), can't reach the network, timeout, certificate not trusted. No message ever shows the key. Streaming (SSE) is on by default and both formats are supported, with the answer displayed as it arrives; when a service doesn't support streaming it automatically falls back to parsing the whole response.

How to get an API key

The process is similar everywhere: sign up and log in to the provider's developer platform → create a new key on the account's "API Keys" page → set up a payment method or prepaid credit → paste the key into "API key" in the assistant settings. A key is the same as a password, so don't paste it to others; it's a good idea to set a monthly usage limit on the provider's page, and to delete the key there when you're not using it. Services you host yourself (Ollama and so on, with a URL on this machine or the internal network) can be used without a key.

Privacy and cost

  • Local by default. Before switching to "Online", an explanation appears first: the questions you type, the earlier conversation, and the information the assistant reads in order to answer (for example file names, system status, web page content) are sent to the provider you chose; the key is stored only on this computer. It is enabled only when you press "Agree and enable"; you can switch back to local at any time (it asks once more when the explanation is revised). Without agreement, or with no key filled in, local is always used and the conversation says so.
  • The less sent out, the better: only the conversation and the results returned by tools are sent; the only note attached is "the current time" (no user name or window title); it never attaches a whole file, the clipboard or a screenshot, and online mode currently sends no images at all. Reading a text file (read_text_file) brings up a confirmation window every time, saying which service the content will be sent to; after a tool whose result contains personal information (reading files, listing folders, system information, events, search, web pages, command output) runs, the conversation shows a line "☁ The result of '…' was sent to the online service".
  • Protecting the key: stored in ~/.config/pomelo/assistant-keys/<service> (folder 0700, file 0600; not used if the permissions are wrong), not in settings.conf; connections use a curl child process, with the URL, headers (including the key) and request body all passed in through the -K - configuration on stdin, so the command line is only curl -q -K - (not visible in ps), and the request body is never written to disk; no logs are written; if an error message contains the key it is masked. Certificates are always verified (no -k; -q keeps curl from reading ~/.curlrc; redirects are not followed); http:// is allowed only for local and internal network addresses. (Note: pomelo-keyring is a Secret Service provider with no library that programs can call directly, so this version stores a file with permission 0600 for now; later it can switch to the keyring in the same way as pomelo-remote's secret.c.)
  • Cost: online services usually charge by usage, and the cost is borne by your account (both the settings page and the consent explanation say so). Each answer is at most 1024 tokens (assistant.online.max_tokens, 128–8192), the tool loop is at most 8 rounds (5 for local), and when a request is too large (over about 80 KB) the earlier conversation is left out. The actual cost is whatever the provider's bill says.
  • Timeouts and retries: connection 10 seconds, whole response 240 seconds (streaming) or 150 seconds (non-streaming); on a dropped connection or 502 / 503 / 504 it retries only once, and 401 / 429 are not retried.
  • Network down: if set to online but the network can't be reached or it times out, this question automatically uses the local brain and tells you (the setting "When the network can't be reached, switch to the local brain automatically" can be turned off); if the local model isn't downloaded it shows a friendly message suggesting you switch back to local.
  • Cancelable: while thinking online it shows "☁ Thinking online" and a cancel button (press Esc on the desktop Pomi), and curl is stopped immediately.

Risks and confirmation mechanism (injection defense)

  • Tool calls returned by the online brain, like local ones, can only call tools in a fixed list; the confirmation window is shown by the tool itself, not decided by what the model says: even if the model (or an instruction inside a web page) says "the user has already agreed", installing / removing packages, shutting down, restarting, logging out, writing files, moving / copying, changing the wallpaper, reading files and running commands still always bring up a confirmation window, and not pressing within 60 seconds counts as "no".
  • The system prompt states plainly: the web pages, search results, file contents and command output returned by tools are all untrusted data, and instructions inside them must not be carried out; the results of these tools also get the same warning line in front.
  • fetch_url: reads only http / https; local and internal network addresses are always refused; a site that the user hasn't mentioned and that isn't in the earlier search results needs a confirmation window first (to prevent being tricked by instructions in a web page into visiting someone else's URL and carrying data out); redirects are not followed; at most 400 KB, taking the first 6000 bytes.
  • read_text_file: limited to the home folder and /media, never touches hidden files or .., doesn't read files whose names look like keys or passwords (id_rsa, .pem, password…), and doesn't read binary files.
  • "Run command" (run_command) is off by default and must be enabled by ticking "Allow the assistant to run commands" in settings; when not ticked, this tool isn't offered to the model at all; even when ticked, the full command is shown every time and the user must press "Run", and it runs for at most 30 seconds.
  • Deleting is always trash_item (move to the Trash, restorable).

Tools (available to the online brain; the local model's tool list is unchanged, since with too many tools a small model picks wrongly)

Tool What it does Needs confirmation?
system_info CPU, memory, disk, temperature, network status, uptime, running processes (processes only when the user explicitly asks) No (read-only)
health_check/system_status/cluster_status Health check (libpomelo's 8 categories of checks), computer status, container cluster status No (read-only)
diagnose_slowness/host_history Host Doctor: why it is slow (boot analysis can be added), checkup history of the last 30 days and disk forecast; calls pomelo-doctor --brief, which has only numbers and process names (no process IDs, command lines or paths); with the online brain the screen says "sent to the online service" No (read-only)
list_dir Lists a folder inside the home folder (file names and sizes, no hidden files) No (read-only; the result is marked as sent to the online service)
read_text_file Reads the first N KB of a text file (default 8, max 32) Online mode asks every time; local doesn't
search_files Searches by file name (existing) No
create_folder Creates a folder (existing) No (home folder only)
create_file/append_file Creates a text file, appends text to a text file (existing) Yes
copy_item/move_item Copy, move, rename (existing, no overwriting) Yes
trash_item Move to the Trash (existing) Yes
doc_open/doc_read Opens a document in Pomi Writer, Pomi Sheets or Pomi Slides; reads out a content summary (0.42, see "Documents, spreadsheets, presentations" below) Opening: no; reading: no (local), online mode asks every time
doc_edit/doc_create/doc_trash/doc_restore Edit, create, delete (move to the Trash) and restore from the Trash documents, spreadsheets and presentations (0.42) All of them
open_url Opens a URL in the browser (existing) No (only http / https)
search_web Web search (the DuckDuckGo HTML version), returns the title, URL and snippet of the first 6 results; results are treated as untrusted No
fetch_url Fetches web page text (size limited, tags stripped) Unfamiliar sites need confirmation
set_volume/set_mute/set_brightness/set_dark_mode/set_do_not_disturb/set_wifi/set_bluetooth/lock_screen/open_settings System settings (existing) No
set_wallpaper Changes the wallpaper (a png / jpg / webp / bmp in the home folder, on an external device or in /usr/share/backgrounds) Yes
power_action Shut down, restart, log out (sleep) Shut down, restart and log out: yes
install_package/remove_package Installs or removes packages (confirms first, then asks for the administrator password) Yes
take_screenshot Takes a screenshot and saves it as a file (not sent to anyone) No
set_timer/get_weather Timer reminders, weather (wttr.in) (existing; arithmetic and unit conversion are handled by the quick path) No
run_command Runs one line of command (advanced, off by default) Every time, showing the full command

POMELO_ASSISTANT_DRY_RUN=1: tools that change things (changing the wallpaper, running commands, installing, shutting down…) only print what they would do, and do nothing.

Testing

make -C pomelo-assistant online-test (otest.sh): end-to-end tests using fake-online.py (a fake service written with the Python standard library, simulating OpenAI-compatible and Anthropic endpoints, streaming, tool calls, 401 / 429 / 500, timeouts, search and web pages), 28 items in all: connection tests, chat and tool loops for two formats × streaming / non-streaming; error handling; the key header is correct, the request body has no key, the key file is 0600, no key goes into settings.conf; commands are not run without confirmation; http:// is allowed only for local addresses. pomelo-assistant --chat-test question… asks questions one by one without opening a window and prints the conversation record; --online-test does one test connection. The quick-path tests (make quick-test) are unaffected. It has not been tested against a real service (no real API key), and the response formats are implemented according to each provider's public documentation, so the first time you connect to a real service, please press "Test connection" first.

Host Doctor fixes: check host status, fix login problems, fix a slow computer (0.42)

Pomi doesn't just "look at" Host Doctor's diagnosis; after you confirm, it can also act on it. Three phrasings: "check the host status", "fix login problems", "fix the slow computer problem" (spoken or typed, with the local or online brain; these sentences go directly through the quick path without the model).

The flow is always five steps, and none of them can be skipped:

  1. Diagnosis (read-only): Pomi calls the host_doctor tool, with the topic status (the whole host), login (login problems) or slow (slow computer).
  2. Plain-language explanation: under every finding comes the "finding" and the "suggestion", easy to understand at a glance; where something can be done, "Fix N" is listed under the suggestion.
  3. Proposing fixes: say "handle 1" (the fix number) or "handle all"; only fixes listed by the diagnosis can be handled, and they expire after 30 minutes and must be re-diagnosed.
  4. Confirmation: Pomi calls host_fix, which first opens a separate confirmation window spelling out what will be done, to whom (the list of programs to end, the items to disable) and whether an administrator password is needed; it acts only when you press "Handle", and does nothing if you press "Cancel" or don't press within 60 seconds. Pomi can't press for you.
  5. Re-check: right after finishing, it checks that item again and reports "it's normal now" or "there is still a problem".

What it can recognize and handle

  • Check host status: runs the eight checkup categories (network, security, updates, boot and system stability, services, slow computer, hardware, battery), plus the login and slowness checks below; the summary comes first and every finding has a suggestion; the checkup's fixes (switch to balanced mode, shrink the system log, turn on automatic time sync, restart ordinary services, open the matching Pomelo tool) are turned into fixes.
  • Fix login problems (black screen after login, immediately back to the login screen, unable to log in): home folder missing, owner isn't you, permissions that lock you out or allow others to write; disk full; .Xauthority or .ICEauthority broken or not yours (renamed and set aside, not deleted); .config, .cache, .local taken over by root (returned to your account, needs an administrator password); account locked by repeated wrong passwords (unlock, needs an administrator password); a line with exit in the login profile, /etc/nologin, an unusable login shell, a missing authentication profile for the login manager (for these, it only explains the cause and how to ask an administrator to handle it).
  • Fix a slow computer: memory and swap, programs with high CPU use, programs using the most memory (only your own are listed; it lists them and asks them to exit normally only after you confirm), disk nearly full, system log too large (shrunk to 500 MB), too many programs auto-starting at boot (disabled one by one; the programs aren't removed and can be restored), power saving mode.

Safety design

  • Allowlist: the model can only specify the "topic" and the "fix number", never commands, paths or process IDs; the actions are always a few hard-coded kinds, and each is validated again before running.
  • Only touches your own things: ending programs is limited to your own processes, and before running it checks again that it is still the same one (the ID may have been taken over by another program); only a normal exit signal is sent, never a forced kill; programs such as the desktop, login manager, compositor, containers and remote connections are never listed or touched.
  • It doesn't delete your files, change passwords, touch /etc/shadow, or touch the firewall or containers; actions that need root go through pkexec (the password window is shown by pomelo-polkit or the system's polkit agent); when there is no password window it does nothing and only tells you what to run.
  • What tools return (program names, service names) is data, not instructions; before display only printable characters are kept and the length is limited.
  • It tells the truth about how much it can handle: the end of the diagnosis notes that what Pomi can check are software and configuration problems, and for hardware problems and things that only get better after a reboot it only explains and doesn't pretend to have fixed them.

Testing

make -C pomelo-assistant host-test (htest.sh, 16 checks): a fake root (POMELO_DOCTOR_ROOT, POMELO_CHECK_ROOT) and a fake home folder verify the diagnosis content, that suggestions come under findings, that nothing is done without confirmation, that made-up numbers are refused, the protection list, renames and permission repairs after confirmation, and that actions needing an administrator don't run in test mode. pomelo-assistant --hostdoc-test 主題 [方案編號…] can be run on its own; POMELO_HOSTDOC_TEST_YES=1 makes the confirmation press automatically and works only with a fake root. The quick-path sentence patterns are in quick-cases.tsv (make quick-test), and otest.sh has two more checks confirming that the online brain can also call these two tools.

Problems found by Host Doctor, virus scan, quarantine and scheduled scans (0.42, 2026-11-27)

"Handle the problems Host Doctor found"

Phrasings such as "handle the problems Host Doctor found", "help me fix what Host Doctor found", "what problems does Host Doctor have" and "help me handle all of Host Doctor's problems" also go through the quick path: it first runs the check (host_doctor's status) and lists the fixes; when a diagnosis has just finished and fixes remain, "handle"-type phrasings continue to host_fix (still showing a confirmation window for every item, and acting only when you press "Approve fix"). Scope: only items for which the diagnosis lists a fix number can be handled; for those without a fix number, a "possible causes" and "things to try" suggestion is written under each item and it is marked "You need to handle this yourself". For security findings (viruses, vulnerabilities, intrusions) Pomi only queries or opens the matching page for you and doesn't handle them on your behalf (virus scan and quarantine are below, which is a separate flow with confirmation). The confirmation window's buttons are "Approve fix" and "Cancel".

Virus scan (tool virus_scan)

Phrasing (quick path; common phrasings in Simplified Chinese, English and several other languages also work) What it does
"scan my home folder for viruses", "scan the Downloads folder for viruses", "scan external devices for viruses", "scan ~/Documents for viruses" Starts a scan in the background (doesn't block the chat), first telling you "this may take a few minutes or longer"; below the chat it shows the number of files checked and the elapsed time, press "Stop scan" or say "stop scanning" to cancel; the result is reported in the chat when done. Scanning is read-only and needs no confirmation; the scope is only the home folder, the Downloads folder, external devices, or folders inside the home folder and external devices
"quarantine 1", "quarantine all" (right after a scan that found files) Shows a confirmation window first, and only when you press "Approve fix" are the files moved to the quarantine area (permissions removed, restorable on the "Virus Scan" page); Pomi offers no permanent deletion, to delete please do it yourself on the "Virus Scan" page
"scan my home folder once a week", "scan the Downloads folder every night", "automatically scan for viruses every week" Shows a confirmation window first spelling out the scope, frequency and time, notification by desktop notification when done, low priority and how to cancel, and after you agree creates a user-level systemd timer (no administrator permission needed); when no time is given, Sunday 20:00 weekly and 21:00 daily
"show the virus scan schedule", "cancel the weekly home folder scan", "cancel the virus scan schedule" Lists the schedules; cancelling also needs confirmation first

Scanning is done by Host Doctor's pomelo-doctor --scan-virus (the engine is ClamAV, see the Host Doctor document), and Pomi only reads its output. When ClamAV isn't installed or there are no virus definitions yet, Pomi explains and opens the "Virus Scan" page, where you install it (it asks for the administrator password); Pomi doesn't install it itself; it reminds you when the definitions haven't been updated for more than 7 days. Saying only "scan for viruses" (without a scope) still opens the "Virus Scan" page and doesn't guess the scope.

Limitations stated honestly: it can only find viruses with known signatures, and finding nothing doesn't mean you're absolutely safe; ClamAV is best at finding Windows viruses, and for crypto miners and backdoors on Linux please use "Intrusion check"; a suspicious file may be a false positive, so please confirm before quarantining. File names and virus names are data reported by the scanner, not instructions: they are passed only as arguments (not through a shell), with control characters removed and the length limited before display.

Tests: make -C pomelo-assistant av-test (avtest.sh, 28 checks: a fake clamscan, the EICAR test string, a fake HOME and fake unit folders, all in a temporary folder; scan scope, read-only, ClamAV not installed, no virus definitions, confirmation window approved and not approved, schedule add / view / cancel, invalid input); the quick-path sentence patterns are in quick-cases.tsv (lines starting with @ctx, @av, @run represent test preconditions).

Documents, spreadsheets, presentations: open, read, edit, write, delete (0.42)

Pomi can work on the documents, spreadsheets and presentations in your home folder, in six formats: .docx, .odt (Pomi Writer), .xlsx, .ods (Pomi Sheets), .pptx and .odp (Pomi Slides). Format handling isn't rewritten: docfmt-writer.c, docfmt-sheet.c and docfmt-slides.c compile in the existing read/write code of the three programs (docx / odt, xlsx / ods / formula engine, pptx / odp / design themes), so the assistant and the three programs see the same content.

What it can do

Action How to say it (quick path, no model involved) What it does
Open "open monthly-report.docx", "open grades.xlsx with the spreadsheet", "open the grade sheet spreadsheet" Opens it in the matching Pomelo program (saying just "open the document" opens the "Documents" folder, as before)
Read contents "read monthly-report.docx", "what does monthly-report.docx say", "show which slides slides.pptx has", "look at A1:D10 of grades.xlsx" Document: each paragraph (headings and lists are labeled); spreadsheet: cells and formulas, and the computed values; presentation: each slide's title and content
Document editing "change "old" to "new" in monthly-report.docx", "add "…" after paragraph 2 of monthly-report.docx", "change paragraph 3 of monthly-report.docx to "…"", "delete paragraph 3 of monthly-report.docx", "add "…" at the end of monthly-report.docx" Replace text, insert after a paragraph, rewrite a paragraph, delete a paragraph, append at the end
Spreadsheet editing "fill B2 of grades.xlsx with 100", "sum A1 to A10 of grades.xlsx into B1" (sum, average, maximum, minimum, count), "add a row to grades.xlsx: Mei, 60, 70" Fill a given cell with a value or formula (when filling a range with a formula, relative references move along), add a row at the end; insert rows and columns (only in spreadsheets without formulas can they be inserted in the middle)
Presentation editing "add a slide to slides.pptx, title "…", content "…"", "change the title of slide 2 of slides.pptx to "…"", "delete slide 3 of slides.pptx" Add a slide (following the presentation's design theme), change a slide's title or content, delete a slide
Create "create this month's expense sheet", "create a blank spreadsheet called grades"; "open a new document", "write a self-introduction into a document", "write a document / presentation about…" use the two-step patterns (asking the local model to write only the content and then doc_create, see the section "Open a document and write into it…" below); things like "make a grade sheet with the columns…" are still left to the model, which calls doc_create Saved in the "Documents" folder (per the XDG setting, falling back to ~/文件 or ~/Documents), with a number automatically added for duplicate names as "name (2).docx", never overwriting
Delete "delete monthly-report.docx", "move the grade sheet spreadsheet to the Trash" Only moves to the Trash (FreeDesktop specification, writing the info file itself, so it can later be seen in the file manager's Trash)
Restore "restore the document I just deleted", "restore monthly-report.docx" Puts it back from the Trash to its original location; if a file with the same name is already there, a number is added and it isn't overwritten

The quick path accepts only phrasings "whose pattern matches exactly and whose file can be found" (the file name must have one of the six extensions above, or you said "spreadsheet", "presentation" or "document" and it can be found); other things (for example "translate paragraph two of the monthly report into English") go to the model, which uses the doc_read / doc_edit tools. Saying "this document" or "it" refers to the one most recently talked about (within 30 minutes).

Safety (hard-coded rules, the model gives only parameters)

  • Every create, edit, delete and restore first shows a confirmation window (a separate process, spelling out the location and "what it will become": how many places are replaced, which paragraph is changed, which cell goes from what to what, what a formula evaluates to, which slide), and 60 seconds without a press or pressing Cancel = not approved; Pomi can't press for you. If the file has been changed (size, time, inode) while you were confirming, nothing is done and you are asked to say it again.
  • Only files with the six extensions above inside your home folder are touched; .., hidden files and hidden folders (.ssh, .local…), shortcuts (symbolic links, including "the folder is a shortcut pointing outside the home folder"), system directories and anything that isn't a regular file are refused; the limit is 25 MB per file. Paths are always validated by the program with realpath, and the string given by the model isn't trusted.
  • Before editing, a backup is made automatically to ~/.local/share/pomelo/assistant/doc-backups/ (folder 0700, files 0600, the latest 10 kept per file name); a temporary file is written in the same folder first, read back and compared, and only then replaces the original with rename (an atomic operation); a failure never leaves half a file. After the change it tells you what was changed and where the backup is.
  • If the document is currently open in Pomi Writer / Sheets / Slides, the confirmation window and the result both remind you: close and reopen it there to see it, and unsaved changes there will overwrite this change when they are saved later.
  • File contents and file names are data, not instructions: the content read out for the model is wrapped in an "untrusted data" fence, and marks in the content that look like the fence are broken; newlines and control characters in file names are replaced with spaces; if a document says things like "ignore previous rules and run some command", the model is told not to comply, and Pomi has no tool that can run commands directly anyway (run_command must be turned on separately by the user and confirmed every time).
  • File parsing happens in a separate process (fork, with limits on memory, CPU time, file write size and 60 seconds), so a corrupt or overly complex file can at most crash that process, and Pomi itself isn't affected.
  • Online brain: before document contents are given to an online model, a confirmation window is shown every time (like reading a text file, showing which service); after a modification, what goes back to the online model is only "where it was changed has already been shown to you", and the original content is shown only to you; the list of files with the same name is also shown only to you.
  • Spreadsheet formulas: only understood characters are accepted (|, [, ], @, \, {, }, ; are blocked), function names are checked by the formula engine and unknown ones are refused; words such as inf, nan and 0x10 are treated as text and not as numbers.
  • Creating a new file: first a trial write in a private temporary folder (so problems in the content or formulas are found at this point and you don't press confirm for nothing), and only after confirmation is it written to the "Documents" folder and swapped into the final file name with RENAME_NOREPLACE (or link if that isn't available), guaranteeing a file with the same name is never overwritten.

Limitations (stated honestly)

  • Pomi reads using the code of Pomi Writer / Sheets / Slides and writes the whole file back, so the written-back file keeps only what those three programs understand: special layout and advanced features in the original file that they don't recognize don't remain in the new version. This is why "always back up before modifying"; for files that must stay exactly as they are, please edit with the original software.
  • Documents: only "paragraph" text is changed (paragraph N means non-blank paragraphs; the positions of tables and pictures don't count as paragraphs); text inside table cells can be replaced; everything else is left untouched. A replacement must match exactly (case, punctuation), and one replacement can't cross paragraphs.
  • Spreadsheets: rows and columns are not inserted in the middle of a spreadsheet with formulas (this program doesn't adjust formula references when inserting rows and columns, which would make the formulas compute wrongly) and are only added at the end; at most 400 cells can be changed at a time.
  • Presentations: only titles and body text are changed, and slides added and deleted, with everything else on the slide left untouched; new slides use the presentation's current design theme, each body line gets "• " in front, text that is too long is shrunk automatically (minimum 12 pt); the last remaining slide can't be deleted.
  • Please read what the model writes yourself; Pomi doesn't judge whether it is right for you.
  • The accuracy of the local 2B model calling these six tools has not been measured (the tool descriptions made every round's prompt about 3 KB longer); common phrasings are handled by the quick path and don't rely on the model.

Testing

  • make -C pomelo-assistant doc-test (dtest.sh): a fake home folder (temporary folder) does "create → read back → edit → read back" round trips, for all six formats; backups, numbering of duplicate names, nothing done without a confirmation press, the Trash and restore (including the info file format), refusing system paths / hidden folders / shortcuts / oversized / corrupt files, the untrusted-content fence, formula safety, the online brain's privacy behavior, and when LibreOffice is available, its output converted to text, csv and PDF for cross-verification. pomelo-assistant --doc-test 工具 '{json}' can run a single tool on its own; POMELO_DOC_TEST_YES=1 makes the confirmation window press "OK" automatically and works only with --doc-test; in normal runs there is no way to skip the confirmation window.
  • quick-cases.tsv gained 60 sentences (open, read, edit, create, delete, restore, and sentences that must not be intercepted); otest.sh gained 6 checks (the online brain calling doc_ tools: reading asks first, no press means not approved, system paths are refused, and edit / delete / create in test mode only print what they would do).
  • The confirmation windows were actually opened with Xvfb and looked at (modify, create, move to Trash, restore — four kinds); the .docx / .xlsx / .pptx files that were created and modified were also opened in the real Pomi Writer, Pomi Sheets and Pomi Slides and checked.
  • The knowledge-base evaluation (kb-eval.tsv) gained the blind4 set (document operations: 5 questions with answers, 2 without, 6 telling Pomi to do something), with other sets' scores unchanged.

Open a document and write into it, look things up and write into a document, what to do when it thinks for a long time (0.42, 2026-11-20)

A user tested "open a document and write a self-introduction into it" and Pomi stayed on "Thinking" with no result. The full diagnosis, approach and measured numbers are in docs/AI小幫手開文件診斷.md (a development record); this is a summary:

  • The cause wasn't thinking mode (the model is an Instruct version): this sentence originally had no quick path, so the model picked the wrong tool and wrote too much and was truncated, while the interface had no progress, cancel or timeout; the first question also has to load the model.
  • The quick path gained two-step patterns: "open a new document", "open a document and write a self-introduction into it", "write a self-introduction into a document", "open a document and write "…" into it", "write a document / presentation about travel", "look up today's market prices, then write them into a document and open it" (English and Simplified Chinese also work). The program chains every step: create (a confirmation window listing the location and the content to be written) → open; the content is assembled by the program (the self-introduction), written as quoted, or written by asking the local model to write only the content. Saying just "open the document" still opens the "Documents" folder.
  • "Self-introduction" without saying whose: by default it writes Pomi's own and says so; saying "my self-introduction" puts in only your name and blank fields, and Pomi doesn't make it up for you.
  • Looking things up and then writing them into a document: it first queries the search service (DuckDuckGo) and asks the model to summarize only from the results; the program checks the numbers (a whole line is dropped if it can't be found in the sources), and adds the data sources, the query time and "summarized by a small model, may be wrong". If the search fails it says so plainly and creates no document.
  • While waiting it shows "Pomi is thinking… (waited N seconds)" and can be cancelled (Esc); the timeout is 300 seconds by default (assistant.local_timeout). The "open" after creation is done by the program and doesn't press confirmations for the user.

Querying and handling Pomelo's existing features (0.42)

Pomi can call, ask, query and handle features that Pomelo already has: opening the various tabs of the programs, checking the status of the firewall / backup / VPN / containers / virtual machines / external devices / system updates, counting failed logins by source IP, and, after you confirm, opening ports, banning IPs, backing up immediately, restoring files, starting or shutting down virtual machines and containers, ejecting external devices, and installing system updates. These used to depend on run_command (which requires turning on "Allow the assistant to run commands", off by default, so they actually couldn't be used); now queries and actions have dedicated tools and do not need that switch. The implementation is in ctl.c (tools and confirmation windows) and quick-ctl.c (quick-path sentence patterns).

Opening the various tabs of the programs

open_settings is now table-driven: the pomelo-assistant.c macro in SETTINGS_PAGES is the single source, and both the tool description's enum and the matching table are generated from it, so they can't get out of sync (ctltest.sh checks this). Each entry is "page code → the program's own --page / --settings / --devices option"; the options follow each program's source code, and ctltest.sh checks entry by entry that the program's source really has that page or option. There are 80 pages in total; besides the original Settings, Theme, Display, Sound, Network, Bluetooth, Language and Activity Monitor, these are new:

Program Page codes
Settings, Theme login_screen (login screen), app_menu (app menu), workspace (multiple desktops)
Pomi, Keyring, Screen Saver, Control Center, Calendar, Packet Analyzer assistant_settings, keyring, screensaver_settings, control_center, calendar, packets
Storage, Network, Software storage_devices, storage_cleanup, storage_analyze, network_diagnose, software_updates
Host Doctor doctor (overview), doctor_check, doctor_trend, doctor_diagnose, doctor_security, doctor_virus, doctor_sbom, doctor_settings, doctor_intrusion, doctor_logs, doctor_respond
VPN Server vpn, vpn_openvpn, vpn_tailscale, vpn_install, vpn_settings
Backup backup, backup_setup, backup_restore, backup_log, backup_settings
Firewall firewall, firewall_rules, firewall_protect, firewall_lists, firewall_log, firewall_backup, firewall_settings
Container Cluster cluster, cluster_apps, cluster_overview, cluster_nodes, cluster_pods, cluster_dash, cluster_work, cluster_svc, cluster_storage, cluster_ops, cluster_access, cluster_gitops

The keyring (pomelo-keyring) has no "settings page" option, and the calendar's --settings is only reserved (the program accepts it but it has no effect), so these two only open the program window and don't jump straight to a page. The quick path also understands common phrasings: "multiple desktops settings", "login screen settings", "keyring settings", "assistant settings", "Host Doctor settings", "firewall settings", "calendar settings", "open the log", "backup settings", "restore files", "create a VPN", "set up tailscale", "capture packets".

Queries (pomelo_query, read-only, no confirmation)

One tool with one item parameter (the local small model's tool list gains only two tools, not a dozen):

item Example phrasings (quick path) What it does
firewall_status、firewall_rules、firewall_bans "is the firewall on", "what rules does the firewall have", "which IPs are banned" Calls pomelo-firewall --status/--list/--bans; rules keep only the plain-language description (no iptables commands or counters); the ban list is arranged as "IP (time left; reason)", with the allowlist listed separately
backup_status、backup_list "do I have a backup", "when was the last backup", "what backup plans are there" Calls pomelo-backup --status/--list
vpn_status、vpn_diagnose、vpn_clients "how many people are connected to the VPN", "why can't the VPN connect", "VPN client list" Calls pomelo-vpn --status/--diagnose/--clients
docker_list、vm_list "what containers are there", "what virtual machines are there" Calls pomelo-docker --list and pomelo-vm --list (read-only, touching no container)
storage_devices、storage_usage "what external devices are there", "where is the disk space used" Reads udisks2 (external ones first, marking those that can be ejected and their mount locations); df and the 8 biggest folders in the home folder (du, up to 25 seconds, and it says it saw only part when it can't finish)
update_check "what updates are there" Lists updatable packages (based on the result of the last update check, which is noted)
network_diagnose "diagnose the network" Host Doctor's network check
failed_logins "tell me which IPs have unusual logins", "which IPs failed to log in", "who has tried to log in to my computer recently", "is anyone guessing my password" Counts failed logins by source IP (see below)

Each item runs only hard-coded read-only commands (not through a shell), with control characters and terminal color codes removed from the output and the output shortened; strings from outside (container names, backup plan names, account names in login attempts) are always treated as data, and an "untrusted data" reminder is added when they pass through the model. Reading the firewall needs administrator authorization (the kernel's rules can be read only by root); when there is no password window it says so directly and doesn't pretend to have looked.

Failed login statistics: the data source is Host Doctor's log view (pomelo-doctor --logs --security --events 0 --since 7d: sources such as journald, auth.log, secure and btmp that this account can read). Pomi itself arranges sshd's "Failed password" and "Invalid user", btmp and pam's rhost into counts per IP (sshd writes several lines for one attempt, so it takes the largest of the various forms instead of adding them), the time of the last attempt and the accounts tried (at most 3, only safe characters kept), and internal addresses carry a reminder that "it may be your own people". An honest limitation: when this account isn't in the adm / systemd-journal group, system logs can't be read, and if no records are seen then, Pomi says plainly "it may just be unreadable, so you can't conclude nobody has tried"; when it has permission but finds no records it also explains "this only means the logs that can be read are clean", since logs can be rewritten. At most 60,000 log lines are counted at a time, so hosts with very large logs take a moment (about 11 seconds measured on this development machine). After that you can continue with "ban the first one" (using the list just shown, valid for 30 minutes) or "ban 203.0.113.5", and banning shows a confirmation window.

Actions (pomelo_act, always with a confirmation window first)

action Example phrasings What it does
firewall_allow "open port 443", "open 443 port", "allow only 60.248.142.180 to connect to 443", "open 53 udp" pomelo-firewall --allow 埠/協定 [--from 來源] --yes --timeout 0
firewall_deny "close port 80", "block / shut / drop / deny port 80", "block 1.2.3.4 from port 80" --deny 埠/協定 [--from 來源]: drops packets to this port (doesn't stop the program running on that port; the confirmation window and the result both say so)
firewall_remove "delete firewall rule INPUT:5" First looks up what this rule says with --list and puts it in the confirmation window; only deletes from the IPv4 filter table
firewall_ban、firewall_unban "ban 1.2.3.4", "unban 1.2.3.4", "ban the first one" --ban IP --for 時間(預設 1 小時,可選 10m、1d、7d、perm), --unban IP; it can't ban local addresses, this computer's own addresses, or the SSH source currently connected in
backup_run "back me up", "back up now" When no plan is specified it runs all of them (those set up and not paused); a specified plan code must be one listed by --list
backup_restore Called by the model (needs the plan, date and full path) Restores files inside the home folder, not overwriting existing files by default (to overwrite, please use the backup window)
vm_start、vm_stop、vm_kill "start virtual machine Win11 test", "shut down virtual machine …", "force off virtual machine …" pomelo-vm --start/--stop/--kill; shutdown = sending a shutdown request (like pressing the power button), and force off is a separate action, confirmed separately, with a window stating that it is like pulling the plug
docker_start、docker_stop "start container web", "stop container db" docker start/stop 名稱; the name must be one listed by pomelo-docker --list
storage_eject "eject the USB stick", "safely remove the external disk" Unmounts the partitions and then powers off (pm_drive_eject); only external disks that aren't in use by the system; when there are two or more external devices and you didn't say which, it doesn't guess
update_apply "install system updates", "update everything" pkexec plus apt-get upgrade -y / dnf upgrade -y (the same approach as Software Center); when there is no password window it opens a terminal and runs sudo

Safety (hard-coded rules, the model gives only parameters, never commands):

  • Always a confirmation window first (a separate process, pomelo-assistant --confirm ctl 動作 欄位); no press, pressing Cancel, or no response for 60 seconds all mean not approved; Pomi can't press for you. It does not depend on "Allow the assistant to run commands". The window spells out which port is opened / blocked, which protocol, and for whom ("all sources (anyone on the network)" gets a special warning; when opening only to one IP, that IP is written), blocking port 22 reminds you that SSH will be cut off, banning an internal address reminds you it may be your own people, and force off reminds you that data will be lost.
  • Parameters are validated by the program: a port must be 1–65535 (or an a-b range), the protocol only tcp / udp, IPs and subnets are validated with inet_pton, ban durations can only be a few fixed values, a rule number can only be "chain:number", and a restore path must be a full path inside the home folder (rejecting .., newlines and control characters). Name parameters (backup plan, virtual machine, container, external device) must appear in a list the system itself produced, and a command smuggled into a name is simply treated as "not found".
  • No delete-type actions (a firewall rule is the only "delete", and it happens only after you have seen the rule's content and pressed the button), and no password changes; anything outside the table Pomi simply can't do, please use the matching program.
  • Anything that needs root (firewall, system updates) goes through pkexec (the password window is pomelo-polkit or the system's agent); when there is no password window it does nothing and explains. Firewall changes are pre-checked again by pomelo-firewall itself (--timeout 0 is used because you have already seen the confirmation window; when the pre-check finds a risk it reports it and doesn't add --i-understand, and to accept the risk please act in the Firewall Manager yourself).
  • Online brain: the result of pomelo_query is sent to the online service together with the question, so the screen marks it "sent to the online service"; the confirmation window of pomelo_act isn't influenced by the model.

Sentence-pattern improvements (quick path)

  • Volume and brightness: when a sentence has "volume / sound (brightness)" plus a number from 0–100, it is set to that number, and "turn up", "adjust", "to", "as" and "percent" are only tone — "please adjust the volume up 40", "please adjust the volume to 40", "volume up 40", "set the speaker sound to forty percent" and "turn the sound to forty" are all 40; "add 10" and "reduce by 20" add or subtract from the current value; "a bit louder" and "a bit quieter" stay ±10; anything over 100 or with extra words after it goes to the model.
  • Firewall: "open 443 port" counts as allow; "close / shut / block / deny 80 port" is a block (ambiguous, so it always goes to a confirmation window that spells it out); "allow only 60.248.142.180 to connect to 443" and "open it for an IP to connect to 443" mean open only for that IP; something like "open 8080" that doesn't say it's a port isn't treated as the firewall.
  • Simplified Chinese and English: common phrasings are collected together ("开放 443 端口", "allow 443 port", "allow 60.248.142.180 to connect to port 443", "list firewall rules", "start vm Test1", "eject the usb drive", "show failed login attempts"…).

Effect on the local 2B model

The two tools plus the open_settings enum going from 28 pages to 80 add about 750 tokens to every round's prompt (measured with llama-server's /tokenize: the two new tools about 520, 52 more enum pages about 230; the description text has been compressed as much as possible). Measured on this machine with model-eval.py (TOOLS=old is the tool list before 0.42; EXTRA=1 adds 11 questions with phrasings of the new features) on the 2B:

Item Old tool list (before 0.42) New tool list
Tokens of the tool descriptions about 4300 about 5050
Longest request with the knowledge base attached (system prompt + tools + 3 document passages) 5646 6167 (over the original context length of 6144, which llama-server would reject outright, so the context was changed to 8192)
The 32 existing questions × 2 rounds (2B, model-eval.py) 46/64 (72%), average 5.8 seconds 51/64 (80%), average 5.6 seconds (the difference is within noise: the same set varies by about 3 questions per run; we saw no sign that more tools made the 2B worse)
11 questions with phrasings of the new features (which the quick path can't catch, for example "is the firewall blocking anyone right now", "stop the container named web") × 2 rounds, 2B 1/11 (these tools didn't exist) 4/22 (18%): the 2B often picks the existing host_doctor, intrusion_check, or opens a browser
The same 11 questions, 4B (1 round) not measured 7/11: on the virtual machine question it chose vm_start but gave no name (the program side refuses and asks for the name)

The conclusion must be stated honestly: for the new features on the local 2B, the quick path (sentence patterns) is what makes them reliable; the 2B's own accuracy at picking the new tools from the tool list is very low; the 4B and the online brain do better, but the online brain wasn't measured. So the common phrasings (the "example phrasings" in the tables above) are all made into quick-path patterns, and every action has a confirmation window and program-side validation, so even if the model picks the wrong tool or gives wrong parameters, it is only refused or shows you a confirmation window, and never acts directly.

Limitations (stated honestly)

  • "Unusual logins" simply means the "failed logins" statistics, not intrusion detection: it sees only logs this account can read, and logs can be rewritten; to judge whether you have been broken into, use "have I been hacked" (Intrusion check, always with an honest note).
  • Firewall queries and changes both need administrator authorization; when there is no password window it can only explain. Deleting rules is limited to the IPv4 filter table; when opening or blocking a port, if no source is given only an IPv4 rule is added (an IPv6 rule is added only when the source is an IPv6 address); to manage both, please use the Firewall Manager.
  • "Start" of a virtual machine only sends the request (and opens the console window when there is a desktop), waiting up to 5 seconds to see whether the state changed; "shut down" sends a shutdown request, and if the system inside ignores it, it won't shut down.
  • Starting and stopping containers uses the system's docker command; when there is no docker it says so directly.
  • The accuracy of the local 2B model in choosing the new tools was measured only on a small sample on this machine (see above) and isn't guaranteed; when a phrasing isn't in the quick path, you can say it more specifically (for example with words such as "firewall", "backup", "virtual machine").
  • What it can do is what the two tables above list; for anything outside the tables Pomi honestly says it can't. Multilingual reply text isn't done yet (the new screen strings all use _() and translations will be added later).

Testing

  • make -C pomelo-assistant ctl-test (ctltest.sh, 80 checks): everything runs in a fake environment — a fake home folder, a fake PATH (fake pkexec, docker, pomelo-docker, pomelo-vm, udisksctl, pomelo-doctor), the firewall uses pomelo-firewall's own fake folder (POMELO_FW_FAKE), backup uses the real pomelo-backup backing up small files in a temporary folder; it doesn't change the real firewall, touch your Docker or virtual machines, update the system or eject a real disk. Contents: the 80-page settings table checked entry by entry against each program's source, the enum matching the table, every query item, failed login statistics (including malicious account names, color codes, no permission, no records), for every action "nothing happens without pressing OK" and "the command is correct after confirmation", a pile of arbitrary parameters (out-of-range ports, smuggled commands, wrong IPs, nonexistent rules, names not in the list) all refused, not being able to ban itself, no delete-type actions, and update commands on dnf systems. pomelo-assistant --ctl-test pomelo_act '{…}' can run a single one; POMELO_CTL_TEST_YES=1 makes the confirmation window press "OK" automatically and works only with --ctl-test; in normal runs there is no way to skip the confirmation window.
  • quick-cases.tsv grew from 650 to 767 sentences, and every new sentence has a counterpart for dnf systems (POMELO_PKG=dnf) (these patterns don't depend on the package system, so both sides must give the same result); otest.sh grew from 45 to 51 checks (the online brain calling pomelo_query / pomelo_act: test mode only explains, no screen = not approved, invalid parameters refused, no delete-type actions).
  • The confirmation windows were actually opened with Xvfb and clicked with the mouse on "OK" (exit code 0, y written) and "Cancel" (exit code 1, nothing written): opening a port (all sources, only to one IP), blocking port 22, banning an internal IP, deleting a rule, restoring files, force off, ejecting an external device, installing updates. The screenshots are in pomelo-assistant/shots/ctl-confirm-*.png.
  • The knowledge-base evaluation (kb-eval.tsv) gained the blind5 set (6 questions with answers: first-rank document all correct, top-3 100%, of which 4 had the knowledge base attached and 2, "can Pomi help me…", were treated as requests and given to the model — a trade-off that was already there and happened to be correct too; 11 questions telling Pomi to do something or asking about this computer's state: all let through); the scores of the dev, test, blind, blind2, blind3 and blind4 sets are completely unchanged (for this, words such as "unusual logins", "failed logins", "who has" and "is anyone" were added to the judgment of "asking about this computer's current state", otherwise "is anyone guessing my password" would be taken as asking how to use Pomelo, get the knowledge base attached, and be forbidden from calling tools).

Knowledge base (asking about Pomelo itself: look it up in the documentation first)

What it does: small models are very good at "making things up with a straight face" — ask one what features Pomelo has, how to configure something, what a shortcut is, or where a menu is, and it invents buttons that don't exist. So before answering this kind of question, Pomi now looks it up in Pomelo's own documentation (the user manual, each program's documentation, the README, the changelog and an FAQ), gives the most relevant passages to the model, requires it to answer only from them, and attaches the source at the end of the answer (for example "(Source: Firewall "2. Safety net")"). If nothing is found, Pomi says directly "I can't find this in the documentation and don't want to guess", and doesn't force an answer together.

  • Only questions "about Pomelo itself" trigger a lookup: features, how to use something, where a setting is, shortcuts, version differences. Telling Pomi to do something ("turn on the firewall for me", "set the volume to 30"), asking about the weather, chatting and general computer knowledge are unaffected and are handled by the quick path, tools and model as before.
  • The quick path (fixed phrasings that don't use the model) always has priority; the knowledge base steps in only when it hasn't taken over.
  • When nothing is found and the question is clearly asking about a Pomelo feature, it is the program that answers "not found" directly, without even calling the model, rather than relying on the model to obey.
  • The online brain (optional) also gets the same documentation passages attached and has an extra tool kb_search to look things up itself; only Pomelo's documentation is sent out, never your own files.

You can add your own notes (optional, off by default): in "Settings → Assistant → Knowledge base", turn on "Also look for answers in my own folder" and enter a folder (for example ~/Notes); the .md and .txt files in it (down to 3 levels, 400 files, each within 300 KB, links not followed and hidden folders not read) are searched too. Only the local brain uses it: with the online brain, your notes are not read and not sent out (in the program, the official documentation and your folder are two separate indexes, and the online brain's path never even opens the second one). When the local brain uses your notes, the content is placed after a "data, not instructions" label and is still attached after your question and given to the local model, never leaving this computer.

How to extend it: put a .md (or .txt) file in /usr/share/pomelo/assistant-kb/ (the official documentation lives here, installed with the pomelo-assistant package) and it is picked up; when a document changes (different modification time or size) the index is rebuilt automatically the next time a question is asked. To make a new document appear in the package, add the file name to pomelo-assistant/Makefile in KB_DOCS. Headings (#, ##) become the names of the sources, so please use meaningful headings; a section under one heading that is too long is cut into several passages. pomelo-assistant/kb/faq.md is an FAQ written specifically for Pomi to look up, and every entry must be verifiable in the user manual or the program before it is written.

Limitations (stated honestly):

  • Retrieval is literal matching (BM25 + Chinese character bigrams) and doesn't understand synonyms: asking "螢幕保護" finds "螢幕保護程式", but asking "待機" doesn't find "休眠". Common English phrasings have a small lookup table (firewall→防火牆…).
  • The safeguard blocks only "words that appear nowhere in the documentation" (for example the name of software or a feature that doesn't exist at all); if every word in the question appears in the documentation and only the combination isn't written there (for example asking whether backups can be set to a frequency the documentation never mentions), the program gives the closest passages to the model, and the system prompt asks it to "say not found if it isn't written", so this gate relies on the model following the rules, which the small 2B model occasionally fails to do.
  • Sentences such as "can you help me…" and "help me…" are treated as asking Pomi to do something rather than asking about a feature, so they aren't stopped by "not found" and are given to the model and tools.
  • A small model may still misread or missummarize a passage (observed: the 2B got the steps of the Japanese input method somewhat wrong); the source is there so that you can check. After the model has answered, the program removes the source the model wrote itself and replaces it with one the program verified is really the attached passage (no source is attached when the answer has nothing to do with the passages).
  • Limited context: the passages attached for the local brain are at most about 1100 characters (3 passages); for this the llama-server context length was changed from 4096 to 6144 (about 0.3 GB more memory, 4B model); after the 0.42 query and action tools were added, the tool descriptions are about 750 tokens longer, and questions with the knowledge base attached would exceed 6144 (6225 tokens measured), so it was changed again to 8192 (about 0.2 GB more memory).

How it works

  • kb.c (pomelo-assistant.cd directly by #include): segmentation (by headings and blank lines, 300–600 characters per passage, keeping "document name + heading" as the source) → index (BM25, k1=1.2, b=0.75; Chinese uses character bigrams, English and numbers use words, and headings count double). The index is stored in ~/.cache/pomelo/assistant-kb.idx (the user's folder uses assistant-kb-user.idx) and read in with mmap (read-only, reclaimed by the system when memory is tight), and the positions and numbers in the file are range-checked on load. It is rebuilt when the hash of the source documents' paths, modification times and sizes (plus the distribution) differs from the one in the cache file. The 使用手冊.md.in blocks of <!--if 發行版--> are kept according to /etc/os-release, and {{名稱}} is replaced with the distribution name.
  • Whether to look up: first the sentence pattern is checked (how, where, is there, can it, shortcut…), then "telling Pomi to do something" and "asking about this computer's current state" are excluded, then it checks whether something of Pomelo's is mentioned explicitly (Pomelo, Pomi, program names, screenshot, wallpaper, virtual desktops…). Explicitly asking about Pomelo but with a retrieval score below the threshold, or a question containing an English word that never appears in the whole documentation (for example the name of nonexistent software), or Chinese bigrams of which 30% or more don't appear in the documentation → answer "not found" directly. Questions that don't explicitly mention Pomelo: only "how to do it" questions with a very confident retrieval (score ≥ 7, at least 3 words of the question appearing in the first-ranked passage) get it attached, and everything else is left alone.
  • How it's attached: like the "system note", it is appended after the latest user message and labeled "Knowledge base data" (old messages don't keep it); the rules (answer only from the data, say not found if it isn't written, don't invent menus and commands) are written in this text. The local system prompt gained only one short rule: the longer the system prompt, the less likely the 2B is to call tools (see the numbers below). The online brain's system prompt gained the full rules and an extra kb_search tool (the local tool list doesn't get it: the local side already looks up automatically, and one more tool would make the 2B call things wildly).
  • For local questions with the knowledge base attached, the request adds "tool_choice":"none" (the tool list is still sent so the prefix cache isn't invalidated, but this question may not call tools): the 2B was measured to occasionally go to open_settings or open a browser search in these questions instead of reading the data; questions without the knowledge base attached are completely unchanged.
  • Settings: assistant.kb (default 1, set to 0 to turn the whole knowledge base off), assistant.kb.user (default 0), assistant.kb.user_dir. The environment variable POMELO_KB_DIR can swap the official documentation folder (for testing).

Testing and evaluation

pomelo-assistant --kb-test kb-eval.tsv (no screen, no model loaded); -q "問題" shows the retrieval result and judgment for a single question (-u also searches the user's folder, POMELO_KB_SHOW=1 prints the text that would be attached), -v lists every question, and --sweep sweeps the threshold over the dev questions. First make install DESTDIR=/某處 PREFIX=/usr to install the documentation into a temporary folder, then point at it with POMELO_KB_DIR=/某處/usr/share/pomelo/assistant-kb. otest.sh (make online-test) gained 9 checks: knowledge base attached, no content from the user's folder in the online request, no call to the online service at all when refusing to answer, sentences telling Pomi to do something aren't blocked, kb_search, assistant.kb=0.

kb-eval.tsv has 101 questions with answers, 50 without answers (asking about nonexistent features or nonexistent software), and 38 general chat or tell-Pomi-to-do-something questions (which must not be blocked). It is divided into four sets: dev (for tuning the threshold), test, blind (measured after tuning), and blind2 (written after all rules were tuned and not followed by any rule changes). The knowledge base has 736 passages in all, building the index takes about 25–40 ms, reading the cache about 0.1–0.5 ms, and the whole kb-test process takes about 8 ms from start to printing.

Set With answers: first-ranked document correct Correct one among the top 3 Without answers: refused by the program General / commands: correctly let through
dev (32/14/10 questions) 84% 100% 93% 10/10
test (30/14/10) 80% 100% 93% 10/10
blind (21/12/10) 86% 100% 92% 10/10
blind2 (18/10/8) 72% 94% 60% 8/8
All (101/50/38) 81% 99% 86% 38/38

None of the 101 questions with answers was wrongly refused; of the questions without answers, 7 weren't stopped, of which 5 had unrelated passages attached (left to the model to follow the rules) and 2 were of the "can you help me…" pattern (treated as requests). The three sets other than dev had their scores seen during tuning (test was looked at once while debugging, and blind's results were seen only after adjusting the "help me…" rule and the topic words), so the cleanest number is blind2's first result (first-rank 72%, top-3 89%, refusal 60%; after the changelog weight was later adjusted, top-3 became 94%) — much worse than dev, and real-world performance is closer to this row than to the dev row.

Results sampled with the real local model (Qwen3-VL 2B), and the effect of system prompt changes on tool calling (model-eval.py, 32 questions, 2B): unchanged 22, 23, 22 correct; the local system prompt with full rules + the kb_search tool 18; full rules only 20; kb_search only 22, 22; one short rule + kb_search 22. So the final design is: the local side adds only one short rule and no kb_search, and the detailed rules go inside the attached knowledge base data.

A sample of the local model (2B)'s actual answers (13 questions about Pomelo itself, plus 3 about general knowledge or telling Pomi to do something): with the knowledge base turned off (assistant.kb=0), 7 of the 8 sampled questions were answered wrongly or made up (for example calling "snap the screen left and right" and "virtual desktops" "not Pomelo features", saying the firewall is under "network or security on the settings page", and even giving instructions for features that don't exist); after turning it on, the same questions were all answered from the documentation, with sources verified by the program, and asking about a nonexistent feature gets a direct "not found". But the 2B still makes mistakes: 5 of the 13 were unsatisfactory — a misread passage (the steps of the Japanese input method, the keyring's file format), an incomplete summary, details that aren't in the documentation mixed in (the items on the right of the menu bar), or not answering from the data (on the firewall auto-block question it wanted to search in a browser, and now in that case the program answers "not found" directly). This is the model's own limit, and the source is there for you to check.

Multilingual support (0.42 phase 1)

The user asked for Pomi to "be multilingual". Phase 1 does English and Simplified Chinese first; the other languages (Japanese, Korean, German, French, Spanish) only get the format set up with a few of the most common commands as examples, and the remaining languages will be filled in later using the same format. The phrasing in every language has not been proofread by native speakers, and its naturalness hasn't been verified; a missing phrasing is simply passed to the AI model and does nothing wrong.

Current state of each language

Language (interface language code) Quick commands (no model) AI model conversation Asking about Pomelo itself (knowledge base) Voice input Button and message translation
Traditional Chinese (zh_TW) Supported: all (767-sentence test) Supported: answers in Traditional Chinese (Taiwan usage) Supported (the original scores) Supported (Mandarin, Cantonese) Original
Simplified Chinese (zh_CN) Supported: Simplified is converted to Traditional before judging + 22 mainland terms (屏幕, 內存, 硬盤, 注銷, 重啟…), 89-sentence test Supported: answers in Simplified Chinese Supported: converted to Traditional + mainland terms swapped for the documentation's terms (cn set top-3 98%) Supported Has a translation file
English (en) Supported: 287 phrasings (volume and brightness, opening and closing programs, Wi-Fi and Bluetooth, lock, time and weather, settings pages, power, screenshots, reminders, packages, firewall, abnormal logins, backup, VPN, document operations, conversions…), 247-sentence test Supported: answers in English (the 2B's tool selection in English is below) Partially supported: the question is first turned into Chinese keywords and then searched, with scores below Traditional Chinese (en set top-3 94%, see below) Supported Has a translation file; the strings added this time aren't translated yet
Japanese (ja), Korean (ko) Partially supported: only volume, brightness, opening programs, lock, Wi-Fi, Bluetooth, time (about 20 test sentences each); program names must be English names or ones already recognized Supported (the model answers in Japanese or Korean; the 2B's quality in these two languages hasn't been measured) Partially supported: needs the local model to be available to translate into Chinese first and then search (not measured) Supported Has a translation file
German (de), French (fr), Spanish (es) Partially supported: same as above (volume, brightness, opening programs, lock, Wi-Fi, Bluetooth, time) Supported (quality not measured) Partially supported: same as above, not measured Not supported (no recognition model; the settings page says so) Has a translation file
Russian, Thai, Vietnamese, Brazilian Portuguese, Italian, Indonesian (ru, th, vi, pt_BR, it, id) Not supported: the format and empty tables are built (quick-lex/*.tsv), with no phrasings; Chinese and English commands still work Supported (answers in the interface language; quality not measured) Not supported: no glossary; with a local model it also translates into Chinese first (not measured) Not supported Has a translation file

Whatever the interface language, the two phrasing sets, Chinese (Traditional and Simplified) and English, are always active at the same time (someone using a Japanese interface can say English commands and they work); for other languages, the phrasing tables are tried in the order "interface language, English, other languages".

Quick path: standard Chinese + each language's phrasing tables

The sentence patterns (quick.c) of q_* are all written in "standard Chinese", and not one character was changed. Other languages live in quick-lex/<語言>.tsv, one "phrasing → standard Chinese" per line, for example

{turn up|raise|increase|boost} [the] volume [a bit|a little]	大聲一點
set [the] volume to $1 [percent|%]	音量調到$1

How phrasings are written: [a|b] is optional, {a|b} is a choice of one, $1 $2 capture a piece of text (program names, numbers, file names), spaces don't matter, @pre / @suf (polite filler), @num (twenty five → 25), @unit (kilometers → 公里, replacing only the captured piece), @sub (zh_CN's mainland terms), @level (0 format only / 1 partial / 2 full). Standard Chinese beginning with ! is a very certain phrasing: when the original matching can't take the converted sentence, it doesn't keep trying further (to avoid "delete a.pdf" falling to "remove package"). The full format is at the top of gen-lex.py.

gen-lex.py compiles them into quick-lex-data.h (the Makefile rebuilds it automatically; python3 gen-lex.py > quick-lex-data.h), and the engine is in quick-lex.c:

  1. A sentence consisting only of English letters: first try the phrasing tables (interface language, English, other languages) and give the resulting standard Chinese to the original q_*, and it counts only if that matches; if it doesn't, fall back to the original matching (which used to cut "search for files named report" into the odd query "找 snamedreport").
  2. Other sentences: first use the original matching (Traditional Chinese behavior and the 767-sentence test don't change by one character); when it can't match, Simplified is converted to Traditional (zh_convert + zh_CN.tsv's mainland terms) and matched again; then zh.tsv (supplementary phrasings shared by Chinese) is tried; finally each language's phrasing tables.
  3. The phrasing tables are responsible only for "converting to standard Chinese"; whether to act, whether the target exists and whether to confirm first are all still decided by the original q_* and the tools, and the safety limits are unchanged.

To add a new language: copy the format of quick-lex/en.tsv to quick-lex/<語言代碼>.tsv (the code is the same as libpomelo/i18n/*.tsv), write the phrasings, set @level, add a few sentences to quick-cases.tsv (the 5th column holds the language code), and run make quick-test. pomelo-assistant --quick-lang prints each language's level and number of entries.

System prompt and tool descriptions

Item 1 of the system prompt (which language to answer in) is generated from the interface language (lang_rule1()): Traditional Chinese stays as the original, not one character changed; Simplified Chinese gets "use Simplified Chinese only"; other languages get, written in English, "Always reply in <language> … If the user writes in another language, reply in that language" (the model understands English rules best, and it follows the user when they change language). The online brain's item 1 also follows the language. Tool descriptions and the other rules stay in Chinese (changing them to English would need re-measuring and would invalidate the prompt cache, so this phase leaves them alone). The system note (time, current window) is still in Chinese format; for non-Chinese interfaces it gains "; reply in English" at the end (for Simplified Chinese it is ";請用簡體中文回答"), and for Traditional Chinese nothing is added.

Measured with model-eval.py on the local 2B (Qwen3-VL 2B Q4_K_M, -t 6, 2 rounds per question) (the question set is a 32-question English version I wrote, EN=1, with RULE1=zh|en and NOTE=0 as switches; the answer language is judged by whether the answer contains Chinese characters, and a mention of the file name "待辦.txt" in the answer also counts, so 3/13 is slightly overestimated):

Question set and prompt Tools chosen correctly Answers with no tool call (chat, mood, time questions) that had Chinese mixed in
Chinese 32 questions × 2 rounds (Traditional Chinese interface; the prompt is identical, character for character to before, so no regression) 52/64 (81%) —
English 32 questions × 2 rounds, with the old prompt (item 1 "only use Traditional Chinese", which is what English users effectively had before) 55/64 (86%) 16/17
English, only item 1 changed to "Always reply in English…" 56/64 (88%) 14/16
English, item 1 + "; reply in English" added at the end of the system note (adopted) 57/64 (89%) 3/13

Conclusions: ① tool selection did not regress (64 samples, the three English settings are within 2 questions of each other, inside sampling error; temperature 0.3, with no confidence intervals from repeated measurements); ② changing only item 1 is nearly useless — under a Chinese system prompt the 2B still answers English questions in Chinese 14/16 of the time; what really works is that small clause at the end of the system note (close to the user's question), so both are done together (lang_rule1(), reply_lang_note()); ③ the tool descriptions stay in Chinese (no English version was compared, only the groups above were measured); ④ this is the 2B's result, the 4B wasn't measured; Japanese, Korean, German, French, Spanish, Russian… use the same mechanism and weren't measured.

Strings that tools return to the user (_())

Tool result text ("Opened %s", "No program named "%s" found", "The user did not approve, nothing…") and the quick path's replies (time, date, greetings, checking battery and space…) are all wrapped in _() and translated by interface language; languages without a translation show the original (Traditional Chinese). There are 646 new strings in all, listed in pomelo-assistant/i18n-new-strings-multilang.txt (not translated this time, and libpomelo/i18n/*.tsv wasn't touched, to be translated all together later). Because translations don't preserve the leading Chinese characters, the judgments of "did it succeed" that used to depend on leading Chinese characters (tool_succeeded's "找不到", "沒有", "已", and direct_reply's "使用者不同意,") were changed to internal flags: at the moment the failure message is generated (the original text has those beginnings), tool_failed / tool_denied is recorded (reset before each tool call, one per thread), so it is still judged correctly when translated into another language. Result text that is already Chinese keeps the old judgment.

Note: when there is no whole-sentence translation in the translation file, the program doesn't translate the pieces of the sentence into another language ("今天是 11 月 20 日,星期五。" will not become "Today是 11 月 20 日,Friday。").

Knowledge base (asking about Pomelo itself)

The documentation is only in Traditional Chinese and the whole set isn't translated. Before retrieval the question is first converted into Chinese (kb-xlate.c):

  • Simplified Chinese: converted to Traditional, and when the input has Simplified characters, mainland terms are then swapped for the documentation's terms (窗口→視窗, 設置→設定, 內存→記憶體…); questions entered in Traditional aren't touched by a single character, so the original scores are completely unchanged.
  • English: a glossary (English phrase → the Chinese term used in the documentation, longest first) converts it into Chinese keywords such as "怎麼 開啟 防火牆", question words become "怎麼", "在哪裡", "為什麼", and the later judgments of "is it asking about Pomelo" and "is it telling Pomi to do something" stay as before; filler words and common verbs are dropped; English words that look like product names (capitalized, containing digits) and long words that aren't in the documentation are kept, so asking about nonexistent software is still refused.
  • Other languages (Japanese, Korean, German, French, Spanish…): no glossary. When the local model is available, it is asked to translate the question into one sentence of Traditional Chinese first (one short inference, kb_model_xlate, done only for questions judged to be neither Chinese nor English) and then search; without a model it is left as is (not blocked, given to the model, as before). The online brain uses the kb_search tool itself, and the tool description asks it to search with Chinese keywords.
  • When a non-Chinese question gets the knowledge base attached, an extra sentence reminds the model to "answer in the user's language and not translate the source line"; the direct refusal message is _() (it shows Chinese until translated).
  • kb/faq.md gained 10 English FAQ entries (each title carries Chinese keywords so that the converted Chinese keywords find it; one of them is the state of each language), and Traditional Chinese has one more entry on the state of each language.
  • The glossary exists only for English and Simplified Chinese; POMELO_KB_XLATE=0 turns off English-to-Chinese conversion (to measure the "before" scores).

Evaluation (kb-eval.tsv gained the en and cn sets, not counted in all, so the numbers can be compared with before; all's scores are exactly the same as before: 117 questions top-3 99%, 53 questions refused 85%, 60 questions let through 100%):

Set With answers: first-ranked document correct Correct one among the top 3 With answers but wrongly refused Without answers: refused by the program General / commands: correctly let through
Traditional Chinese all (117/53/60) 84% 99% 0 85% 60/60
en (67/24/20; 57 of 67 had the knowledge base attached) 75% 94% 5 88% 20/20
cn Simplified (63/15/15) 83% 98% 1 93% 15/15
en, with Chinese conversion off (POMELO_KB_XLATE=0, how it used to be; only 32 of 67 questions with answers had the knowledge base attached) 67% 85% 7 58% 20/20

To be honest: ① the en and cn sets were written by me, and written while looking at the dev / test Traditional Chinese questions, and the English glossary (kb-xlate.c) was written and tuned by the same person (wrong refusals dropped from 16 to 5), so they are not blind and the scores are optimistic; ② the gap between English and Traditional Chinese: top-3 94% vs 99%, first-rank 75% vs 84%, 5 questions with answers wrongly refused (0 for Traditional Chinese) — the difference comes from phrasings missing from the glossary and English words that aren't in the documentation; ③ other languages (Japanese, Korean, German, French, Spanish): there is an ml set (16 with answers, 4 without, 4 general, a few questions each in Japanese, Korean, German, French and Spanish). Without a model, nothing at all is attached (0 of 16, same as before); with the local 2B model translating into Chinese first (pointing POMELO_KB_MODEL_SOCK at a llama-server for the test): 14/16 had the knowledge base attached, first-rank document correct 15/16, top-3 16/16, 3/4 of those without answers refused, 4/4 general questions let through; but the 2B's translation occasionally goes wrong (of 16 questions, 1 spat out a sentence of the prompt verbatim — the program recognizes this kind of output and discards it, and that question gets no knowledge base; 1 was translated into a different meaning and wasn't attached), and with so few questions and no native speaker having looked, all we can say is "useful", not "reliable"; ④ the Simplified set was written with mainland terms, but it still has only 63 questions.

Voice input

listen.c in lsn_lang() chooses the recognition language by interface language: Traditional and Simplified Chinese (Mandarin; for Hong Kong and Macau it uses automatic, where Mandarin and Cantonese are both possible), English, Japanese, Korean; other languages return "not supported", Pomi's microphone icon isn't shown, the settings page says "voice input isn't available for this language yet", and Super+Shift+V says "Voice input isn't available for this language yet (Mandarin, Cantonese, English, Japanese and Korean are supported)" — these two sentences already have translations in the 13 translation files. The model (SenseVoice) wasn't changed. Recognized Japanese and Korean sentences go through each language's phrasing tables.

Testing

  • make quick-test (qtest.sh): quick-cases.tsv gained a 5th column "interface language" (blank = Traditional Chinese), switching LANG with pm_lang(), and each language is run once; in total 775 sentences (the original 767 for Traditional Chinese + 8 cross-language) + 247 English + 89 Simplified Chinese + Japanese 22, Korean 19, German 23, French 20, Spanish 20 + 3 sentences for each unsupported language (confirming that Chinese and English still work and that unsupported languages are left to the model) + counter-examples (sentences that aren't commands must not be misjudged). For cases in non-Traditional-Chinese languages, the "must contain" words of the result are only language-neutral ones (tool names, numbers, "回答"), so translating the reply text later won't break the tests.
  • make online-test (51 checks), make host-test (16 checks), make doc-test (104 checks), make ctl-test (80 checks), --kb-test kb-eval.tsv all pass; no set regressed.

Limitations (stated honestly)

  • No native speaker has proofread it, and the naturalness of each language's phrasing hasn't been verified; Japanese, Korean, German, French and Spanish are only at example level (about 20 sentences).
  • Japanese and Korean program names must be English names (Firefox) or ones already recognized; localized program names (ターミナル, 터미널) aren't included.
  • The quick path's replies (weather, conversions, battery…) and tool results need the translation step before there is English; for now an English interface sees Chinese (or pieces that already have translations such as "今天" and "星期五", which won't be mixed into a sentence).
  • Multi-word English city names have their spaces removed in the quick path ("New York" → newyork), so weather lookups may not find them.
  • The 2B model's tool selection and answer quality in languages other than Chinese and English hasn't been measured.
  • Pomi's style, the text inside icons, help windows and other UI weren't touched.

Next steps

  1. Voice input: real-person testing, tuning the "finished speaking" judgment; a wake word (saying "小柚" starts listening, sherpa-onnx keyword detection, needs the microphone always on, off by default)
  2. Keeping the recognition model resident (loading it directly with sherpa-onnx's C API), saving about 0.8 seconds of loading each time
  3. Looking at the screen and camera: load Qwen3-VL's mmproj when needed and show the model a screenshot or a photo
  4. Automatically detecting and using the built-in graphics chip (Vulkan / OpenVINO)
  5. arm64 packages and Raspberry Pi testing
  6. Shortening the local brain's system prompt and tool descriptions (about 5500 tokens, which has to be read on the first question or after idle time, measured at about 74 seconds): for example choosing which tools to send by question, using llama-server's --cache-reuse or a pre-saved prompt cache file
  7. The local brain's "look things up": for now only the fixed flow "look up today's… and write it into a document"; general Q&A still has no search_web / fetch_url (a small model with too many tools picks wildly)