When the OpenAI key is provided as an ENV variable, no models are shown and chat is not working
Closed this issue · 5 comments
Provide the OpenAI key as an ENV variable (using env.local file) and clear the local storage to emulate a new user.
In this case no models are shown and it's impossible to chat.
Possible solutions:
- fix it to load the models (best option)
- add a default set of modules in store-llms.ts (workaround that I'm currently using to make it work)
@syberkitten Hi this is working for me, I can't reproduce. Are you using the Docker deployment method? (I use either the Vercel automatic deployment, or a local Nodejs server while developing)
Hi @enricoros Apologies for long delay, some personal and work issues got me strung up...
For me I reproduce just starting with Incognito window, since you have no settings you will be brought the Models selection window inside preferences, but without any API key you cannot refresh the models nor can you use the chat.
I've made a local version where I'm actually injecting all my models "hardcoded" into the store-llms, was simpler then figuring out how to reload the models automatically using the server provided key.
Please let me know when you reproduce
ps. The thing here is that if you already have the app working on a browser that you already set the openai key, you will not be able to reproduce, another way is to delete all your stored local-storage data for the site.
Don't do it unless you don't care to lose your data :)
Hi, ok i need to update the issue.
Actually if you go to the models and refresh the models (having the server side api key)
they will be show.
But if you do not refresh the models (that is click the models refresh icon) you will not be able to chat.
So basically the issue is not a show stopper, thus if you guide the users to go to models page and click refresh
it will work. otherwise the chat button remains "gray" and unclickable.
Hi @enricoros Apologies for long delay, some personal and work issues got me strung up...
For me I reproduce just starting with Incognito window, since you have no settings you will be brought the Models selection window inside preferences, but without any API key you cannot refresh the models nor can you use the chat.
I've made a local version where I'm actually injecting all my models "hardcoded" into the store-llms, was simpler then figuring out how to reload the models automatically using the server provided key.
Please let me know when you reproduce
ps. The thing here is that if you already have the app working on a browser that you already set the openai key, you will not be able to reproduce, another way is to delete all your stored local-storage data for the site.
Don't do it unless you don't care to lose your data :)
I would be curious how your modified store-llms.ts looks as I'm looking to do something similar(e.g. hard code the main models and set default to gpt 4)
Closing this original issue, as it's much better now. In the future we'll need full server-side models configuration, with no options on the client side.