* fix: add SHA256 verification to prevent corrupt partial download loop
Fixes issue #858 — corrupt .partial files caused an infinite loop where
a failed/cancelled download would resume from EOF, pass extraction, and
loop forever with no way to recover without manual file deletion.
Three-part fix:
- Add sha2 crate and compute_sha256() helper; verify hash post-download
before extraction/rename for all 15 built-in models. Hash mismatch
deletes the .partial so the next attempt starts fresh.
- Delete .partial on extraction failure (independent of checksums) so
corrupt archives can't re-enter the loop via the same path.
- Emit model-download-failed event from the command handler so all
callers (ModelsSettings, Onboarding) get consistent error feedback
via a central store listener rather than per-caller return-value checks.
SHA256 hashes hardcoded alongside each model's URL in ModelInfo.
Custom models (sha256: None) skip verification silently.
* chore: remove doc comment from sha256 field
Doc comments on exported specta types propagate into bindings.ts as
inline JSDoc — not useful in generated TS. Removing at the source.
* test: add SHA256 verification unit tests
Extracts inline verify logic into ModelManager::verify_sha256() and
covers all four branches:
- None expected hash → skipped (custom models)
- Matching hash → ok, file kept
- Mismatched hash → error returned, partial file deleted
- Unreadable file → error returned
Ensures corrupt partial downloads are always cleaned up so the next
attempt starts fresh.
* chore: cargo fmt
* fix: clear cancel flag on sha256 failure, spawn_blocking for hash, fallback cleanup
- remove cancel_flags entry on sha256 failure to prevent a stale flag
from immediately cancelling the next retry attempt (HIGH)
- add fallback state cleanup in modelStore when result.status != ok,
so spinner clears even if model-download-failed event is missed (HIGH)
- run compute_sha256 in spawn_blocking to avoid stalling the async
executor while hashing large model files (up to 1.6 GB) (MEDIUM)
* emit some more events for the ui to pick up
* add translations + format
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* test build for 0.16.0
* macos 10.15?
* format
* shorter dir for build on windows?
* Update build.yml
* move
* Update build.yml
* long path support
* clang
* try
* try
* move to ort rc12
* use ms prebuilt?
* use lower version for 1.23.1
* download my prebuilt
* Update build.yml
* Update build.yml
* fix?
* fix(nix): use dynamic linking for ort-sys 2.0.0-rc.12
ort-sys rc.12 removed pkg-config support; without ORT_PREFER_DYNAMIC_LINK
it defaults to static linking against ORT_LIB_LOCATION, which fails
because nixpkgs only provides shared libraries (.so).
* fix(nix): override onnxruntime to 1.24.2 for ort-sys rc.12 compatibility
ort 2.0.0-rc.12 enables API v24 by default, but nixpkgs only ships
onnxruntime 1.23.2 (API v23), causing a runtime panic on model load.
Use Microsoft's prebuilt binaries for onnxruntime 1.24.2 via overlay,
patched with autoPatchelfHook for NixOS compatibility.
This overlay should be removed once nixpkgs merges onnxruntime ≥ 1.24:
https://github.com/NixOS/nixpkgs/pull/499389
* updated deps for whisper
* fix(nix): sync devShell with packages for ort-sys rc.12 compatibility
- Extract shared definitions (commonNativeDeps, gstPlugins, commonEnv,
onnxruntimeOverlay) to avoid duplication between packages and devShells
- Add onnxruntime 1.24.2 overlay to devShell (was only in packages)
- Add BINDGEN_EXTRA_CLANG_ARGS to devShell so bindgen can find stdio.h
and generate correct vulkan bindings for whisper-rs-sys
- Add ORT_LIB_LOCATION and ORT_PREFER_DYNAMIC_LINK to devShell
- Replace libappindicator with libayatana-appindicator in devShell
- Add onnxruntime and vulkan-loader to devShell LD_LIBRARY_PATH
* fix missing lib in the handy blob dl
* scope lib verification
* dont run bun2nix on windows
---------
Co-authored-by: Evgeny <evgeny.khudoba@yandex.ru>
* first pass at gpu acceleration
* unload the model when changing
* mock accelerator
* translations and build fix
* format
* clean up helptext
* type cleanup
* format
* lint
* refactor: migrate transcribe-rs from v0.2.8 to v0.3.0
Breaking API migration:
- engines::* → onnx::* module paths, whisper_cpp::* for Whisper
- TranscriptionEngine trait → SpeechModel trait
- Two-step new()+load_model() → one-step Model::load()
- transcribe_samples(Vec<f32>) → transcribe(&[f32])
- Explicit unload_model() → RAII drop
- Canary engine now from transcribe-rs instead of local crate
Removes canary-engine local crate dependency.
Uses path dependency to local transcribe-rs clone (temporary).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: upgrade transcribe-rs to v0.3.1, add Canary models
Update transcribe-rs dependency from v0.2.8 to v0.3.1 with
restructured features (whisper + onnx). Add Canary 180M Flash
(4 languages, 146MB) and Canary 1B v2 (25 EU languages, 692MB)
with translation support. Add i18n translations for all 17 locales.
Languages verified against HuggingFace model cards:
- Canary 180M Flash: en, de, es, fr
- Canary 1B v2: bg, hr, cs, da, nl, en, et, fi, fr, de, el, hu,
it, lv, lt, mt, pl, pt, ro, sk, sl, es, sv, ru, uk
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* make sure when changing models the language changes with it
* format
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat: add GigaAM v3 model for Russian speech recognition
Add GigaAM v3 e2e_ctc as a new transcription engine using
transcribe-rs 0.2.7 gigaam feature. Russian speech recognition
with punctuation, Latin characters and digit support.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: cargo fmt formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Keep the file name of the model download the same as the file on the
blob website.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: upgrade tauri-plugin-updater to v2.10.0 to fix duplicate registry entries (#873)
Upgrade tauri and tauri-plugin-updater to get bundle-specific target
resolution, which prevents NSIS-installed users from receiving MSI
updates via OTA and creating duplicate registry entries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* move to my branch
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat: add CLI parameters for Linux (--start-hidden, --no-tray, --toggle-transcription, --debug)
Add command-line interface using clap for better Linux desktop integration:
- --start-hidden: launch without showing the main window
- --no-tray: launch without system tray icon (closing window quits app)
- --toggle-transcription: toggle recording on/off on a running instance
via tauri_plugin_single_instance
- --debug: enable debug mode with Trace-level logging (runtime-only)
Extract toggle_transcription() from signal_handle.rs into a reusable
function shared between SIGUSR2 handler and CLI single-instance callback.
Update CLAUDE.md and README.md with CLI documentation including setup
instructions for GNOME, KDE Plasma, Sway/i3, and Hyprland.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* add cancel and post processs
* cleanup
* format
* docs
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat(models): auto-discover custom Whisper models in models directory
Enable automatic discovery of custom GGML-format Whisper models (.bin files)
placed in the models directory, so users don't need to modify source code
to use their own fine-tuned models.
Backend changes:
- Add discover_custom_whisper_models() to scan for .bin files
- Generate display names from filenames (e.g., "my-model" → "My Model")
- Skip predefined model filenames to avoid duplicates
- Add 3 unit tests for discovery logic
Frontend changes:
- Split model dropdown into 3 sections: Custom, Downloaded, Downloadable
- Add collapsible section for downloadable models to reduce clutter
- Add max-height with scroll for long model lists
- Add "Custom" badge for user-provided models
* feat(models): make custom Whisper model discovery opt-in
[why] Address maintainer concern about support burden from community
models. Custom models should be a power-user feature, not enabled by
default.
[how] Add custom_models_enabled setting (default: false) in Debug
settings. Discovery only runs when enabled. Models show "Not officially
supported" messaging. Documentation updated with enable steps.
* feat(models): add is_custom field and integrate custom models with new UI
[why]
PR review requested an explicit is_custom field instead of inferring
custom status from url === null. Custom models also need proper
integration with the new models settings page from PR #478.
[how]
- Add is_custom: bool to ModelInfo struct, set true on discovered models
- Change discover_custom_whisper_models signature from &PathBuf to &Path
- Use 0.0 sentinel scores so UI hides score bars for custom models
- Add "Custom Models" section to ModelsSettings with 3-way model split
- Show "Custom" badge in ModelCard and ModelDropdown
- Hide language/translation tags when supported_languages is empty
- Remove custom models from available_models on delete instead of
just marking as not downloaded (they have no re-download URL)
- Update tests with new fields and assertions
* chore(i18n): add custom model translation keys to all locales
[why]
Custom model feature introduces 5 new translation keys that need
to be present in all 15 non-English locales for CI to pass.
[how]
Add English placeholder values for: customModelDescription,
modelSelector.custom, settings.models.customModels,
settings.debug.customModels.label, settings.debug.customModels.description
* fix(models): keep language filter visible when no models match
[why]
The language filter was inside a conditionally rendered section
that disappeared when no downloaded models matched the selected
language, leaving the user stuck with no way to change the filter.
[how]
Always render the "Your Models" header row with the language filter,
only conditionally render the model cards below it.
* docs: fix custom models section reference in README
Model selector → Models settings page.
* fix(models): apply custom models toggle immediately without restart
[why]
Two bugs reported in PR review: (1) app breaks on restart when a
custom model was selected and the toggle is disabled — selected_model
still points to the missing model, causing "Model not found" error.
(2) Custom models remain visible in the UI after toggle-off because
the in-memory model list is never updated and no event is emitted.
[how]
- Add remove_custom_models() and add_custom_models() to ModelManager
for runtime mutation of the available_models mutex
- On disable: reset selected_model to empty if it's a custom model,
then remove custom models from the in-memory list
- On enable: run discover_custom_whisper_models against the mutex
- Emit model-state-changed event so the frontend refreshes immediately
* chore(i18n): remove "restart required" from custom model descriptions
Toggle now takes effect immediately, so the restart sentence
is inaccurate. Updated all 16 locales and README instructions.
* fix(models): clear stale model selection on startup
[why]
If a custom model file is deleted from disk while it's the selected
model, the app gets stuck on "Loading..." forever on next launch
because the model ID is not in available_models but
auto_select_model_if_needed only checked for empty string.
[how]
Validate that selected_model exists in available_models before
accepting it. If not found, clear the selection so auto-select
picks a valid downloaded model.
* remove toggle and clean up
* format
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat: add models settings page with filtering and management
- add dedicated models settings page in sidebar
- reuse ModelCard component from onboarding for consistent UI
- add filter buttons for all/multi-language/translation models
- add model deletion with native confirmation dialog (tauri-plugin-dialog)
- consolidate model event listeners into useModels hook (Zustand store)
- remove duplicate event listeners from ModelSelector, LanguageSelector, TranslateToEnglish
- gate AccessibilityPermissions to macOS only
- add is_recommended field to model registry for featured models
- remove unused get_recommended_first_model command
- add translations for all 9 supported languages
* feat: add language filter to models settings page
adds a searchable language dropdown filter to the models page that lets users filter models by language support. when a non-english language is selected, models that don't support multiple languages (like parakeet) are hidden.
- add searchable language dropdown (right-aligned in filter row)
- filter models using supports_language_selection capability
- add allLanguages translation key to all 10 locales
* feat: add translation consistency checker script
- add scripts/check-translations.cjs to validate all language files
- script dynamically discovers languages from directory structure
- checks that all languages have same keys as english reference
- detects missing and extra keys in each language
- add check:translations npm script
- integrate into github actions lint workflow
- validates translations on every pull request
* fix: update imports and add missing translations after rebase
- replace useModels hook with useModelStore in components
- add permission error keys to all languages
- add model settings keys to cs and tr (new languages from main)
* fix: translate english placeholders in cs and tr locale files
* refactor: simplify model dropdown and migrate store to immer
- model dropdown now only shows downloaded models (no download/delete)
- convert store to immer with record types for immutability
- remove unused translation keys (welcome, downloadPrompt, etc.)
- add missing moonshine-base model fields
- sync translations after rebase
* fix: add download cancellation support and ui improvements
- add full download cancellation with Arc<AtomicBool> flags in rust backend
- add progress event throttling (100ms) to prevent ui freeze
- add cancel button to model card in settings page
- add model-deleted event listener to refresh dropdown after deletion
- remove pink background from recommended models in settings (keep badge only)
- add cancel/cancelDownload translation keys to all 14 languages
* fix: remove duplicate language/translate settings from general and advanced
settings are now only in ModelSettingsCard, not duplicated in their old locations
* fix: prevent model dropdown from being clipped by window edge
* add languages explicitly, clean up some ui
* fix: clear bottom progress bar when download is cancelled
The ModelSelector component maintains its own local state for download
progress. When a download was cancelled, the Rust backend would update
its state but never emitted an event to notify the frontend. This caused
the bottom progress bar to remain stuck showing "Downloading X%".
Added model-download-cancelled event emission in Rust and corresponding
listener in ModelSelector to clear progress state on cancellation.
* fix: align model card content to top to prevent floating elements
Changed ModelCard flex alignment from items-center to items-start so
the accuracy/speed bars stay at the top when the card expands (e.g.,
during download with progress bar visible).
* fix: prevent model deletion from interrupting active extractions
Added extracting_models HashSet to track models currently being
extracted. The update_download_status() function now skips cleanup
of .extracting directories for models that are actively extracting,
preventing a race condition where deleting one model would interrupt
another model's extraction process.
* refactor: migrate ModelCard buttons to Button component
Added two new Button variants for common patterns:
- primary-soft: soft/tinted primary buttons (used for download)
- danger-ghost: subtle destructive actions (used for delete/cancel)
Migrated all hardcoded buttons in ModelCard to use the shared Button
component for consistency and maintainability.
* feat: separate downloaded and available models into sections
Split the models list into "Your Models" and "Available to Download"
sections for clearer visual distinction between downloaded and
downloadable models.
Also adds missing translation keys to all locales:
- modelSelector.capabilities.singleLanguage
- modelSelector.capabilities.languageOnly
- settings.models.yourModels
- settings.models.availableModels
* fix: add missing translations after rebase onto main
add post-processing hotkey translations to all 15 locales and
backfill 29 missing keys for korean locale added in main.
* fix: add label to model delete button for clearer destructive state
* check translations as typescript
* format
* better text for dropdown
* wip ui tweaks
* rounded + ui tweaks
* fix download not 0% immediately, ui tweaks
* tweak name
* block for model downloading in onboarding
* small fixes
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* init attempt at new kb
* 0.1.1 handy-keys
* format
* cleanup
* support for capslock/shiftlock?
* move kb to experimental
* use hook
* fix macos bug
* attempt mouse buttons as well
* feat: add automatic filler word removal from transcriptions
Add filter_transcription_output() that removes filler words (uh, um, hmm,
etc.) and hallucination patterns ([AUDIO], (pause), <tag>...</tag>) from
transcriptions. Inspired by VoiceInk's approach.
- Add regex-based filter in audio_toolkit/text.rs
- Integrate into transcription pipeline after custom word correction
- Add comprehensive tests for filler word removal
- Add regex crate dependency
* feat: collapse repeated 1-2 letter stutters in transcriptions
Add collapse_stutters() to reduce model hallucination artifacts like
"wh wh wh wh wh why" -> "wh why" or "I I I I think" -> "I think".
Collapses any 1-2 letter word that repeats 3+ times consecutively
to a single instance (case-insensitive matching).
* remove bracket/xml stuff
* format
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat: add Moonshine Base speech recognition model
Add support for the Moonshine Base ASR model, which offers:
- 5x faster transcription than Whisper
- Better accent recognition
- ~240MB model size (encoder + decoder + tokenizer)
Changes:
- Update transcribe-rs to v0.2 with moonshine feature
- Add EngineType::Moonshine variant
- Add Moonshine Base model definition (400MB, 80% accuracy, 90% speed)
- Add model loading and transcription logic
- Add i18n translation for Moonshine Base
Note: Model files must be hosted at blob.handy.computer/moonshine-base.tar.gz
Expected structure: encoder_model.onnx, decoder_model_merged.onnx, tokenizer.json
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update moonshine parameters.
* add translations
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: replace async-openai library with post request to support custom providers
* move models call to llm_client too
* tweak post processing ui and add groq and cerebras
---------
Co-authored-by: CJ Pais <cj@cjpais.com>