Voice: transcribe locally without a Soniox key

Đang mở
#337 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
12/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai, backend

Hướng nghiên cứu

Start with the ASRProvider interface in apps/voice-runtime/src/asr.ts and the existing Soniox implementation in soniox.ts, then see where agent.ts constructs the provider and throws without SONIOX_API_KEY. The worker startup gate in apps/node-services/src/voice/service.ts (workerKeys) and the model packages in model-packages.ts are the other entry points. The scope and engine choice are still open questions in the thread, so confirm them with maintainers before writing code.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.ts already defines the seam: ASRProvider.open() returns an ASRStream with partial / final / utterance_end / turn_finalized events, word offsets, and optional speaker IDs.
  • Add LocalASRProvider implements ASRProvider next to soniox.ts, wrapping a streaming CPU engine (sherpa-onnx streaming zipformer is the natural fit; whisper.cpp is the batch alternative), and reuse RecoveringASRStream for worker-restart replay.
  • agent.ts currently constructs new SonioxASRProvider(...) directly; add a small factory that picks local or Soniox from config.
  • apps/node-services/src/voice/service.ts starts the asr and recorder workers 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 voice model package group so desktop and image installs fetch it on first use.
Phasing
  1. 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.
  2. Meeting recording and transcript through recorder-agent; local diarization is a follow-up, so speaker labels are absent or single-speaker at first.
  3. 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 (#252)?
Ngôn ngữ chính
TypeScript
Star
3.8k
Fork
360
Merge trung bình
8 giờ 10 phút
Pull request đã merge (30 ngày)
540

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của simplexai-labs/linger

Tất cả issue của simplexai-labs/linger

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.