Jeffser / Alpaca

An Ollama client made with GTK4 and Adwaita
GNU General Public License v3.0
116 stars 18 forks source link

bearer token support #116

Closed theoden8 closed 2 days ago

theoden8 commented 4 days ago

Good afternoon,

It would greatly increase the usability for me (and many other self-hosters of ollama) if it were possible to use an authentication token. This would allow me to use ollama without ssh -L or ssh -R functionality.

It is already implemented in many clients for other platforms, and would be great to see it in Alpaca.

Kind regards

Jeffser commented 3 days ago

Hi thanks for the suggestion, I'm not quite sure how bearer token works on ollama, Alpaca directly talks to the server using the url, is the token something that needs to be parsed to the server on the parameters?

theoden8 commented 2 days ago

Hi, thank you for your reply.

Essentially if you add to the header (when forming an http/https request):

authorization: Bearer $token

Then all proxies for ollama will be happy.

Jeffser commented 2 days ago

I did it https://github.com/Jeffser/Alpaca/commit/527f7b445253775c98bb47affad89314e1b49856

But I don't have a way to test it so once it gets released on the next version please report it if it doesn't work, thanks

theoden8 commented 1 day ago

I tried building the preview it with gnome-builder/flatpak-builder but received:

Error: module python3-pillow: Child process exited with code 137

I'll wait for the next release