Skip to content

Fix Whisper model selection caching#425

Open
pumpkinperson996 wants to merge 2 commits into
JefferyHcool:masterfrom
pumpkinperson996:agent/fix-whisper-model-selection
Open

Fix Whisper model selection caching#425
pumpkinperson996 wants to merge 2 commits into
JefferyHcool:masterfrom
pumpkinperson996:agent/fix-whisper-model-selection

Conversation

@pumpkinperson996

@pumpkinperson996 pumpkinperson996 commented Jul 20, 2026

Copy link
Copy Markdown

Summary

  • forward the persisted Whisper model size from NoteGenerator to the transcriber provider
  • make explicit/persisted model selections take precedence over Docker's WHISPER_MODEL_SIZE startup default
  • rebuild cached transcribers when their constructor configuration changes
  • serialize transcriber initialization to avoid duplicate model loads under concurrent requests
  • add regression coverage for model forwarding, environment precedence, and cache invalidation

Root cause

NoteGenerator read the saved whisper_model_size setting but only passed the transcriber type to the provider, so the provider fell back to its default model. The provider also re-read WHISPER_MODEL_SIZE from the environment, which allowed Docker's startup default (tiny) to override an explicit frontend selection such as large-v3-turbo. Finally, the provider cached one instance per transcriber type, so later model changes could continue reusing the first loaded model.

Impact

Explicit model selections from the frontend are now honored by the main Docker service. WHISPER_MODEL_SIZE remains a fallback when no explicit model is provided, and changing the model selection rebuilds the cached transcriber with the new configuration.

Validation

  • pytest -q tests/test_whisper_config_forwarding.py tests/test_whisper_models.py tests/test_model_download_state.py — 25 passed
  • python -m py_compile app/services/note.py app/transcriber/transcriber_provider.py tests/test_whisper_config_forwarding.py — passed
  • full backend suite — 48 passed, 3 subtests passed, 1 existing unrelated failure in test_task_serial_executor.py (the stale test expects serial execution while ConcurrentTaskExecutor defaults to 3 workers)

@pumpkinperson996
pumpkinperson996 marked this pull request as ready for review July 20, 2026 23:49
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