Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
20.94k stars 1.93k forks source link

Azure env variables are ignored #2057

Open lucaregini opened 1 week ago

lucaregini commented 1 week ago

Issue

I have installed aider ( version aider 0.59.1) in Ubuntu. CPython 3.10.12

I followed the installation manual and exported the following variables:

export AZURE_API_KEY=mykey export AZURE_API_VERSION=2024-08-01-preview export AZURE_API_BASE=https://mybase.openai.azure.com/

aider still looks for an OPENAI key and I get this error message as soon as I try to do anything:

"Unexpected error: litellm.AuthenticationError: AuthenticationError: OpenAIException - The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable"

Version and model info

No response

izikeros commented 2 days ago

In the documentation: https://aider.chat/docs/llms/other.html there is mention that "other models" including Azure OpenAI are supported via LiteLLM and for Azure, there is AZURE_AI_API_KEY environmental variable expected. Not sure abut the rest (version, base).

paul-gauthier commented 2 days ago

Thanks for trying aider and filing this issue. This doc may be helpful:

https://aider.chat/docs/llms/azure.html