Files
open-webui-custom/backend/open_webui
Classic298 24044b42ea fix(db): release connection before LLM call in Ollama /v1/chat/completions (#20569)
Remove Depends(get_session) from the /v1/chat/completions endpoint to prevent database connections from being held during the entire duration of LLM calls.

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.

The fix allows Models.get_model_by_id() and has_access() to manage their own short-lived sessions internally, releasing the connection immediately after authorization checks complete.
2026-01-11 23:35:38 +04:00
..
2025-12-21 23:17:53 +04:00
2026-01-09 20:44:31 +04:00
2026-01-09 22:27:53 +04:00
2026-01-08 01:55:56 +04:00
2025-08-10 00:02:58 +04:00
2025-12-28 23:35:09 +04:00
2026-01-09 22:27:53 +04:00
2026-01-11 00:52:43 +04:00
2025-04-15 09:55:35 +02:00
2026-01-09 19:42:13 +04:00
2026-01-09 19:42:13 +04:00