ollama-python
ollama-python copied to clipboard
Fixes URL parsing when basic auth is included in the URL.
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.