Skip to content

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

@ravivarmanr26

Description

@ravivarmanr26

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:

  1. 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.
  2. ollama.version() : a top-level wrapper around the existing Client.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions