Skip to content

feat: expose __version__ and top-level version() function#656

Open
Susandhungana1 wants to merge 1 commit intoollama:mainfrom
Susandhungana1:feat/expose-version
Open

feat: expose __version__ and top-level version() function#656
Susandhungana1 wants to merge 1 commit intoollama:mainfrom
Susandhungana1:feat/expose-version

Conversation

@Susandhungana1
Copy link
Copy Markdown

What

  • Adds Client.version() and AsyncClient.version() methods hitting /api/version
  • Exposes top-level ollama.version() wrapping Client.version()
  • Exposes ollama.__version__ (installed package version) via importlib.metadata

Why

Fixes #646

Follows the same pattern as existing top-level functions (chat, pull, ps etc).
Useful for version-gated feature checks and CI/CD pipelines.

Testing

import ollama
print(ollama.version) # "0.6.1"
print(ollama.version()) # "0.20.6"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: expose __version__ and top-level version() for server version Closes #623

1 participant