From 502d0c85c7b5ef1aaff2a3359579b185af4905d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ryan4yin=20=7C=20=E4=BA=8C=E8=8A=B1?= Date: Mon, 5 Oct 2026 00:18:01 +0800 Subject: [PATCH] fix(preservation): keep vinput config and models across reboots (#381) Vinput stores its core config in ~/.config/vinput/config.json and its downloaded sherpa-onnx models in ~/.local/share/vinput/models/. Neither was bind-mounted from /persistent on the tmpfs-root hosts, so a reboot wiped both and vinput-daemon started with "Local ASR provider model is not configured". Persist both directories and document the one-shot CLI model setup in the vinput README. --- home/linux/gui/base/vinput/README.md | 40 ++++++++++++++++++++++------ hosts/idols-ai/preservation.nix | 7 +++++ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/home/linux/gui/base/vinput/README.md b/home/linux/gui/base/vinput/README.md index 54511349..8ee872b6 100644 --- a/home/linux/gui/base/vinput/README.md +++ b/home/linux/gui/base/vinput/README.md @@ -1,19 +1,43 @@ # Fcitx5 Vinput -On `ai` and `shoukei`, install a Sherpa-ONNX model in Vinput under **Resources → Models**, then -select it in **Control → ASR Providers**. Hold and release **right Alt** to dictate. **Right Shift** -toggles Chinese/English; **left Shift** remains a normal modifier. Open Vinput from the application -launcher for settings. +On `ai` and `shoukei`, install a Sherpa-ONNX model, then hold and release **right Alt** to dictate. +**Right Shift** toggles Chinese/English; **left Shift** remains a normal modifier. Open Vinput from +the application launcher for settings. -Models are stored in `~/.local/share/vinput/models/sherpa-onnx/`. Review their source and license -before installing. +## One-time setup (CLI) + +The GUI path is **Resources → Models** (download and activate), then **Control → ASR Providers**. +The equivalent non-interactive commands are: + +```sh +vinput model add onnx-xasr-zh-en-960ms-punct-stream # download (~130 MB, sha256-verified) +vinput model use onnx-xasr-zh-en-960ms-punct-stream # set as active model +systemctl --user restart vinput-daemon +``` + +`vinput model list -a` lists the available registry models. ## Backends - `shoukei` uses CPU. Leave the model's provider at its default. - `ai` uses OpenVINO when the model's `vinput-model.json` sets `"provider": "openvino"`; restart - `vinput-daemon` after changing it. The user needs the `render` group and a new login after - deployment. + `vinput-daemon` after changing it. One-shot enable: + + ```sh + f=~/.local/share/vinput/models/sherpa-onnx/x-asr-960ms-streaming-zipformer-transducer-zh-en-punct-int8/vinput-model.json + jq '.model.provider = "openvino"' "$f" | tee "$f.tmp" && mv "$f.tmp" "$f" + systemctl --user restart vinput-daemon + ``` + + The user needs the `render` group and a new login after deployment. + +## Persistence + +Models are stored in `~/.local/share/vinput/models/sherpa-onnx/` and the core config lives in +`~/.config/vinput/config.json`. Both directories are bind-mounted from `/persistent` on the +tmpfs-root hosts (see `hosts/idols-ai/preservation.nix`); without that they are wiped on every +reboot and the daemon logs `Local ASR provider model is not configured`. Review model source and +license before installing. **NPU execution status: unverified.** On `ai`, the OpenVINO runtime and NPU plugin load, the daemon opens `/dev/accel/accel0`, and the bundled WAV sample transcribes. However, the NPU busy-time diff --git a/hosts/idols-ai/preservation.nix b/hosts/idols-ai/preservation.nix index 3d8f1345..1a911655 100644 --- a/hosts/idols-ai/preservation.nix +++ b/hosts/idols-ai/preservation.nix @@ -355,6 +355,13 @@ in # Japanese IME ".config/mozc" # used by fcitx5-mozc + # Vinput voice input (fcitx5-vinput): core config.json + downloaded + # sherpa-onnx models (~/.local/share/vinput/models/). Without these the + # daemon starts with "Local ASR provider model is not configured" after + # every reboot. Setup commands: home/linux/gui/base/vinput/README.md + ".config/vinput" + ".local/share/vinput" + ".config/nushell" ]; files = [