Skip to content

feat(desktop): voice input in the desktop app without Docker - #769

Merged
marcvergees merged 2 commits into
developmentfrom
backend-desktop-voice
Nov 20, 2026
Merged

marcvergees merged 2 commits into
developmentfrom
backend-desktop-voice

Conversation

@vharkins1

@vharkins1 vharkins1 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Voice doesn't work in the v1.1.1 desktop app. The desktop binary has no Whisper service, so the live stream closes with WHISPER_UNAVAILABLE, uploads return 503 STT_UNAVAILABLE, and /health reports degraded on every launch.

This PR makes the desktop backend transcribe in-process with faster-whisper, using a model shipped inside the binary. Docker is unchanged and keeps using the Whisper sidecar.

Fixes #768

What changed

  • app/services/whisper_local.py (new): the engine, audio decoding, and a streaming buffer for live recordings
  • WHISPER_LOCAL setting, on by default when FIREFORM_DESKTOP=true and off in Docker. When it is on, uploads, the availability check, /health and /ws/transcribe use the local engine
  • scripts/fetch_whisper_model.py, fireform-backend.spec and build-desktop-binaries.yml: download the model and bundle it in the binary
  • app/desktop.py: multiprocessing.freeze_support(). Without it, the first transcription made the packaged binary start a second copy of the API
  • docs/DESKTOP.md updated

Choices worth reviewing

  • Model: small, not tiny. I tried tiny first. It turned "410 Oak Street" into "410 OX 3" and "Captain Ruiz" into "Captain Rui S.". small got both right, and addresses and names are what a report needs.
  • Bundled, not downloaded. The model ships inside the binary so voice works offline on first launch.
  • Live streaming re-transcribes only recent audio. Once about 15 s has built up, earlier sentences are locked in, so a long memo stays as fast as a short one.
  • No frontend change needed. The WebSocket messages are the same as the sidecar path.

Costs and limits

  • The macOS binary grows from about 145 MB to about 590 MB.
  • First launch of the new binary took about 50 s on my Mac, then about 25 s.
  • I could only build and run macOS (Apple Silicon). The Windows and Linux builds are untested, and the PyInstaller change is the part most likely to need adjusting there. Please don't tag a release from this until those have been checked.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • pytest tests/: 474 passed (11 new, using a fake model so nothing is downloaded)
  • ruff check app tests scripts
  • PyInstaller binary on a clean data folder with HF_HUB_OFFLINE=1: POST /api/v1/input/voice transcribed wav, m4a and webm
  • /api/v1/ws/transcribe with a 53 s recording sent at real-time speed: 24 interim updates, final transcript 2.8 s after stop
  • Packaged desktop app with Docker off: /health is healthy, live stream works
  • Windows and Linux binaries

To reproduce:

pip install -r requirements.txt pyinstaller
python scripts/fetch_whisper_model.py
pyinstaller --clean -y fireform-backend.spec

Test Configuration:

  • Python version: 3.12
  • Docker/Compose version: not running
  • OS: macOS (Apple Silicon)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • The Lint workflow check passes on this PR
  • The Tests workflow check passes on this PR

…per model

The desktop binary has no Whisper sidecar, so voice input and live streaming
returned WHISPER_UNAVAILABLE there and /health was always degraded.

- app/services/whisper_local.py: faster-whisper engine with the small.en model
  bundled in the binary, plus a streaming buffer that commits settled segments
  so long memos stay fast
- WHISPER_LOCAL (default on in desktop mode) routes call_whisper_asr, the
  availability check, /health and /ws/transcribe to the local engine; Docker
  keeps using the sidecar
- scripts/fetch_whisper_model.py + spec/workflow changes to bundle the model
- desktop.py: multiprocessing.freeze_support(), otherwise the engine's helper
  process boots a second copy of the API in the frozen binary
@vharkins1 vharkins1 added this to the Release v.1.1.1 milestone Nov 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T22:29:09.695067Z 5edd1f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vharkins1 vharkins1 removed this from the Release v.1.1.1 milestone Nov 19, 2026
@vharkins1 vharkins1 added the enhancement New feature or request label Nov 19, 2026
@marcvergees
marcvergees merged commit 102545f into development Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Voice input in the desktop app without Docker

2 participants