mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 17:15:23 -04:00
ollama.pull() fails with ResponseError but ollama pull on the command line works fine
#215
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ananda1996ai on GitHub (Feb 6, 2025).
I have a basic Ollama service running on 127.0.0.1:11434 as default, and I am trying to use the model "mistral-small:24b-instruct-2501-q4_K_M".
When trying to use the python library to
ollama.pull("mistral-small:24b-instruct-2501-q4_K_M")I get a ResponseError:
However, when I try
ollama pull mistral-small:24b-instruct-2501-q4_K_Mfrom the command line it works as expected, pulling the model files. Why is it working from the CLI but fails from the python library?Am I doing something wrong? New to Ollama, so any help will be much appreciated.
@ParthSareen commented on GitHub (Feb 10, 2025):
When you say it works from the command line - is the cURL request working?
Something like:
Trying to see if this is a python issue or network - I'm pretty sure it's network related given the result you got back.
@SSdevelop commented on GitHub (Oct 22, 2025):
I am getting the same error. I can chat with the model through CLI by running
ollama run <MODEL>. However, when I try to connect with API, I am getting the same HTML error file.