n4ze3m / page-assist

Use your locally running AI models to assist you in your web browsing
https://chromewebstore.google.com/detail/page-assist-a-web-ui-for/jfgfiigpkhlkbnfnbobbkinehhfdhndo
MIT License
1.61k stars 154 forks source link

Unable to connect to Ollama #45

Open rmd1433 opened 7 months ago

rmd1433 commented 7 months ago

Hello!

I'm experiencing an issue connecting to the local Ollama server while using your page-assist extension. The application displays "Unable to connect to Ollama 🦙" message and a red icon.

I've tried various recommendations from the documentation and discussions, but the problem persists.

Could you provide instructions for running the local Ollama server or suggest other solutions to this issue?

Thank you for your assistance!

n4ze3m commented 7 months ago

Hey, sorry about that. Is your Ollama server running locally? If not, you need to run it. You can download Ollama from here: https://ollama.com/download

oatmealm commented 7 months ago

I'm jumping in to ask about using a remote installation of ollama. When trying something like http://10.0.0.10:11434 as the url_base it can't find the server. The server is accessible remotely otherwise from other client, like ios or cli.

oatmealm commented 7 months ago

Just to say that the project is really impressive (I've tried with a local server as well). thanks!

n4ze3m commented 7 months ago

I'm jumping in to ask about using a remote installation of ollama. When trying something like http://10.0.0.10:11434 as the url_base it can't find the server. The server is accessible remotely otherwise from other client, like ios or cli.

Usually, page assist works with the remote server. I will try to debug it. Maybe it's because of this issue: https://github.com/ollama/ollama/issues/2335

Just to say that the project is really impressive (I've tried with a local server as well). thanks!

thanks :)

oatmealm commented 7 months ago

Great! I've been looking around the console and I do see 403 forbidden... which is strange. OLLAMA_ORIGINS is set with a wildcard... I'm seeing same problem with Lumos

oatmealm commented 7 months ago

some more info... I'm running ollama manually on the server to trace:

OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=chrome-extension://* ollama serve

image image

n4ze3m commented 7 months ago

🤔 can you try this command

OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve
oatmealm commented 7 months ago

It did. Again, amazing work. Really enjoy using the app. Would love to help in testing if you need help or feedback.

n4ze3m commented 6 months ago

Hey guys, a new fix has been released for this issue. All you need to do is go to Settings > Ollama setting and enable custom origin URL, which will resolve the issue.

image

for more information: https://github.com/n4ze3m/page-assist/blob/main/docs/connection-issue.md

MicPec commented 6 months ago

I am having trouble getting Ollama to work on my Vivaldi browser. Ollama is up and running, everything works fine on Firefox, but I can't seem to establish a connection on Vivaldi. Screenshot from 2024-05-14 20-56-52

n4ze3m commented 6 months ago

Hey @MicPec

I just tested it on the Vivaldi browser (windows) , and it seems to be working fine. Can you try turning on this setting from the web UI settings > Ollama setting? It may resolve the issue.

for more details: https://www.youtube.com/watch?v=fydtRnxjfJU or https://github.com/n4ze3m/page-assist/blob/main/docs/connection-issue.md#solutions

image

MicPec commented 6 months ago

Thanks for quick response. I did try this before, no luck. BTW this is the Linux machine. Open WebUI and Lobe Chat are working fine on Vivaldi so connection is blocked from extension. Maybe some vivaldi hidden settings, but I could't find.

n4ze3m commented 6 months ago

Hey @MicPec , I will test on my Linux machine with Vivaldi. For OpenWebUI and LobreChat, they have a server, but for PageAssist, everything happens in the browser, which is why this issue exists

Another fix is by changing Custom origin url in advance settings to chrome-extension://jfgfiigpkhlkbnfnbobbkinehhfdhndo, then you need to restart Ollama with the following environment variable, which may work:

OLLAMA_ORIGINS=chrome-extension://* ollama serve

source: https://github.com/ollama/ollama/issues/2335#issue-2116323257

MicPec commented 6 months ago

I've managed to run it, the problem was completely different. The connection was blocked by uBlock 🤦🏻‍♂️, so I had to add jfgfiigpkhlkbnfnbobbkinehhfdhndo to the exceptions lists. Now everything works fine. Thanks for Your help anyway

oatmealm commented 6 months ago

Talking of which, and it's not specific to page-assist, I had to change OLLAMA_ORIGINS=chrome-extension://* to a promiscuous * , since nothing was able to connect any more remotely, or locally like from this extension (I'm using Firefox).

