Skip to content

Feat/add exists method - #709

Open
SaiDevaHarshaR wants to merge 2 commits into
ollama:mainfrom
SaiDevaHarshaR:feat/add-exists-method
Open

Feat/add exists method#709
SaiDevaHarshaR wants to merge 2 commits into
ollama:mainfrom
SaiDevaHarshaR:feat/add-exists-method

Conversation

@SaiDevaHarshaR

Copy link
Copy Markdown

What this does

Adds exists() method to check if a model is available locally
without manually catching exceptions or iterating through list().

Usage

import ollama
ollama.exists("llama3.2")   # True
ollama.exists("not-a-model") # False

Why

Fixes #640 - users wanted a clean way to check model availability
without try/except boilerplate in their own code.

How

Calls show() internally and returns True if it succeeds,
False if it raises an exception.

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.

feat: add client.exists() or client.has_model() method to check if a model is available locally

1 participant