go-skynet / LocalAI-frontend

85 stars 23 forks source link

feat: add nginx so we can bypass the cors error #6

Open sbe-arg opened 6 months ago

sbe-arg commented 6 months ago

Bumped a few dependencies. Adds nginx with an example so it can run cross hosts. Adds dependabot

Dhruvgera commented 6 months ago

I don't think this is needed any longer, editing .env from localai-backend to set the cors props directly fixes the issue

sbe-arg commented 6 months ago

Its not just a cors problem is a cross host set this allows to have local ai and this container in 2 different machines/server

I tried many ways to make this work cross host and nothing worked without nginx

Can you add a working example?

Dhruvgera commented 6 months ago

Its not just a cors problem is a cross host set this allows to have local ai and this container in 2 different machines/server

I tried many ways to make this work cross host and nothing worked without nginx

Can you add a working example?

I just tested it today, all you've to do is when hosting LocalAI, go to .env, uncomment the cors and galleries variables. That will fix the issue

bioshazard commented 5 months ago
LOCALAI_GALLERIES=[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}]

# CORS settings
LOCALAI_CORS=true
LOCALAI_CORS_ALLOW_ORIGINS=*

This did not fix it for me. Might be PEBKAC, but no way in logs with debug on to verify that setting. I know that's a LocalAI issue rather than with this repo, but I figured to mention others are running into this problem.

Dhruvgera commented 5 months ago
LOCALAI_GALLERIES=[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}]

# CORS settings
LOCALAI_CORS=true
LOCALAI_CORS_ALLOW_ORIGINS=*

This did not fix it for me. Might be PEBKAC, but no way in logs with debug on to verify that setting. I know that's a LocalAI issue rather than with this repo, but I figured to mention others are running into this problem.

I'm unable to reproduce this issue, hence my reluctance towards adding unnecessary docker images. If more users report of this, I'll add in nginx