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

Error handling custom Ollama URLs with subpath ending with / #229

Open
PierreMesure opened this issue Oct 31, 2024 · 5 comments · May be fixed by #230
Open

Error handling custom Ollama URLs with subpath ending with / #229

PierreMesure opened this issue Oct 31, 2024 · 5 comments · May be fixed by #230
Labels
bug Something isn't working enhancement New feature or request

Comments

@PierreMesure
Copy link
Contributor

PierreMesure commented Oct 31, 2024

Hi,

Thank you so much for such a user-friendly extension, I just discovered it and I had to play a bit with the settings to get it to work with my Ollama instance. It isn't available at localhost:11434, I have it at a custom URL and custom path: https://xxx/ollama_api/.

I use Caddy to map the subpath to Ollama and I have other services running at https://xxx so querying https://xxx/ollama_api will return a 404. Querying https://xxx/ollama_api/ returns Ollama is running.

Now this configuration seems to mess a little bit with your extension as it tries to remove the / at the end. I can see my models in the list (because the extension successfully queries https://xxx/ollama_api/api/tags) but I still have an error message in the middle of the window because that central panel tries to query https://xxx/ollama_api.

image

My guess it that the culprit is this function. I understand the need for it but maybe it could be made a little smarter? Like testing the URL first with the "/" and removing it only if the address doesn't work? 😊

@PierreMesure
Copy link
Contributor Author

I just tried to use http://esvaiws01.esv.local:8081/ollama_api///////// and it now works! 😁

image

@n4ze3m
Copy link
Owner

n4ze3m commented Oct 31, 2024

Oh no, I trimmed the ending slash because the Ollama API causes issues if the user adds it! 😊 Glad you found a solution—is it working? This is a great find for others with a similar issue.

@PierreMesure
Copy link
Contributor Author

Yes, adding lots of //// works great but I think it could be good to test before trimming. Another option could be to trim only if there is no subpath in address. That would continue to solve headaches for most using Ollams locally with default address (localhost:11434) and people with a subpath are hopefully a bit more aware of their exact settings.

@n4ze3m n4ze3m added bug Something isn't working enhancement New feature or request labels Oct 31, 2024
@n4ze3m
Copy link
Owner

n4ze3m commented Oct 31, 2024

I'll add a setting where you can disable this :) in an upcoming version

@PierreMesure PierreMesure linked a pull request Oct 31, 2024 that will close this issue
@PierreMesure
Copy link
Contributor Author

Another option could be to trim only if there is no subpath in address.

I submitted a PR that does just that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants