Updated AZURE env assignments in main, docs

This commit is contained in:
Paul Gauthier 2024-04-22 09:45:06 -07:00
parent 7b2dfaaa31
commit a9925d58af
2 changed files with 25 additions and 29 deletions

View file

@ -596,9 +596,9 @@ def main(argv=None, input=None, output=None, force_git_root=None):
if args.openai_api_base: if args.openai_api_base:
os.environ["OPENAI_API_BASE"] = args.openai_api_base os.environ["OPENAI_API_BASE"] = args.openai_api_base
if args.openai_api_version: if args.openai_api_version:
os.environ["AZURE_API_VERSION"] = args.openai_api_version os.environ["OPENAI_API_VERSION"] = args.openai_api_version
if args.openai_api_type: if args.openai_api_type:
os.environ["AZURE_API_TYPE"] = args.openai_api_type os.environ["OPENAI_API_TYPE"] = args.openai_api_type
if args.openai_organization_id: if args.openai_organization_id:
os.environ["OPENAI_ORGANIZATION"] = args.openai_organization_id os.environ["OPENAI_ORGANIZATION"] = args.openai_organization_id

View file

@ -18,11 +18,11 @@ For example, GPT-3.5 is just barely capable of reliably *editing code* to provid
interactive "pair programming" style workflow. interactive "pair programming" style workflow.
So you should expect that models which are less capable than GPT-3.5 may struggle to perform well with aider. So you should expect that models which are less capable than GPT-3.5 may struggle to perform well with aider.
## Providers & models ## Configuring models for aider
- [OpenAI](#openai) - [OpenAI](#openai)
- [Anthropic](#anthropic) - [Anthropic](#anthropic)
- [Llama3](#llama3) - [Llama3](#llama3-70b)
- [Cohere](#cohere) - [Cohere](#cohere)
- [Azure](#azure) - [Azure](#azure)
- [OpenAI compatible APIs](#openai-compatible-apis) - [OpenAI compatible APIs](#openai-compatible-apis)
@ -64,46 +64,42 @@ You can use `aider --model <model-name>` to use any other Anthropic model.
For example, if you want to use a specific version of Opus For example, if you want to use a specific version of Opus
you could do `aider --model claude-3-opus-20240229`. you could do `aider --model claude-3-opus-20240229`.
## Llama3 ## CROQ
Groq offers *free* API access to the Llama 3 70B model, which works Groq currently offers *free* API access.
They host the Llama 3 70B model, which works
well with aider and is comparable to GPT-3.5 in code editing performance. well with aider and is comparable to GPT-3.5 in code editing performance.
You need to provide your Groq API key in the `GROQ_API_KEY`
environment variable.
- **Llama3 70B**: `aider --model groq/llama3-70b-8192`
### Llama3 70B
```
export GROQ_API_KEY=<your-key-goes-here>
aider --model groq/llama3-70b-8192
```
## Cohere ## Cohere
Cohere offers *free* API access to their Command-R+ model with reasonably Cohere offers *free* API access with a reasonable rate limit.
low rate limits. Command-R+ works well with aider Their Command-R+ works well with aider
as a *very basic* coding assistant. as a *very basic* coding assistant.
To work with Cohere's models, you need to provide your **Command-R+**:
[Cohere API key](https://dashboard.cohere.com/)
in the `COHERE_API_KEY` environment variable.
- **Command-R+**: `aider --model command-r-plus` ```
export COHERE_API_KEY=<your-key-goes-here>
aider --model command-r-plus
```
## Azure ## Azure
Aider can be configured to connect to the OpenAI models on Azure. Aider can be configured to connect to the OpenAI models on Azure.
Run aider with the following arguments to connect to Azure:
``` ```
--model azure/<your_deployment_name> export AZURE_API_KEY=your-key-goes-here
--openai-api-key your-key-goes-here export AZURE_API_VERSION=2023-05-15
--openai-api-base https://example-endpoint.openai.azure.com export AZURE_API_BASE=https://example-endpoint.openai.azure.com
--openai-api-version 2023-05-15 aider --model azure/<your_deployment_name>
```
Or you can run `aider --model azure/<your_deployment_name>` and
populate the following environment variables instead:
```
OPENAI_API_KEY=your-key-goes-here
OPENAI_API_BASE=https://example-endpoint.openai.azure.com
OPENAI_API_VERSION=2023-05-15
``` ```
See the See the