Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Connect to Localhost by Default When OLLAMA_HOST is Set to 0.0.0.0 #407

Open
Tryanks opened this issue Jan 6, 2025 · 0 comments

Comments

@Tryanks
Copy link

Tryanks commented Jan 6, 2025

I set the environment variable OLLAMA_HOST to 0.0.0.0:11434, allowing it to serve the local network. At the same time, I am running some local applications written in Python on the same machine. I noticed that I cannot directly use from ollama import chat; instead, I must first specify client = Client("http://localhost:11434") before I can use client.chat.

I suspect this is because the ollama-python library also reads the OLLAMA_HOST environment variable and uses it as the default access address.

A possible fix would be to add a special case for handling 0.0.0.0 in the _parse_host method.

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

No branches or pull requests

1 participant