updated model warnings and docs

This commit is contained in:
Paul Gauthier 2024-06-25 14:56:02 -07:00
parent bcabd50414
commit 17f7297d86
2 changed files with 35 additions and 33 deletions

View file

@ -551,7 +551,7 @@ def sanity_check_model(io, model):
if not model.info: if not model.info:
show = True show = True
io.tool_output( io.tool_output(
f"Model {model}: Unknown model, context window size and token costs unavailable." f"Model {model}: Unknown context window size and costs, using sane defaults."
) )
possible_matches = fuzzy_match_models(model.name) possible_matches = fuzzy_match_models(model.name)
@ -560,12 +560,12 @@ def sanity_check_model(io, model):
for match in possible_matches: for match in possible_matches:
fq, m = match fq, m = match
if fq == m: if fq == m:
io.tool_error(f"- {m}") io.tool_output(f"- {m}")
else: else:
io.tool_error(f"- {m} ({fq})") io.tool_output(f"- {m} ({fq})")
if show: if show:
io.tool_error(urls.model_warnings) io.tool_output(f"For more info, see: {urls.model_warnings}\n")
def fuzzy_match_models(name): def fuzzy_match_models(name):

View file

@ -1,18 +1,38 @@
## Unknown context window size and token costs
```
Model foobar: Unknown context window size and costs, using sane defaults.
```
*You can probably ignore the unknown context window size and token costs warning.*
If you specify a model that aider has never heard of, you will get
this warning.
This means aider doesn't know the context window size and token costs
for that model.
Aider will use an unlimited context window and assume the model is free,
so this is not usually a significant problem.
Aider tries to sanity check that it is configured correctly ## Did you mean?
to work with the LLM you specified:
- It checks to see that all required environment variables are set for the model. These variables are required to configure things like API keys, API base URLs, etc. If aider isn't familiar with the model you've specified,
These settings are required to be correct. it will suggest similarly named models.
- It checks a metadata database to look up the context window size and token costs for the model. This helps
It's usually OK if this extra metadata isn't available. in the case where you made a typo or mistake when specifying the model name.
Sometimes one or both of these checks will fail, so aider will issue ```
some of the following warnings. Model gpt-5o: Unknown context window size and costs, using sane defaults.
Did you mean one of these?
- gpt-4o
```
## Missing environment variables ## Missing environment variables
You need to set the listed environment variables.
Otherwise you will get error messages when you start chatting with the model.
``` ```
Model azure/gpt-4-turbo: Missing these environment variables: Model azure/gpt-4-turbo: Missing these environment variables:
- AZURE_API_BASE - AZURE_API_BASE
@ -20,8 +40,6 @@ Model azure/gpt-4-turbo: Missing these environment variables:
- AZURE_API_KEY - AZURE_API_KEY
``` ```
You need to set the listed environment variables.
Otherwise you will get error messages when you start chatting with the model.
## Unknown which environment variables are required ## Unknown which environment variables are required
@ -34,24 +52,8 @@ Aider is unable verify the environment because it doesn't know
which variables are required for the model. which variables are required for the model.
If required variables are missing, If required variables are missing,
you may get errors when you attempt to chat with the model. you may get errors when you attempt to chat with the model.
You can look in the You can look in the [aider's LLM documentation](/docs/llms.html)
[litellm provider documentation](https://docs.litellm.ai/docs/providers) or the
[litellm documentation](https://docs.litellm.ai/docs/providers)
to see if the required variables are listed there. to see if the required variables are listed there.
## Context window size and token costs unavailable.
```
Model foobar: Unknown model, context window size and token costs unavailable.
```
If you specify a model that aider has never heard of, you will get an
"unknown model" warning.
This means aider doesn't know the context window size and token costs
for that model.
Some minor functionality will be limited when using such models, but
it's not really a significant problem.
Aider will also try to suggest similarly named models,
in case you made a typo or mistake when specifying the model name.