aider
aider copied to clipboard
Command Request: /models /model /m To change Model during active chat
Hi there, First of all let me say thank you! Aider is amazing :) and im happy to finally start using it
One thing i am missing though is to be able to change the model during a run
asside of using --model gpt-4-1106-preview (which should be the default now as it has way longer context, but also just more powerful and cheaper)
i want to run a /models command and see something like:
| Alias | Model | Input | Output |
|---|---|---|---|
| 4 | gpt-4-1106-preview | $0.01 / 1K tokens | $0.03 / 1K tokens |
| 4v | gpt-4-1106-vision-preview | $0.01 / 1K tokens | $0.03 / 1K tokens |
| 3 | gpt-3.5-turbo-1106 | $0.0010 / 1K tokens | $0.0020 / 1K tokens |
| px | ruu3f-perplexityai | $0.0 / with limits | $0.0 / with limits |
| -- | Hopefully add more in the future | -- | -- |
and then be able to use /model 3 or /m 3 to quickly switch to the cheap gpt3.5 turbo
Switching between /m 3 and /m 4 would be super beneficial.
I'll try to make a pr if i can manage, but maybe you'll be able to do it faster
Wait i got an idea, i'll try to use aider... (wonder when will it have online search abilities to be able to get the updated list of models...)
For now i'll give it this issue and see what it can do
Thanks a lot and all the best!
UPDATE: - I have used Aider to make this change, for that i copied this issue (filtering commentery) to current_mission.txt into the aider repo i forked, and ran aider and added it. I had to do some back and forth with it a bit to fix and improve some things (maybe in the future it could use the vision api+automation to make sure the changes look good)
I have tested it locally and it seems to do exactly what it supposed to including correct estimates in /tokens 😄
and have checked my openai usage and indeed i can switch models. 👍
Checkout PR #401
Please accept the PR or rewrite these features in the way you see fit. Thanks! ❤️
Spoonfeeding Aider (rest of current_mission.txt): [x] Added a models_table.py with the model's table
- Add /models and /model commands (also /m short for /model) [x] First line should show the current model being used, then print out the models table [x] models dict should be imported from models_table [x] table should be with these headings in order: Alias, Model (key), Input Cost (str: input_cost+cost_desc), Input Cost (str: input_cost+cost_desc), Description (of the model)
- /model or /m {alias} to change model
[x] should change the actual model used for api
[x] should update the data displayed when checking /tokens
[x] default model should be 4,
/mwithout any model specified should toggle models 3 and 4
## PS I have some other command ideas like
/tree - Shows tree dir of the git project (cwd highlighted)
/undo or /z (Revert changes to code)
/pick 2 (clears most of the chat context except the last N user msgs)
# i'll post if i think of more
@joshuavial @paul-gauthier Have you seen my PR on this? #401 (2 weeks ago) Thanks and all the best
@fire17 I hadn't - thanks for the ping. I love the feature and have posted some comments in the PR and as well as a PR to your main branch with some fixes for it to work with openrouter.
Damn, been a long time with this half finished now - sorry for that. I've got some projects wrapping up this week and am happy to prioritise getting it done.
I just put up a small PR #581 that implements a /model <model-name> command to switch the active model. It preserves the chat context and the files which have been added. It also autocompletes the model names from the full list of available models.
The PR also adds a /models <search> command to search the list of available models.