From c867c4ef518d1f91b88ea9b36c998197a50f74c0 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Thu, 19 Mar 2026 20:45:35 +0100 Subject: [PATCH] Update ollama_provider.py --- .../scripts/ai_providers/ollama_provider.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/AppImage/scripts/ai_providers/ollama_provider.py b/AppImage/scripts/ai_providers/ollama_provider.py index 1e3b3431..e64a6aa1 100644 --- a/AppImage/scripts/ai_providers/ollama_provider.py +++ b/AppImage/scripts/ai_providers/ollama_provider.py @@ -62,8 +62,13 @@ class OllamaProvider(AIProvider): 'Content-Type': 'application/json', } + # Cloud models (e.g., kimi-k2.5:cloud, minimax-m2.7:cloud) need longer timeout + # because requests go through: ProxMenux -> Ollama -> Cloud Provider -> back + is_cloud_model = ':cloud' in self.model.lower() + timeout = 120 if is_cloud_model else 30 # 2 minutes for cloud, 30s for local + try: - result = self._make_request(url, payload, headers, timeout=30) + result = self._make_request(url, payload, headers, timeout=timeout) except AIProviderError as e: if "Connection" in str(e) or "refused" in str(e).lower(): raise AIProviderError( @@ -130,4 +135,14 @@ class OllamaProvider(AIProvider): } # If server is up and model exists, do the actual test + # For cloud models, we skip the full test (which sends a message) + # because it would take too long. The model availability check above is sufficient. + is_cloud_model = ':cloud' in self.model.lower() + if is_cloud_model: + return { + 'success': True, + 'message': f"Cloud model '{self.model}' is available via Ollama", + 'model': self.model + } + return super().test_connection()