Repository navigation
Open
Description
Problem
Linger's core promise is that it runs fully on your PC, but voice transcription is the one core feature that always needs a cloud provider. docs/voice.md says recording and dictation need a Soniox key, and apps/voice-runtime/src/agent.ts throws Voice transcription requires SONIOX_API_KEY before the ASR worker can start. Someone who is offline, wants audio to stay on the device, or does not want a Soniox account cannot dictate or get a meeting transcript, even though the model-heavy parts of the product already run locally.
Proposal
Let transcription run on the computer, without changing what the user sees:
- With no Soniox key, dictation and meeting transcripts use a local engine, so voice works offline and audio never leaves the machine.
- With a Soniox key, Soniox stays the default for cloud quality and speaker diarization, or the user picks the source in Settings.
- The engine and its weights install the same way the voice VAD packages already do (
apps/node-services/src/model-packages.ts,models.json, first-use download with SRI and region ordering), CPU-only, no GPU requirement.
Technical shape (paths verified on main):
apps/voice-runtime/src/asr.tsalready defines the seam:ASRProvider.open()returns anASRStreamwithpartial/final/utterance_end/turn_finalizedevents, word offsets, and optional speaker IDs.- Add
LocalASRProvider implements ASRProvidernext tosoniox.ts, wrapping a streaming CPU engine (sherpa-onnx streaming zipformer is the natural fit; whisper.cpp is the batch alternative), and reuseRecoveringASRStreamfor worker-restart replay. agent.tscurrently constructsnew SonioxASRProvider(...)directly; add a small factory that picks local or Soniox from config.apps/node-services/src/voice/service.tsstarts theasrandrecorderworkers only when a Soniox key exists (workerKeys); local mode must start them without a key. TeamHub's provider-keys response (or a capability field) tells node-services that local transcription is available.- Add the engine and model to the
voicemodel package group so desktop and image installs fetch it on first use.
Phasing
- Dictation only, CPU, one streaming model that covers Chinese and English, no settings UI; prove it with synthetic PCM through the existing voice test harness.
- Meeting recording and transcript through
recorder-agent; local diarization is a follow-up, so speaker labels are absent or single-speaker at first. - Settings: "Transcription: On this computer / Soniox", language hints, automatic fallback, and the package download in the desktop installer.
Alternatives
- Keep Soniox-only and document voice as cloud. This leaves the local-first promise incomplete and keeps on-device audio impossible.
- Batch whisper.cpp on recorded chunks: simpler and stronger on long meetings, but it has no partial transcripts and adds latency to dictation.
- Bundle a local ASR service as a separate sidecar (for example a Python/localmodels server) instead of a Node provider: more moving parts, while the existing worker and health model already provides process isolation.
Open questions
- Is local transcription in scope, and which engine and licence is acceptable for redistribution?
- Automatic fallback when no key is set, or an explicit Setting?
- Is dictation the right first milestone, or meeting transcripts?
- Local models are roughly 50-300 MB; does that fit the desktop installer download flow (Setup: install the local model in the background so users can start right away #252)?
Metadata
Metadata
Assignees
Labels
No labels
Activity
Lumea-art commentedon Nov 20, 2026
Spike results: local streaming ASR is feasible on CPU, with one packaging caveat. Everything below ran on Ubuntu 22.04 (WSL), CPU only, no GPU, with two threads, using the official bilingual streaming zipformer model (
sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20, Apache-2.0) and the 25 MB Chinese model (zh-14M), fed in 100 ms chunks at 16 kHz.test_wavs, including code-switched sentences. Real meeting audio is still unproven, and the test files are short.Packaging finding.
sherpa-onnx-node@2.0.2ships a prebuilt addon built against GCC 14's libstdc++, so on Ubuntu 22.04 (glibc 2.35,CXXABI_1.3.13) it fails withCXXABI_1.3.15 not found, and the target machine has no sudo to upgrade. What works today:sherpa-onnx-node@1.12.14: it loads on 22.04 and produced identical results to the numbers above. Downside: an older release.linux-x64-shared-no-ttsCLI (22 MB) runs on 22.04, and the Python wheel (44 MB, bundles onnxruntime) fits the localmodels kit, which already ships Python 3.12.Gaps to plan for, not blockers for dictation:
models.json.Suggested first milestone, updated: dictation only, bilingual int8 (or the 25 MB Chinese model),
sherpa-onnx-node@1.12.14or a sidecar, no settings UI. That proves theASRProviderseam without touching the recorder or diarization behavior.Happy to turn this into a draft PR behind a
VOICE_LOCAL_ASRflag once you confirm the packaging route (addon vs sidecar) and the model licence and size budget.Lumea-art commentedon Nov 21, 2026
A draft implementation is up for review: #432.
It keeps the first milestone from the proposal: dictation only, off by default behind
VOICE_LOCAL_ASR+VOICE_LOCAL_ASR_MODEL_DIR, withLocalASRProviderbehind theexisting
ASRProviderseam, the ASR worker started without a Soniox key, and adictation_supportedpolicy field so the client offers dictation without offeringrecording. Recording, archive recovery and speaker labels stay on Soniox.
It is a draft because this issue has not had a maintainer reply yet; the packaging
route (optional
sherpa-onnx-node1.12.14, externalized in the desktop bundle) andthe descriptor change are the parts most worth a direction check before marking it ready.
Lumea-art commentedon Nov 26, 2026
PR #432 now addresses the two P1 review findings (local
chat_dictationwithout a Soniox key; the supervisor, not inherited env, choosing the engine) plus the recognizer-cache retry. Before it merges, could a maintainer confirm the packaging direction for the local engine?Current shape in #432:
sherpa-onnx-nodeis anoptionalDependenciespin at1.12.14in@linger/voice-runtime(2.x needs a newer libstdc++ than Ubuntu 22.04).VOICE_LOCAL_ASR_MODEL_DIR; there is no UI ormodels.jsondownload path in this PR.Is that acceptable for the first milestone, or would you rather see the addon/model packaging included in #432 before it lands? I am happy to extend it either way.