Start TTS model loads earlier without loading at every startup - #150
Merged
Merged
Conversation
…rtup - preload_tts() now also works in always-loaded mode, where a model without prewarm is loaded lazily; recording against a speech target (or an early spoken command) starts that first load while the user is still talking. The worker ignores the request when the model is already resident. - Switching from on-demand to always-loaded loads the model immediately when the engine's prewarm setting is on, and logs a load failure. - The per-engine prewarm settings still decide whether the model is loaded at startup (an earlier draft loaded it unconditionally, including Breeze-TTS-2's ~5 GB, and made the prewarm toggles do nothing). - Voice Command Router hotkeys no longer count as speech targets, so on-demand mode doesn't load the model for every ordinary dictation. - Start the TTS worker before AppState is built so tts_handle is set from the start, and let the speak callback use it without a runtime hop when it's uncontended. - Share the "load the selected engine" match between Preload and the mode switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of re-landing 1f13d62. This one is independent and based directly on
development.What changes
preload_tts()now also works in always-loaded mode. Withoutprewarm, that mode loads the model on first use. Recording against a speech target, or a command spotted mid-speech (Detect voice commands while the user is still speaking #148), now starts that load while the user is still talking. The worker ignores the request if the model is already loaded.prewarmis on, and logs a failure instead of hiding it.AppStateis built, sotts_handleis set from the start. The speak callback uses it directly when the lock is free, skipping a runtime hop.Preloadand the mode switch.Fixes over the original commit
prewarmcontrols startup loading again. The original loaded the model at every launch in always-loaded mode (the default), including Breeze-TTS-2 at about 5 GB. That made the four prewarm toggles in the TTS settings do nothing.docs/tts.mdis updated.Test plan
cargo test -p voxctrl-tts -p voxctrl-app: 172 + 92 pass🤖 Generated with Claude Code