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

import ollama error when os.environ["HTTP_PROXY"] = "socks5h://xxx" #424

Open
wugifer opened this issue Jan 17, 2025 · 0 comments
Open

import ollama error when os.environ["HTTP_PROXY"] = "socks5h://xxx" #424

wugifer opened this issue Jan 17, 2025 · 0 comments

Comments

@wugifer
Copy link

wugifer commented Jan 17, 2025

I use ollama in a proxy environment, so os.environ["HTTP_PROXY"] = "socks5h://xxx", But

  1. proxy is only used by other requests functions
  2. ollama connect to http://127.0.0.1 without proxy

I use this code to create ollama client, so I can control the proxy:
client = ollama.Client(host="http://127.0.0.1:11434", trust_env = False)

But in ollama/__init__.py, this code cause error:
_client = Client()

the error is:
ValueError: Unknown scheme for proxy URL URL('socks5h://

cause by this judge:
if url.scheme not in ("http", "https", "socks5"):

So, my question is, could:

  1. ollama support socks5h? or
  2. remove "_client = Client()" by default?
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