Skip to main content

probe_endpoint

Function probe_endpoint 

Source
pub async fn probe_endpoint(base_url: &str, timeout: Duration) -> bool
Expand description

Probe base_url for a live OpenAI-compatible endpoint: GET {base_url}/models under a hard timeout. true iff the endpoint answered with a model list (an empty list still counts — the endpoint is up). Any error (refused, DNS, non-2xx, timeout) is false; the caller treats false as “not this endpoint” and moves on.

The keyless-placeholder rule lives in openai_client: only a http://localhost|127.0.0.1|[::1] base builds without a key, so a non-loopback $OLLAMA_HOST with no key probes false.