Files
open-webui-custom/backend/open_webui/routers
Classic298 d0c2bfdbff fix(db): release connection before LLM call in OpenAI /chat/completions (#20572)
Remove Depends(get_session) from the /chat/completions endpoint to prevent database connections from being held during the entire duration of LLM calls (30-60+ seconds for streaming responses).

Previously, the database session was acquired at request start and held until the streaming response completed. Under concurrent load, this exhausted the connection pool, causing QueuePool timeout errors for other database operations.

The fix allows Models.get_model_by_id() and has_access() to manage their own short-lived sessions internally, releasing the connection immediately after the quick authorization checks complete - before the slow external LLM API call begins.
2026-01-11 23:34:11 +04:00
..
2026-01-09 18:51:38 +04:00
2026-01-10 15:34:12 +04:00
2026-01-08 01:55:56 +04:00
2026-01-08 00:53:21 +04:00
2026-01-09 20:44:31 +04:00
2025-12-29 00:21:18 +04:00
2026-01-08 00:53:21 +04:00
2026-01-05 05:32:56 +04:00
2026-01-08 01:55:56 +04:00
2025-12-29 01:20:04 +04:00
2026-01-08 00:53:21 +04:00
2026-01-09 02:46:04 +04:00