mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Unable to set Client host, httpx.ConnectError #149
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 @tdimitch on GitHub (Oct 3, 2024).
Hi there!
I'm trying to run an instance of ollama Client and set the host. As shown in the documentation (https://github.com/ollama/ollama-python?tab=readme-ov-file#custom-client) I see the code should work, but prociding any host but the OLLAMA_HOST environment variable (or 11434 as default if OLLAMA_HOST does not exist), gives me
httpx.ConnectError: [Errno 111] Connection refusedI put the code of an interactive session:
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
After reading about ollama, I tried to change the OLLAMA_HOST env variable:
The same happens in a Windows machine, but in this case the error is a bit different:
@frieda-huang commented on GitHub (Oct 4, 2024):
Same issue. In addition, when I run the script, it sometimes works and sometimes doesn't.
@TaosLezz commented on GitHub (Oct 20, 2024):
You need to check message "Ollama is running" in http://localhost:11434/. If you don't have this message, you need to open cmd and run the command ollama run "yourmodel"
@RXZAN commented on GitHub (Oct 21, 2024):
I also meet the same issue.But I run ollama service in server side , when I curl http://my_server_ip:11434/ in my local machine, it can show "Ollama is running"
@ParthSareen commented on GitHub (Nov 21, 2024):
Hey @tdimitch - this seems to be a connection issue between the deployed Ollama instance and the python code. Is this all running locally or is there a cloud-deployed instance?