ollama / ollama-js

Ollama JavaScript library
https://ollama.ai
MIT License
1.56k stars 103 forks source link

CORS issue on firefox browsers #80

Closed mrdjohnson closed 1 month ago

mrdjohnson commented 2 months ago

When using ollama/browser and trying to pull models or show information my users get CORS issues. I have replicated this issue on firefox browsers. I am able to load models initially because I am calling it manually, but when getting the same list of models through ollamajs they run into CORS issues.

I am not sure what is going on but it is strange that a manual fetch works (in my case) but a fetch through the library does not

any advisement would be helpful!

BruceMacD commented 2 months ago

Hi @mrdjohnson, are there any specific errors in the browser console logs? That could help with debugging, we had some CORS changes recently so this could have effected this.

mrdjohnson commented 2 months ago
image
mrdjohnson commented 2 months ago
image
BruceMacD commented 1 month ago

Thanks for the update @mrdjohnson, I was able to reproduce this. I have a change up (#4086) that will fix the issue.

mrdjohnson commented 1 month ago

Looking forward to the change!!

are those config options modifiable by the user? or do i need to wait for this PR to be merged?

BruceMacD commented 1 month ago

@mrdjohnson this change is going to need the PR to be merged

mrdjohnson commented 1 month ago

@BruceMacD Congrats on the merge!

Will this be fixed automatically when the next version of ollama comes out?

BruceMacD commented 1 month ago

It should be, just needs an ollama version update when the next release it out.

mrdjohnson commented 1 month ago

Okay! I'm still a little lost on how calling the api manually works, but calling it through ollamajs did not work, but looking forward to the change!