n4ze3m commented 6 months ago

Hey @oatmealm

In the latest version of Page Assist, there is an advanced URL configuration. All you need to do is enable Enable or Disable Custom Origin URL.

image

oatmealm commented 6 months ago

Is it needed when OLLAMA_ORIGINS is set correctly?

n4ze3m commented 6 months ago

Is it needed when OLLAMA_ORIGINS is set correctly?

Not needed :) An alternative method only

ben-xD commented 4 months ago

Talking of which, and it's not specific to page-assist, I had to change OLLAMA_ORIGINS=chrome-extension://* to a promiscuous * , since nothing was able to connect any more remotely, or locally like from this extension (I'm using Firefox).

Firefox uses moz-extension://, but that didn't work (I tried Environment="OLLAMA_ORIGINS=https://ollama-ui.github.io,app://obsidian.md*,chrome-extension://*,moz-extension://*")

My settings that work (the last lines is just so i use a HDD with lots of space for all the models):

[Service]
Environment="OLLAMA_HOST=0.0.0.0"
Environment="OLLAMA_ORIGINS=*"
Environment="OLLAMA_MODELS=/home/ben/ollama/models"
uygur55 commented 1 month ago

Hi, I have two internet browser, Edge and Chrome. I did put page-assist extension to Chrome. page-assist can not connect to my local ollama running image image. i did try "Page Assist, there is an advanced URL configuration. All you need to do is enable Enable or Disable Custom Origin URL." still not working if you can help me Thanks

n4ze3m commented 1 month ago

Hey, sorry about the issue, @uygur55 . Is Ollama and the extension you're trying to connect on the same computer, or are they on two different ones?

uygur55 commented 1 month ago

on the same computer. thanks

n4ze3m commented 1 month ago

Hey @uygur55, that's weird. It usually connects automatically. If possible, can you add this to your environment variable: OLLAMA_ORIGINS=chrome-extension://* [0] and restart Ollama? Usually, this resolves the issue. Please let me know if it works.

[0] https://github.com/ollama/ollama/issues/2335#issue-2116323257

uygur55 commented 1 month ago

Hi, i followed the way . still not working.

n4ze3m commented 1 month ago

Hey @uygur55, that’s unfortunate. Since you added the env, could you enable the advanced URL option? Please add chrome-extension://jfgfiigpkhlkbnfnbobbkinehhfdhndo as the URL. Make sure to save and refresh the page afterward in the tab.

Also, if you use uBlock, make sure to add the extension ID 'jfgfiigpkhlkbnfnbobbkinehhfdhndo,' as MicPec pointed out in the comment above

image

uygur55 commented 1 month ago

image image image still not working

n4ze3m commented 1 month ago

Hey @uygur55, You don't need to add ollama serve in the environment; only chrome-extension://* is needed. Make sure to restart Ollama after saving. :) I will investigate further and let you know if there is a fix.

uygur55 commented 1 month ago

After i changed to "chrome-extension://*"

Now it is WORKING. Thanks

clickbrain commented 1 week ago

I had page assist working previously with my remote server which is on a subdomain: https://ollamasubdomain.somedomain.com. I've now tried it on both Arc and Brave and still getting Unable to connect. I have it in custom origin in Advanced settings and not working. Any help appreciated.