ollama / ollama-python

Ollama Python library
https://ollama.com
MIT License
2.71k stars 223 forks source link

Fixes URL parsing when basic auth is included in the URL. #61

Open lemeur opened 4 months ago

lemeur commented 4 months ago

Ollama may be protected by a reverse proxy enforcing basic auth.

When the Ollama URL contains basic auth elements, ollama-python removed them from the URL leading in a HTTP 401 ERROR.

from ollama import Client
client = Client(host='http://<username>:<password>@<ip>:<port>/')

This patch fixes the parsing of the URL so that basic auth elements are not removed.

ChaseMB00 commented 1 month ago

Ran into this Problem today. Would be really nice if this pull request would be accepted

TheMcSebi commented 4 weeks ago

I also ran into this issue quite a while ago and I can also confirm that this solves the issue.

TheMcSebi commented 3 weeks ago

I would really love to see this fix on main

TheMcSebi commented 2 weeks ago

Thanks for the approval!