Open scenaristeur opened 1 year ago
Hi @scenaristeur Here are all the examples that we have https://github.com/go-skynet/LocalAI/tree/master/examples. Is there any one of them can help you on this?
Hi @scenaristeur. According to api.go CORS env should be set to true in order to apply CORS_ALLOW_ORIGINS=... you set
@scenaristeur have you found any solution for this?
no i didn't have time for this , do you have the same issue ?
Yes, same problem. I will probably download the LLM directly to avoid this kind of frustration.
Add --cors at the end of the command to resolve this issue.
sudo docker run --net=host --name local-ai -ti -v $PWD/models:/models localai/localai:latest-aio-cpu --models-path /models --context-size 700 --threads 4 --cors
I'm bugging form 4 hours. LocalAi is running on laptop CPU . and i and to post to the API from a Vuejs app. all works fine from node :
gives me chat-completion response and image generation
But in the browser, only the GET works : nothing for the POST: basic fetch or axios.
with axios, I got a 405 CORS error, even when settings "CORS_ALLOW_ORIGINS=*" in .env and in docker-compose. with fetch i got 422 error unprocessable data Did someone succed to do that ? Could someone give me a simple browser example for getting a chat completion and a image generation from a browser page ?