Skip to content

Commit dba8c6e

Browse files
Sahil Chachraclaude
authored andcommitted
fix: Ollama health probe uses root URL instead of /api/tags
/api/tags can be slow or restricted on some Ollama setups. The root endpoint (GET /) always returns "Ollama is running" and is the canonical liveness check. Also lowered log level to DEBUG since a probe failure is not actionable noise when actual generation requests succeed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5a6ede4 commit dba8c6e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

llm_safety_pipeline.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,9 @@ async def health_check(self) -> Dict[str, Any]:
622622
"""Probe the backend; returns a status dict."""
623623
t = self.config.backend_type.lower()
624624
base = self.config.base_url.rstrip("/")
625+
# Ollama root path returns "Ollama is running" — more reliable than /api/tags
625626
if t == "ollama":
626-
probe = f"{base}/api/tags"
627+
probe = base
627628
elif t == "openai":
628629
probe = f"{base}/v1/models"
629630
else:
@@ -632,7 +633,7 @@ async def health_check(self) -> Dict[str, Any]:
632633
resp = await self._client.get(probe, timeout=5.0)
633634
reachable = resp.status_code < 500
634635
except Exception as exc:
635-
self.logger.warning(f"Backend health probe failed: {exc}")
636+
self.logger.debug(f"Backend health probe failed: {exc}")
636637
reachable = False
637638
return {
638639
"reachable": reachable,

0 commit comments

Comments
 (0)