ollama / ollama/ollama-python

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

Open Beginner friendly
#646 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

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.

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.