ollama-python icon indicating copy to clipboard operation
ollama-python copied to clipboard

Support "ping" on client for the health endpoint

Open jpmcb opened this issue 2 months ago • 0 comments

Ollama supports a "health" endpoint at the root of the running server:

❯ curl localhost:11434 -vvv
*   Trying 127.0.0.1:11434...
* Connected to localhost (127.0.0.1) port 11434 (#0)
> GET / HTTP/1.1
> Host: localhost:11434
> User-Agent: curl/7.87.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Date: Thu, 18 Apr 2024 19:20:47 GMT
< Content-Length: 17
<
* Connection #0 to host localhost left intact
Ollama is running

The biggest thing to note here is the 200 response and the returned "Ollama is running" response.

Also related:

  • https://github.com/ollama/ollama-python/issues/120

Can ollama-python support a "ping" member on the client? I'd imagine this would hit the above endpoint and simply continue if 200 is returned. Otherwise, raise an error.

Happy to work on this if 👍🏼

jpmcb avatar Apr 18 '24 19:04 jpmcb