mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
Merge pull request #666 from caseymcc/register_model
Allow models to be registered with litellm
This commit is contained in:
commit
2f6e360188
5 changed files with 78 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue