Merge pull request #666 from caseymcc/register_model

Allow models to be registered with litellm
This commit is contained in:
paul-gauthier 2024-06-11 13:20:02 -07:00 committed by GitHub
commit 2f6e360188
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 78 additions and 0 deletions

View file

@ -26,6 +26,28 @@ Put a line in it like this to specify your api key:
openai-api-key: sk-...
```
## Registering Models not in litellm
You can register model info and costs with litellm by adding one or more of the following files
* {HomeDir}/.aider.models.json
* {GitRoot}/.aider.models.json
* {CWD}/.aider.models.json
* or via the command line argument `model-file`
If the files above exists, they will be loaded in that order. Files loaded last will take priority.
The json file should be formated as follows
```
{
"gpt-4": {
"max_tokens": 8192,
"input_cost_per_token": 0.00003,
"output_cost_per_token": 0.00006,
"litellm_provider": "openai",
"mode": "chat",
},
}
```
see [litellm's model definitions](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json) for examples
## Enable Playwright
Aider supports adding web pages to the chat with the `/web <url>` command.

View file

@ -108,6 +108,10 @@ Aliases:
List known models which match the (partial) MODEL name
Environment variable: `AIDER_MODELS`
### `--model-file FILE`
Specify a file with model definitions (info and cost) to be registered with litellm, json formated. See [Registering Models not in litellm](install/optional.md#registering_models_not_in_litellm) for the format
Environment variable: `AIDER_MODEL_FILE`
### `--openai-api-base OPENAI_API_BASE`
Specify the api base url
Environment variable: `OPENAI_API_BASE`