Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] .env file ignored #426

Closed
1 task
cobble2gether opened this issue Feb 19, 2024 · 4 comments
Closed
1 task

[BUG] .env file ignored #426

cobble2gether opened this issue Feb 19, 2024 · 4 comments

Comments

@cobble2gether
Copy link

Description

I'm trying out big-agi with docker and and have tried preconfiguring my API keys and an Ollama host, all of which I successfully configured after running the official image. I cloned the repo (with --depth 1) and created .env file in the big-agi folder, as per the docs. I pasted the variables I was interested in - Ollama_host (I entered it the same as in UI - http://10.69.1.10:11434) and I also set Google API, PSE ID and ElevenLabs API Keys.
I ran docker build -t big-agi . && docker run -d ... as per usual, specifying the built image.

I access the interface via the internal IP and all seems fine.
Then, I navigate to internal IP in incognito window and it prompts me to configure models and everything, even though I specified them in the .env file.

Is this just me being stupid or do I have to specify env variables explicitly with -e flags when using docker run?

I'm still learning docker so apologies for any dumb statements.

Also, I assume the chat history and configuration is saved in the browser cookies since using aonther browser is the same as accessing via incognito.

If I specify a database, will the data persist when I expose the UI to the internet?

I want to share big-agi with a friend to test something out and am using nginx-proxy-manager and have defined ACL for big-agi.

I'm not sure what I'm doing wrong.

Thanks in advance.

Device and browser

Server: docker on Ubuntu 20.04 lxc running on Proxmox
Client: Windows 10 VM with Chrome

Screenshots and more

No response

Willingness to Contribute

  • 🙋‍♂️ Yes, I would like to contribute a fix.
@cobble2gether cobble2gether added the type: bug Something isn't working label Feb 19, 2024
@enricoros
Copy link
Owner

Please paste a screenshot from the incognito window - as the Model Dialog will show up once for every installation (including the first time it's open on an incognito window).

Note: .env is used for docker compose I believe. For docker you should start the container with the option:
--env-file .env

Does it work with --env-file ? Docker support in big AGI is well tested, so it's probably a container launch issue.

@enricoros enricoros added requested-info and removed type: bug Something isn't working labels Feb 20, 2024
@enricoros
Copy link
Owner

Hi @cobble2gether. Have you made progress?

The "model configuration" window will open up once per browser, as the client needs to fetch the models list despite the API key being in the server environment variables. It's a dynamic call to update the models. That dialog can be safely closed once the models are refreshed, and it's how the product works today.

If the API keys are set, there will be a 'dot' in the model vendors: such as (for my heavily configured install):
image

Let me know if you make progress and whether to keep the bug open.

@cobble2gether
Copy link
Author

Hi, sorry for not replying sooner. I've been buried with work. I believe you can close this issue as it wasn't a bug then. Though I will check what you described above. I don't have OpenAI key, just the local Ollama and localai models. I did figure out that if in the first dialog I choose "add" and choose my preconfigured Ollama and refresh the model list, it does show them. Though I would prefer it if I could make it a bit more user-friendly for my friends by automatically switching to Ollama and removing the confusing OpenAI option.

I'm sure the .env file will work on my next build since manually specifying env variables with docker run did work. I just didn't know about the .env file option for docker. If you don't mind, I'll (probably over the weekend) add a few notes to the relevant docs to clarify things for beginners like me.

Also, adding the ability to use SAPI or user's machine's speech APIs for TTS would be great.

If I get time I'll try playing around with some additions like that.

By the way, I tried using big-agi from work via my domain registered and managed through Cloudflare. I used the Developer 2 Persona and often when I would ask specific questions about the code, it would try to produce some output which I would get a CAUTION message about and have the option to click "Show page". Clicking on it would produce a Gateway timeout error

I've attached an export of a conversation that produced it just now and have replaced my domain with mydomain.com. Hopefully that is anonymous enough :)
conversation-untitled-083dd981-69be-493b-bee4-74cffb772e51.md
conversation-untitled-083dd981-69be-493b-bee4-74cffb772e51.md

@enricoros
Copy link
Owner

If you don't mind, I'll (probably over the weekend) add a few notes to the relevant docs to clarify things for beginners like me.

Would appreciate the contribution and will merge it.

Though I would prefer it if I could make it a bit more user-friendly for my friends by automatically switching to Ollama and removing the confusing OpenAI option.

Opened #436 to perform this.

Gateway timeout:

This seems to be caused by the fact that the machine running the cloudflare big-AGI backend (website) cannot access the ollama running instance. The #418 seems to be related to this, in particular if we could have a desktop client, it cloud connect to the ollama running on localhost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants