ollama / ollama/ollama-python

Support "ping" on client for the health endpoint

Open
#121 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

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:


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 👍🏼

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the client entry point and the root health endpoint described in the issue. Add the requested ping member so a successful 200 response continues and an unsuccessful response raises an error; verify the behavior against the shown Ollama response.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.