From 7cba57d34d92d117e23c33d9f695a0bda4b2994c Mon Sep 17 00:00:00 2001 From: Grzegorz Sterniczuk Date: Sun, 30 Nov 2025 09:50:50 +0100 Subject: [PATCH] fix: increase Quart RESPONSE_TIMEOUT and BODY_TIMEOUT for slow LLM responses --- api/apps/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/apps/__init__.py b/api/apps/__init__.py index a6e33c13b..e034f460b 100644 --- a/api/apps/__init__.py +++ b/api/apps/__init__.py @@ -82,6 +82,11 @@ app.url_map.strict_slashes = False app.json_encoder = CustomJSONEncoder app.errorhandler(Exception)(server_error_response) +# Configure Quart timeouts for slow LLM responses (e.g., local Ollama on CPU) +# Default Quart timeouts are 60 seconds which is too short for many LLM backends +app.config["RESPONSE_TIMEOUT"] = int(os.environ.get("QUART_RESPONSE_TIMEOUT", 600)) +app.config["BODY_TIMEOUT"] = int(os.environ.get("QUART_BODY_TIMEOUT", 600)) + ## convince for dev and debug # app.config["LOGIN_DISABLED"] = True app.config["SESSION_PERMANENT"] = False