Feature: expose __version__ and top-level version() for server version Closes #623
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.5k
- Forks
- 1.2k
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
There's currently no clean way to check either the installed package version or the running Ollama server version from Python
Two small additions would fix this:
ollama.__version__: the package version already exists internally, it just isn't exported. Exposing it follows standard Python packaging conventions and is a one-liner.ollama.version(): a top-level wrapper around the existingClient.version()that hits /api/version. Async variant would be nice too.
Use case is things like this:
import ollama
print(ollama.__version__) # "0.6.1"
print(ollama.version()) # "0.18.2"
if ollama.version() >= "0.3.0":
# safe to use newer features
pass
Useful for version-gated feature checks and CI/CD pipelines where you want to assert compatibility before running tests.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the package's existing internal version value and the Client.version() method that calls /api/version. Trace how the top-level ollama API is exported, then check the relevant package tests or test entry points. Done means package and server versions are accessible through the requested top-level interfaces, with async support addressed if the project conventions allow it.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100