ollama-python icon indicating copy to clipboard operation
ollama-python copied to clipboard

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

Open lemeur opened this issue 1 year ago • 6 comments

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.

lemeur avatar Feb 12 '24 20:02 lemeur

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

ChaseMB00 avatar May 29 '24 11:05 ChaseMB00

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

TheMcSebi avatar Jun 04 '24 12:06 TheMcSebi

I would really love to see this fix on main

TheMcSebi avatar Jun 07 '24 22:06 TheMcSebi

Thanks for the approval!

TheMcSebi avatar Jun 13 '24 11:06 TheMcSebi

Any updates here ?

p-arndt avatar Aug 26 '24 08:08 p-arndt

No updates? I'm still relying on installing a custom wheel in internal deployments

TheMcSebi avatar Sep 10 '24 17:09 TheMcSebi