mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #24338] fix: prevent STT from blocking the uvicorn event loop #66463
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24338
Author: @Classic298
Created: 5/3/2026
Status: 🔄 Open
Base:
dev← Head:fix/stt-blocking-event-loop📝 Commits (1)
eec14f1fix: prevent STT from blocking the uvicorn event loop📊 Changes
1 file changed (+3 additions, -2 deletions)
View changed files
📝
backend/open_webui/routers/audio.py(+3 -2)📄 Description
@tjbck urgent fix for upcoming version
This was tested and confirmed working in #24196 comments
The transcription endpoint was async but called the synchronous transcribe() function directly, blocking the single-threaded uvicorn event loop for the entire duration of inference. This caused all HTTP and WebSocket connections to stall for every user on the instance during STT processing.
Add asyncio import
Use async UploadFile.read() instead of synchronous file.file.read()
Offload the blocking transcribe() call via asyncio.to_thread()
Closes #24169
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.