diff --git a/api/chat_service.py b/api/chat_service.py index 2d02dcf..3a6cbb1 100644 --- a/api/chat_service.py +++ b/api/chat_service.py @@ -135,7 +135,7 @@ class ChatService: if model_override is not None: data["model_override"] = model_override - async with httpx.AsyncClient(timeout=120.0) as client: # Longer timeout for chat + async with httpx.AsyncClient(timeout=600.0) as client: # 10 min timeout for Ollama/local LLMs response = await client.post( f"{self.base_url}/api/chat/execute", json=data, diff --git a/frontend/src/lib/api/client.ts b/frontend/src/lib/api/client.ts index 8599b74..43b33b8 100644 --- a/frontend/src/lib/api/client.ts +++ b/frontend/src/lib/api/client.ts @@ -3,12 +3,12 @@ import { getApiUrl } from '@/lib/config' // API client with runtime-configurable base URL // The base URL is fetched from the API config endpoint on first request -// Timeout increased to 5 minutes (300000ms = 300s) to accommodate slow LLM operations -// (transformations, insights generation) especially on slower hardware (Ollama, LM Studio) -// Note: Frontend uses milliseconds (300000ms), backend uses seconds (300s) - both equal 5 minutes -// To configure: Set API_CLIENT_TIMEOUT=600 in .env for 10 minutes (600s = 600000ms) +// Timeout increased to 10 minutes (600000ms = 600s) to accommodate slow LLM operations +// (transformations, insights generation, chat) especially on slower hardware (Ollama, LM Studio) +// Note: Frontend uses milliseconds, backend uses seconds +// Local LLMs can take several minutes for complex questions with large contexts export const apiClient = axios.create({ - timeout: 300000, // 300 seconds = 5 minutes + timeout: 600000, // 600 seconds = 10 minutes headers: { 'Content-Type': 'application/json', },