diff --git a/aider/args.py b/aider/args.py index 6b97ea13f..bc3e36ff0 100644 --- a/aider/args.py +++ b/aider/args.py @@ -140,7 +140,7 @@ def get_parser(default_config_files, git_root): metavar="MODEL_FILE", default=None, help={ - "File with model definitions to be registered for info/cost, json formated", + "Specify a file with model definitions (info and cost) to be registered with litellm, json formated", " {" " \"gpt-4\": {", " \"max_tokens\": 8192,", diff --git a/website/docs/install/optional.md b/website/docs/install/optional.md index c33a8980e..f79ac856b 100644 --- a/website/docs/install/optional.md +++ b/website/docs/install/optional.md @@ -26,6 +26,27 @@ Put a line in it like this to specify your api key: openai-api-key: sk-... ``` +## Registering Models not in litellm + +You can register models info and cost 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", + }, +} +``` + ## Enable Playwright Aider supports adding web pages to the chat with the `/web ` command. diff --git a/website/docs/options.md b/website/docs/options.md index 27d2df7c2..7d70e58d2 100644 --- a/website/docs/options.md +++ b/website/docs/options.md @@ -103,6 +103,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`