mckaywrigley / chatbot-ui

AI chat for every model.
https://chatbotui.com
MIT License
28.29k stars 7.85k forks source link

OpenAI API Key #655

Closed hubingzhong123 closed 8 months ago

hubingzhong123 commented 1 year ago

I Create a .env.local file in the root of the repo with my OpenAI API Key, but still need to fill in my OpenAI key on the page,what should I do to solve this problem?

gsgoldma commented 1 year ago

same problem, ill probably go to an earlier commit of chatbot that doesnt have that setting weird that this wasn't a problem yesterday for me. considering both haven't been updated in two days, not sure what happened since then

johnnykang commented 1 year ago

you should create a file named .env , instead of .env.local.

gsgoldma commented 1 year ago

you should create a file named .env , instead of .env.local.

i had .local too, since thats what it says to have in the gpt-llama.cpp setup guide for chatbot-ui installation

i deleted the .local like you suggested, but it hasn't had any effect on the API key within the app not recognizing the path to the llama.cpp models

upasch commented 1 year ago

As it is a NEXT application, the environment keys should be i .env.local. If you use other keys then the OpenAI Keys, you might need them global inside the app. In that case one must use 'NEXTPUBLIC' before the original ENV key. Example with Firebase Authentication:

FIREBASE Credencials

NEXT_PUBLIC_FIREBASE_API_KEY= NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN= NEXT_PUBLIC_FIREBASE_PROJECT_ID= NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET= NEXT_PUBLIC_FIREBASE_SENDER_ID= NEXT_PUBLIC_FIREBASE_APP_ID=

These are examples if one try to implement an external authentication into Chatbot-UI.

Same if one wants to implement SUPABASE Auth and DB;)