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

Using LocalGPT with external server which hosts ollama (via ngrok) #11

Closed
pfrankov opened this issue Jan 17, 2024 · 16 comments
Closed

Using LocalGPT with external server which hosts ollama (via ngrok) #11

pfrankov opened this issue Jan 17, 2024 · 16 comments

Comments

@pfrankov
Copy link
Owner

Originally posted by 0xSynth January 17, 2024
Hi, I can't run ollama mixtral model on my desktop, however I have a server to which I would like to connect (via ngrok), however for some reason I can't, is it a bug? Can you add this?

Screenshot 2024-01-17 at 11 20 56

@pfrankov
Copy link
Owner Author

@0xSynth I moved the discussion to an issue. Please provide some more information: how do you run Ollama on your desktop? Have you tried to send regular curl to the server?

@ghost
Copy link

ghost commented Jan 17, 2024

Thank you for quick response, I run obsydian with local-gpt plugin on my desktop. The server is running ollama, the server is accessible via a ngrok tunel and it works fine with https://github.com/kghandour/Ollama-SwiftUI, also requests are accessible via an API - I've tried requests via curl.

I had an issue with CORS, but I've managed to resolve it, however the problem still persists. The response I'm getting is

{error: "model 'orca-mini' not found, try pulling it first"}
However I'm not able to configure it for some reason in the local-gpt settings, as the refresh button basically does nothing. No request to fetch model list is being sent. Having an input where the default model name could be typed in would help in those kind of situations.

Screenshot 2024-01-17 at 22 38 39

@pfrankov
Copy link
Owner Author

Thank you for the additional info!
I've just tried with ngrok ngrok http 11434 and it it works for me right from the box:
image
image
Please double check the settings, try to remove plugin and install again, try to update Ollama.

Having an input where the default model name could be typed in would help in those kind of situations.

It's pointless to specify a model name using input — if you can't get a list of available models, then Ollama is unavailable.

@ghost
Copy link

ghost commented Jan 18, 2024

Supper strange, for me none of those GET /api/tags requests are hitting the server. I only get POST generate when trying to use the plugin in one of the articles I'm writting.

Screenshot 2024-01-18 at 12 31 01

@ghost
Copy link

ghost commented Jan 18, 2024

The console does not show any GET /api/tags request from the app being set to the server either.

Screenshot 2024-01-18 at 12 47 49 Screenshot 2024-01-18 at 12 49 52

@ghost
Copy link

ghost commented Jan 18, 2024

I have downloaded the orca-mini and as a result I am able to use local-gpt, however the problem still persists - not being able to choose a model in the settings page.

Screenshot 2024-01-18 at 14 53 49

@pfrankov
Copy link
Owner Author

Have you tried to kill Ollama client and run Ollama in serve mode OLLAMA_ORIGINS='*' ollama serve?

@ghost
Copy link

ghost commented Jan 18, 2024

Yes I did, without OLLAMA_ORIGINS='*' the requests return with 403, for me the issue is that for some reason after updating the API URL, the request to /api/tags is not being sent, as a result I am not able to specify model different than orca-mini which is the default one.

@pfrankov
Copy link
Owner Author

the request to /api/tags is not being sent

That's expected: Obsidian's internal requests doesn't shown in Network tab. And errors from it also not visible in Console.

Have you tried with regular http://localhost:11434? It seems that even this is failing with an error (while it shouldn't with with OLLAMA_ORIGINS='*' ollama serve)
image

@pfrankov
Copy link
Owner Author

Kapture.2024-01-18.at.23.33.04.mp4

@ghost
Copy link

ghost commented Jan 18, 2024

I was talking about the server side also, on your screenshots they are visible, however for some reason those are not sent to my server.
Regarding the localhost, it just an error when I had the Ollama URL set to localhost

@pfrankov
Copy link
Owner Author

it just an error when I had the Ollama URL set to localhost

Nothing happen after that?

Let's exclude possible causes one by one: could you try to install and use the same scenario with the BMO Chatbot plugin?

@ghost
Copy link

ghost commented Jan 18, 2024

Thank you for your recording, for me this refresh default model does not work for some reason, the request are not being sent to the server, at the same time I am able to run the plugin with orca-mini and requests are hitting the server

@ghost
Copy link

ghost commented Jan 18, 2024

Ok, I think we are onto something, with BMO Chatbot I am getting an error

Screenshot 2024-01-18 at 21 46 47

The website when visible with incognito mode looks like this, maybe this is the issue? On the other hand you are also on free plan and it does work for you...
Maybe the solution would be to hit the GET api/tags directly without verifying the GET / if ngrok is used, or as they suggest ngrok-skip-browser-warning request?

Screenshot 2024-01-18 at 21 46 33

@ghost
Copy link

ghost commented Jan 22, 2024

Ok, in the end I've decided to fork your plugin and change the default model to the one I like to use - works fine, however the issue still remains.

@quantarion
Copy link

I would drop support for the Ollama protocol and retain only OpenAI. All engines used for locally deploying LLMs have OpenAI compatibility modes in one form or another, including Ollama. The development effort would be much more useful if focused on adding new features rather than debugging VPNs, firewalls, tunnels, and similar issues. Regarding tunneling, I confirm that SSH tunneling works fine with Ollama (in OpenAI compatibility mode), Exllama (TabbyAPI), Aphrodite, and llama.cpp (in OpenAI mode).

@pfrankov pfrankov closed this as completed Aug 3, 2024
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

2 participants