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

Set OPENAI_API_KEY/OPENAI_API_BASE in .env file #706

Closed
Batyan45 opened this issue Jun 22, 2024 · 3 comments
Closed

Set OPENAI_API_KEY/OPENAI_API_BASE in .env file #706

Batyan45 opened this issue Jun 22, 2024 · 3 comments
Labels
bug Something isn't working fixed

Comments

@Batyan45
Copy link

Issue

In Aider 0.38.0, I was able to set the OPENAI_API_KEY and OPENAI_API_BASE variables in the .env file and load them using the "env-file" field in the .aider.conf.yml file.

For 0.39.0 it is not working:

Model gpt-4o: Missing these environment variables:
- OPENAI_API_KEY
https://aider.chat/docs/llms/warnings.html
Model gpt-3.5-turbo: Missing these environment variables:
- OPENAI_API_KEY
https://aider.chat/docs/llms/warnings.html

Can it be fixed?

Version and model info

Aider v.0.39.0

@paul-gauthier
Copy link
Owner

Thanks for trying aider and filing this issue. There was a bug introduced in a recent change to how aider loads .env files. I just pushed a fix.

The change is available in the main branch. You can get it by installing the latest version from github:

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, let me know if it works better for you.

@paul-gauthier paul-gauthier added bug Something isn't working fixed labels Jun 22, 2024
@Batyan45
Copy link
Author

Works great, thanks!

@paul-gauthier
Copy link
Owner

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants