Skip to content

client: support verbose model information in show - #802

Open
xqw2001-11 wants to merge 1 commit into
ollama:mainfrom
xqw2001-11:feat/show-verbose
Open

xqw2001-11 wants to merge 1 commit into
ollama:mainfrom
xqw2001-11:feat/show-verbose

Conversation

@xqw2001-11

Copy link
Copy Markdown

The Ollama API supports requesting full metadata arrays from POST /api/show. For GGUF models this lets callers inspect fields such as tokenizer.ggml.tokens. API reference · Server implementation in v0.40.16

Add a keyword-only verbose parameter to Client.show and AsyncClient.show. Calling show(model) still sends only model. Passing verbose=True or verbose=False sends the corresponding JSON boolean.

info = ollama.show('gemma4', verbose=True)
tokens = info.modelinfo['tokenizer.ggml.tokens']

The six regression cases call both clients against a local HTTP test server, match the POST body for each option, and check the decoded tokenizer metadata.

Tested on Python 3.12 with hatch test -py 3.12 -c (128 passed). Hatch formatting and lint checks, uv lock --check, and the requirements export comparison also passed.

This branch has not been deployed

No deployments
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.

1 participant