Promote to production: voice-to-text worker + persistent cache - #83
Merged
Conversation
Transcription ran on the main thread, so the whole page froze during inference — which on the larger 'Better' model + a 30s clip on a phone can take minutes and looks hung (it wasn't; a shorter clip completes fine). - Move inference into a dedicated Web Worker (stt.worker + stt.client). The main thread stays responsive: the audio player works, and progress updates flow. A single long-lived worker keeps the in-worker model cache warm across runs. - Show a live elapsed timer while transcribing (now that the thread is free), and warn that the 'Better' model is much slower on phones. 545 tests · lint clean · build green (stt.worker chunk emitted; transformers stays in workbox globIgnores). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nload On mobile the browser can evict the cached Whisper model between sessions under storage pressure, forcing a re-download on refresh. Request persistent storage (navigator.storage.persist) so the origin's cache isn't evicted.
feat(voice-to-text): Web Worker (no freeze) + persistent model cache
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.
Runs transcription in a Web Worker (no UI freeze, live elapsed timer) and requests persistent storage so the model isn't evicted/re-downloaded.
🤖 Generated with Claude Code