Skip to content

Add Apple SpeechAnalyzer as an optional local model - #3

Open
andesco wants to merge 3 commits into
digimata:masterfrom
andesco:feature/apple-local-models
Open

Add Apple SpeechAnalyzer as an optional local model#3
andesco wants to merge 3 commits into
digimata:masterfrom
andesco:feature/apple-local-models

Conversation

@andesco

@andesco andesco commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • add apple-speech as an optional transcription model on macOS 26+
  • keep whisper-base.en as the default and retain every existing Whisper option
  • list Apple Speech in parrot models list
  • explain that Apple manages the model when parrot models download apple-speech is used
  • allow launch-at-login to persist an explicit model selection

Implementation

AppleSpeechTranscriber uses the system SpeechAnalyzer framework and the current locale. It requires the corresponding on-device speech assets to already be installed, so Parrot does not download another model.

Captured 16 kHz mono audio is converted to SpeechAnalyzer compatible format before analysis. The analyzer is finalized through its reported sample time, avoiding the trace trap caused by ending analysis incorrectly.

The installer now accepts --model, validates the model ID, and writes it into the LaunchAgent's ProgramArguments. Running without --model continues to use the recommended Whisper model.

Launch-at-login requirement

Foreground Apple Speech requires macOS 26+. Launch-at-login with apple-speech requires macOS 26.3+ and Accessibility access for /usr/local/bin/parrot itself, because the LaunchAgent does not inherit the terminal's permission.

macOS 26.1–26.2 have a confirmed Privacy & Security bug that prevents standalone executables from being added reliably. On those versions, Parrot prints an actionable error and users can run the model from an authorized terminal instead. Apple Developer Forums

parrot install --launch-at-login --model apple-speech

Reported performance

In a third-party English LibriSpeech benchmark, SpeechAnalyzer reported 2.12%/4.56% WER versus 3.74%/7.95% for Whisper Small and 5.42%/12.51% for Whisper Base, while running about 3× faster than Small on an M2 Pro. Methodology and limitations.

Usage

parrot --model apple-speech

Running parrot without --model continues to use the recommended Whisper model.

Testing

  • swift build -c release
  • swift build -Xswiftc -strict-concurrency=complete
  • parrot models list
  • parrot models download apple-speech
  • manually exercised foreground Apple Speech model loading and local transcription
  • manually exercised the LaunchAgent end to end on macOS 26.6 with /usr/local/bin/parrot granted Accessibility access; confirmed apple-speech initialized and Fn dictation inserted text

Copilot AI review requested due to automatic review settings July 28, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new optional “apple-speech” transcription backend that uses Apple’s system SpeechAnalyzer on macOS 26+, while keeping WhisperKit as the default model path.

Changes:

  • Extends the Transcriber protocol with an async warmUp() entry point and adds a SystemModel identifier for system-managed models.
  • Introduces AppleSpeechTranscriber (macOS 26+) implementing Transcriber via SpeechAnalyzer + locale-aware on-device assets.
  • Updates CLI selection and model listing/download UX to surface apple-speech alongside existing Whisper models, plus README mention.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Sources/parrot/Transcription/Transcriber.swift Adds warmUp() to the transcriber interface and defines a reserved system model ID (apple-speech).
Sources/parrot/Transcription/AppleSpeechTranscriber.swift New macOS 26+ transcriber implementation using SpeechAnalyzer with audio format conversion and result collection.
Sources/parrot/Parrot.swift Wires apple-speech into --model selection, model listing, and “download” messaging.
README.md Documents the new --model apple-speech option and lists SpeechAnalyzer in the stack.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/parrot/Transcription/Transcriber.swift Outdated
Comment thread Sources/parrot/Parrot.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants