Update provider_validation.py

This commit is contained in:
Eric Hare 2025-12-02 13:26:35 -08:00
parent a6f1ed7c48
commit d60432b1e0
No known key found for this signature in database
GPG key ID: A73DF73724270AB7

View file

@ -365,18 +365,16 @@ async def _test_watsonx_embedding(
# Ollama validation functions
async def _test_ollama_lightweight_health(endpoint: str) -> None:
"""Test Ollama availability with lightweight /api/tags endpoint.
"""Test Ollama availability with lightweight status check.
This endpoint is very fast and doesn't block on active requests,
making it ideal for health checks when Ollama might be busy.
Only checks if the endpoint returns a 200 status without fetching data.
"""
try:
ollama_url = transform_localhost_url(endpoint)
url = f"{ollama_url}/api/tags"
async with httpx.AsyncClient() as client:
response = await client.get(
url,
ollama_url,
timeout=10.0, # Short timeout for lightweight check
)