feat: expose __version__ and top-level version() / async_version() helpers#653
Open
Ghraven wants to merge 1 commit intoollama:mainfrom
Open
feat: expose __version__ and top-level version() / async_version() helpers#653Ghraven wants to merge 1 commit intoollama:mainfrom
Ghraven wants to merge 1 commit intoollama:mainfrom
Conversation
Closes ollama#646 Adds two things to the public API: 1. `ollama.__version__` — the installed package version, resolved via `importlib.metadata` (same mechanism already used in `_client.py`). Now exported in `__all__` so it's part of the documented public API. 2. `ollama.version()` / `ollama.async_version()` — thin top-level wrappers around `Client.version()` so callers can check the running Ollama server version without instantiating a client. Also wires up `exists = _client.exists` to expose the new method at the top level, consistent with all other module-level shortcuts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #646
What
Adds two things to the public
ollamanamespace:ollama.__version__The installed client package version — resolved via
importlib.metadata, same mechanism already used internally in_client.py.ollama.version()/ollama.async_version()Top-level wrappers around
Client.version()that hit/api/versionand return the running Ollama server version string — no need to instantiate a client manually.Also exposes
ollama.exists()Wires up the new
exists()method as a module-level shortcut, consistent with all other shortcuts (list,show,pull, etc.).Files changed
ollama/__init__.py— adds__version__,version(),async_version(),existsshortcut, and updates__all__