diff --git a/examples/README.md b/examples/README.md index ccd3f9a1..3237f609 100644 --- a/examples/README.md +++ b/examples/README.md @@ -42,6 +42,10 @@ See [ollama/docs/api.md](https://github.com/ollama/ollama/blob/main/docs/api.md) - [list.py](list.py) +### Ollama Show - Display downloaded model's properties and capabilities +- [show.py](show.py) + + ### Ollama ps - Show model status with CPU/GPU usage - [ps.py](ps.py) @@ -55,7 +59,6 @@ Requirement: `pip install tqdm` - [create.py](create.py) - ### Ollama Embed - Generate embeddings with a model - [embed.py](embed.py) diff --git a/examples/show.py b/examples/show.py new file mode 100644 index 00000000..de6af1af --- /dev/null +++ b/examples/show.py @@ -0,0 +1,11 @@ +from ollama import ShowResponse, show + +response: ShowResponse = show("gemma3") +print(f"Modified at: {response.modified_at}\n") +print(f"Template: {response.template}\n") +print(f"Modelfile: {response.modelfile}\n") +print(f"License: {response.license}\n") +print(f"Details: {response.details}\n") +print(f"Model Info: {response.modelinfo}\n") +print(f"Parameters: {response.parameters}\n") +print(f"Capabilities: {response.capabilities}\n") \ No newline at end of file diff --git a/ollama/_types.py b/ollama/_types.py index dfeafcf1..24eddd6c 100644 --- a/ollama/_types.py +++ b/ollama/_types.py @@ -505,6 +505,8 @@ class ShowResponse(SubscriptableBaseModel): parameters: Optional[str] = None + capabilities: Optional[list[str]] = None + class ProcessResponse(SubscriptableBaseModel): class Model(SubscriptableBaseModel):