Skip to content

Add language selection for Whisper models - #674

Open
wallneradam wants to merge 4 commits into
altic-dev:mainfrom
wallneradam:codex/whisper-language-selection
Open

Add language selection for Whisper models#674
wallneradam wants to merge 4 commits into
altic-dev:mainfrom
wallneradam:codex/whisper-language-selection

Conversation

@wallneradam

@wallneradam wallneradam commented Jul 21, 2026

Copy link
Copy Markdown

Description

Adds a searchable language selector to every Whisper model in Voice Engine settings. Users can keep automatic language detection or force one of Whisper's 99 supported languages.

The selected language is persisted, included in settings backups, and passed to RunOptions.language for transcription. Existing installations initially inherit the language selected during onboarding until the user explicitly chooses Automatic or another language.

This improves short utterances and single-word dictation, where Whisper may not have enough context to reliably detect the spoken language.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Revisits #100. The earlier concern about exposing a Whisper-only setting is less applicable now that Voice Engine settings already provide model-specific language selection for Cohere and Nemotron.

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 26.5.2
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources (0 violations)
  • Ran formatter locally: swiftformat --config .swiftformat Sources (the current base branch has pre-existing whole-file formatting failures in SettingsStore.swift and WhisperProvider.swift; unrelated lines were not reformatted)
  • Ran tests locally: 152 tests passed with 0 failures
  • Built the signed Debug application successfully
  • Manually tested selecting Hungarian, searching the language list, and Hungarian dictation in the installed application

Screenshots / Video

Whisper language picker

  • No UI/visual changes; screenshots/video are not applicable.

Notes

  • Uses the existing VoiceEngineLanguageCatalog; no duplicate language list or dependency update is introduced.
  • Automatic detection remains available and preserves the previous behavior.
  • Onboarding Whisper routes now apply their existing language binding instead of discarding it.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10744e1bd9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/Fluid/Services/WhisperProvider.swift
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a searchable language picker to every Whisper model in Voice Engine settings, letting users force a specific language or keep automatic detection. The selected language is persisted via a new selectedWhisperLanguageCode UserDefaults key, included in settings backups, and passed to RunOptions.language at transcription time.

  • VoiceEngineLanguageCatalog gains a public whisperLanguages list and whisperLanguage(forCode:) lookup; Hebrew's code is corrected from the deprecated "iw" to "he" (aligned with whisper.cpp PR #935 and the current GGML runtime).
  • SettingsStore.selectedWhisperLanguageCode follows the established "auto" sentinel pattern, falls back to the onboarding language on first launch, and validates stored codes against the catalog before returning them.
  • WhisperProvider receives the language via languageCodeOverride at init and exposes a parameter-required runOptions(languageCode:) factory; BackupService and the onboarding apply path are updated accordingly.

Confidence Score: 5/5

  • This PR is safe to merge. The changes are narrowly scoped to the new language-selection feature with no modifications to existing transcription paths beyond passing a language code that defaults to nil.
  • The implementation follows established patterns in the codebase: the "auto" sentinel, if-let backup restore, and catalog-validated getters are all consistent with Cohere/Nemotron equivalents. The Hebrew code correction from "iw" to "he" is confirmed correct for modern whisper.cpp. Backup restore and onboarding fallbacks are handled correctly. Tests cover the key behavioral contracts. No issues found that would affect correctness or data integrity.
  • No files require special attention.

Reviews (4): Last reviewed commit: "Preserve automatic language in settings ..." | Re-trigger Greptile

Comment thread Sources/Fluid/Persistence/SettingsStore.swift Outdated
Comment thread Sources/Fluid/Services/WhisperProvider.swift Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0546b8b82

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/Fluid/Persistence/SettingsStore.swift
@wallneradam
wallneradam force-pushed the codex/whisper-language-selection branch from 142e1a7 to 11bf5d3 Compare August 14, 2026 08:31
@wallneradam

Copy link
Copy Markdown
Author

Rebased this PR onto the current main; it is now conflict-free. I also reran the current CI-equivalent checks locally: strict SwiftLint reports 0 violations, and all 250 executed tests passed (with the same flaky Tiny Whisper E2E skipped as in CI).

Some additional context on why this is important: FluidVoice now already exposes model-specific language selection for Cohere and Nemotron, and this PR follows that established interaction for Whisper rather than introducing a new settings concept. For Hungarian—and similarly for other languages where short utterances do not give automatic detection enough context—forcing the known language avoids incorrect language detection and materially improves short and single-word dictation. In practical Hungarian use it is also noticeably faster because Whisper can skip language detection.

Automatic detection remains available and remains the default, so this is an opt-in accuracy and latency improvement for users who know the dictation language. Parakeet behavior is unchanged.

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.

1 participant