ollama-python
ollama-python copied to clipboard
[Bug] Does not provide capabilities for /show api call
Hi, please notice that ollama api docs says it provides capabilities via /show endpoint.
https://github.com/ollama/ollama/blob/main/docs/api.md#response-26
But this python sdk does not support that. Without it, it's hard to determine which models have what kind of capabilities.
Same. My workaround is to do something like this:
model_name = "codestral"
model_info = ollama_client._request_raw("POST", "/api/show",json={"name":model_name}).json()
print(model_info["capabilities"])
Hello,
Please consider my pull request to add capabilities in show api
https://github.com/ollama/ollama-python/pull/511
here is the sample python code
from ollama import ShowResponse, show
model_details: ShowResponse = show("gemma3")
if "embedding" in model_details.capabilities:
print("Embedding model")
elif "vision" in model_details.capabilities:
print("Vision model")
elif "completion" in model_details.capabilities:
print("Chat model")
else:
print("Unknown", model_details.capabilities)