mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-22 12:34:59 +00:00
Merge branch 'main' of github.com:Aider-AI/aider
This commit is contained in:
commit
a29ae3ef37
11 changed files with 149 additions and 35 deletions
|
@ -143,7 +143,7 @@ def get_parser(default_config_files, git_root):
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--thinking-tokens",
|
"--thinking-tokens",
|
||||||
type=str,
|
type=str,
|
||||||
help="Set the thinking token budget for models that support it (default: not set)",
|
help="Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--verify-ssl",
|
"--verify-ssl",
|
||||||
|
|
|
@ -1541,7 +1541,7 @@ class Commands:
|
||||||
return self.cmd_editor(args)
|
return self.cmd_editor(args)
|
||||||
|
|
||||||
def cmd_think_tokens(self, args):
|
def cmd_think_tokens(self, args):
|
||||||
"Set the thinking token budget (supports formats like 8096, 8k, 10.5k, 0.5M)"
|
"Set the thinking token budget (supports formats like 8096, 8k, 10.5k, 0.5M, or 0 to disable)"
|
||||||
model = self.coder.main_model
|
model = self.coder.main_model
|
||||||
|
|
||||||
if not args.strip():
|
if not args.strip():
|
||||||
|
@ -1559,10 +1559,14 @@ class Commands:
|
||||||
value = args.strip()
|
value = args.strip()
|
||||||
model.set_thinking_tokens(value)
|
model.set_thinking_tokens(value)
|
||||||
|
|
||||||
formatted_budget = model.get_thinking_tokens()
|
# Handle the special case of 0 to disable thinking tokens
|
||||||
budget = model.get_raw_thinking_tokens()
|
if value == "0":
|
||||||
|
self.io.tool_output("Thinking tokens disabled.")
|
||||||
|
else:
|
||||||
|
formatted_budget = model.get_thinking_tokens()
|
||||||
|
budget = model.get_raw_thinking_tokens()
|
||||||
|
self.io.tool_output(f"Set thinking token budget to {budget:,} tokens ({formatted_budget}).")
|
||||||
|
|
||||||
self.io.tool_output(f"Set thinking token budget to {budget:,} tokens ({formatted_budget}).")
|
|
||||||
self.io.tool_output()
|
self.io.tool_output()
|
||||||
|
|
||||||
# Output announcements
|
# Output announcements
|
||||||
|
|
|
@ -93,11 +93,11 @@ MODEL_ALIASES = {
|
||||||
"3": "gpt-3.5-turbo",
|
"3": "gpt-3.5-turbo",
|
||||||
# Other models
|
# Other models
|
||||||
"deepseek": "deepseek/deepseek-chat",
|
"deepseek": "deepseek/deepseek-chat",
|
||||||
"flash": "gemini/gemini-2.5-flash-preview-04-17",
|
"flash": "gemini/gemini-2.5-flash",
|
||||||
"quasar": "openrouter/openrouter/quasar-alpha",
|
"quasar": "openrouter/openrouter/quasar-alpha",
|
||||||
"r1": "deepseek/deepseek-reasoner",
|
"r1": "deepseek/deepseek-reasoner",
|
||||||
"gemini-2.5-pro": "gemini/gemini-2.5-pro-preview-06-05",
|
"gemini-2.5-pro": "gemini/gemini-2.5-pro",
|
||||||
"gemini": "gemini/gemini-2.5-pro-preview-06-05",
|
"gemini": "gemini/gemini-2.5-pro",
|
||||||
"gemini-exp": "gemini/gemini-2.5-pro-exp-03-25",
|
"gemini-exp": "gemini/gemini-2.5-pro-exp-03-25",
|
||||||
"grok3": "xai/grok-3-beta",
|
"grok3": "xai/grok-3-beta",
|
||||||
"optimus": "openrouter/openrouter/optimus-alpha",
|
"optimus": "openrouter/openrouter/optimus-alpha",
|
||||||
|
@ -794,6 +794,7 @@ class Model(ModelSettings):
|
||||||
"""
|
"""
|
||||||
Set the thinking token budget for models that support it.
|
Set the thinking token budget for models that support it.
|
||||||
Accepts formats: 8096, "8k", "10.5k", "0.5M", "10K", etc.
|
Accepts formats: 8096, "8k", "10.5k", "0.5M", "10K", etc.
|
||||||
|
Pass "0" to disable thinking tokens.
|
||||||
"""
|
"""
|
||||||
if value is not None:
|
if value is not None:
|
||||||
num_tokens = self.parse_token_value(value)
|
num_tokens = self.parse_token_value(value)
|
||||||
|
@ -805,9 +806,17 @@ class Model(ModelSettings):
|
||||||
if self.name.startswith("openrouter/"):
|
if self.name.startswith("openrouter/"):
|
||||||
if "extra_body" not in self.extra_params:
|
if "extra_body" not in self.extra_params:
|
||||||
self.extra_params["extra_body"] = {}
|
self.extra_params["extra_body"] = {}
|
||||||
self.extra_params["extra_body"]["reasoning"] = {"max_tokens": num_tokens}
|
if num_tokens > 0:
|
||||||
|
self.extra_params["extra_body"]["reasoning"] = {"max_tokens": num_tokens}
|
||||||
|
else:
|
||||||
|
if "reasoning" in self.extra_params["extra_body"]:
|
||||||
|
del self.extra_params["extra_body"]["reasoning"]
|
||||||
else:
|
else:
|
||||||
self.extra_params["thinking"] = {"type": "enabled", "budget_tokens": num_tokens}
|
if num_tokens > 0:
|
||||||
|
self.extra_params["thinking"] = {"type": "enabled", "budget_tokens": num_tokens}
|
||||||
|
else:
|
||||||
|
if "thinking" in self.extra_params:
|
||||||
|
del self.extra_params["thinking"]
|
||||||
|
|
||||||
def get_raw_thinking_tokens(self):
|
def get_raw_thinking_tokens(self):
|
||||||
"""Get formatted thinking token budget if available"""
|
"""Get formatted thinking token budget if available"""
|
||||||
|
|
|
@ -348,6 +348,42 @@
|
||||||
"supports_tool_choice": true,
|
"supports_tool_choice": true,
|
||||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||||
},
|
},
|
||||||
|
"openrouter/google/gemini-2.5": {
|
||||||
|
"max_tokens": 8192,
|
||||||
|
"max_input_tokens": 1048576,
|
||||||
|
"max_output_tokens": 64000,
|
||||||
|
"max_images_per_prompt": 3000,
|
||||||
|
"max_videos_per_prompt": 10,
|
||||||
|
"max_video_length": 1,
|
||||||
|
"max_audio_length_hours": 8.4,
|
||||||
|
"max_audio_per_prompt": 1,
|
||||||
|
"max_pdf_size_mb": 30,
|
||||||
|
"input_cost_per_image": 0,
|
||||||
|
"input_cost_per_video_per_second": 0,
|
||||||
|
"input_cost_per_audio_per_second": 0,
|
||||||
|
"input_cost_per_token": 0,
|
||||||
|
"input_cost_per_character": 0,
|
||||||
|
"input_cost_per_token_above_128k_tokens": 0,
|
||||||
|
"input_cost_per_character_above_128k_tokens": 0,
|
||||||
|
"input_cost_per_image_above_128k_tokens": 0,
|
||||||
|
"input_cost_per_video_per_second_above_128k_tokens": 0,
|
||||||
|
"input_cost_per_audio_per_second_above_128k_tokens": 0,
|
||||||
|
"output_cost_per_token": 0,
|
||||||
|
"output_cost_per_character": 0,
|
||||||
|
"output_cost_per_token_above_128k_tokens": 0,
|
||||||
|
"output_cost_per_character_above_128k_tokens": 0,
|
||||||
|
"litellm_provider": "openrouter",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_system_messages": true,
|
||||||
|
"supports_function_calling": true,
|
||||||
|
"supports_vision": true,
|
||||||
|
"supports_audio_input": true,
|
||||||
|
"supports_video_input": true,
|
||||||
|
"supports_pdf_input": true,
|
||||||
|
"supports_response_schema": true,
|
||||||
|
"supports_tool_choice": true,
|
||||||
|
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
|
||||||
|
},
|
||||||
"openrouter/x-ai/grok-3-beta": {
|
"openrouter/x-ai/grok-3-beta": {
|
||||||
"max_tokens": 131072,
|
"max_tokens": 131072,
|
||||||
"max_input_tokens": 131072,
|
"max_input_tokens": 131072,
|
||||||
|
@ -519,6 +555,61 @@
|
||||||
"supported_output_modalities": ["text"],
|
"supported_output_modalities": ["text"],
|
||||||
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro-preview"
|
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro-preview"
|
||||||
},
|
},
|
||||||
|
"gemini/gemini-2.5-pro": {
|
||||||
|
"max_tokens": 65536,
|
||||||
|
"max_input_tokens": 1048576,
|
||||||
|
"max_output_tokens": 65536,
|
||||||
|
"max_images_per_prompt": 3000,
|
||||||
|
"max_videos_per_prompt": 10,
|
||||||
|
"max_video_length": 1,
|
||||||
|
"max_audio_length_hours": 8.4,
|
||||||
|
"max_audio_per_prompt": 1,
|
||||||
|
"max_pdf_size_mb": 20,
|
||||||
|
"input_cost_per_token": 0.00000125,
|
||||||
|
"input_cost_per_token_above_200k_tokens": 0.0000025,
|
||||||
|
"output_cost_per_token": 0.00001,
|
||||||
|
"output_cost_per_token_above_200k_tokens": 0.000015,
|
||||||
|
"litellm_provider": "gemini",
|
||||||
|
"mode": "chat",
|
||||||
|
"rpm": 2000,
|
||||||
|
"tpm": 8000000,
|
||||||
|
"supports_system_messages": true,
|
||||||
|
"supports_function_calling": true,
|
||||||
|
"supports_vision": true,
|
||||||
|
"supports_response_schema": true,
|
||||||
|
"supports_audio_output": false,
|
||||||
|
"supports_tool_choice": true,
|
||||||
|
"supported_modalities": ["text", "image", "audio", "video"],
|
||||||
|
"supported_output_modalities": ["text"],
|
||||||
|
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-pro"
|
||||||
|
},
|
||||||
|
"gemini/gemini-2.5-flash": {
|
||||||
|
"max_tokens": 65536,
|
||||||
|
"max_input_tokens": 1048576,
|
||||||
|
"max_output_tokens": 65536,
|
||||||
|
"max_images_per_prompt": 3000,
|
||||||
|
"max_videos_per_prompt": 10,
|
||||||
|
"max_video_length": 1,
|
||||||
|
"max_audio_length_hours": 8.4,
|
||||||
|
"max_audio_per_prompt": 1,
|
||||||
|
"max_pdf_size_mb": 20,
|
||||||
|
"input_cost_per_token": 0.00000035,
|
||||||
|
"input_cost_per_audio_token": 0.000001,
|
||||||
|
"output_cost_per_token": 0.0000025,
|
||||||
|
"litellm_provider": "gemini",
|
||||||
|
"mode": "chat",
|
||||||
|
"rpm": 10000,
|
||||||
|
"tpm": 8000000,
|
||||||
|
"supports_system_messages": true,
|
||||||
|
"supports_function_calling": true,
|
||||||
|
"supports_vision": true,
|
||||||
|
"supports_response_schema": true,
|
||||||
|
"supports_audio_output": false,
|
||||||
|
"supports_tool_choice": true,
|
||||||
|
"supported_modalities": ["text", "image", "audio", "video"],
|
||||||
|
"supported_output_modalities": ["text"],
|
||||||
|
"source": "https://ai.google.dev/gemini-api/docs/pricing#gemini-2.5-flash"
|
||||||
|
},
|
||||||
"together_ai/Qwen/Qwen3-235B-A22B-fp8-tput": {
|
"together_ai/Qwen/Qwen3-235B-A22B-fp8-tput": {
|
||||||
"input_cost_per_token": 0.0000002,
|
"input_cost_per_token": 0.0000002,
|
||||||
"output_cost_per_token": 0.0000006,
|
"output_cost_per_token": 0.0000006,
|
||||||
|
|
|
@ -533,28 +533,10 @@
|
||||||
edit_format: diff-fenced
|
edit_format: diff-fenced
|
||||||
use_repo_map: true
|
use_repo_map: true
|
||||||
|
|
||||||
- name: gemini/gemini-1.5-pro-exp-0827
|
|
||||||
edit_format: diff-fenced
|
|
||||||
use_repo_map: true
|
|
||||||
|
|
||||||
- name: gemini/gemini-exp-1206
|
- name: gemini/gemini-exp-1206
|
||||||
edit_format: diff
|
edit_format: diff
|
||||||
use_repo_map: true
|
use_repo_map: true
|
||||||
|
|
||||||
- name: gemini/gemini-exp-1114
|
|
||||||
edit_format: diff
|
|
||||||
use_repo_map: true
|
|
||||||
|
|
||||||
- name: gemini/gemini-exp-1121
|
|
||||||
edit_format: diff
|
|
||||||
use_repo_map: true
|
|
||||||
|
|
||||||
- name: vertex_ai/gemini-pro-experimental
|
|
||||||
edit_format: diff-fenced
|
|
||||||
use_repo_map: true
|
|
||||||
|
|
||||||
- name: gemini/gemini-1.5-flash-exp-0827
|
|
||||||
|
|
||||||
- name: gemini/gemini-2.0-flash-exp
|
- name: gemini/gemini-2.0-flash-exp
|
||||||
edit_format: diff
|
edit_format: diff
|
||||||
use_repo_map: true
|
use_repo_map: true
|
||||||
|
@ -1462,6 +1444,21 @@
|
||||||
weak_model_name: gemini/gemini-2.5-flash-preview-04-17
|
weak_model_name: gemini/gemini-2.5-flash-preview-04-17
|
||||||
accepts_settings: ["thinking_tokens"]
|
accepts_settings: ["thinking_tokens"]
|
||||||
|
|
||||||
|
- name: gemini/gemini-2.5-flash
|
||||||
|
overeager: true
|
||||||
|
edit_format: diff-fenced
|
||||||
|
use_repo_map: true
|
||||||
|
use_temperature: false
|
||||||
|
accepts_settings: ["thinking_tokens"]
|
||||||
|
|
||||||
|
- name: gemini/gemini-2.5-pro
|
||||||
|
overeager: true
|
||||||
|
edit_format: diff-fenced
|
||||||
|
use_repo_map: true
|
||||||
|
weak_model_name: gemini/gemini-2.5-flash
|
||||||
|
use_temperature: false
|
||||||
|
accepts_settings: ["thinking_tokens"]
|
||||||
|
|
||||||
- name: vertex_ai/gemini-2.5-pro-preview-05-06
|
- name: vertex_ai/gemini-2.5-pro-preview-05-06
|
||||||
edit_format: diff-fenced
|
edit_format: diff-fenced
|
||||||
use_repo_map: true
|
use_repo_map: true
|
||||||
|
@ -1490,6 +1487,13 @@
|
||||||
weak_model_name: openrouter/google/gemini-2.0-flash-001
|
weak_model_name: openrouter/google/gemini-2.0-flash-001
|
||||||
accepts_settings: ["thinking_tokens"]
|
accepts_settings: ["thinking_tokens"]
|
||||||
|
|
||||||
|
- name: openrouter/google/gemini-2.5-pro
|
||||||
|
overeager: true
|
||||||
|
edit_format: diff-fenced
|
||||||
|
use_repo_map: true
|
||||||
|
weak_model_name: openrouter/google/gemini-2.5-flash
|
||||||
|
accepts_settings: ["thinking_tokens"]
|
||||||
|
|
||||||
#- name: openrouter/qwen/qwen3-235b-a22b
|
#- name: openrouter/qwen/qwen3-235b-a22b
|
||||||
# system_prompt_prefix: "/no_think"
|
# system_prompt_prefix: "/no_think"
|
||||||
# use_temperature: 0.7
|
# use_temperature: 0.7
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
## Set the reasoning_effort API parameter (default: not set)
|
## Set the reasoning_effort API parameter (default: not set)
|
||||||
#reasoning-effort: xxx
|
#reasoning-effort: xxx
|
||||||
|
|
||||||
## Set the thinking token budget for models that support it (default: not set)
|
## Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||||
#thinking-tokens: xxx
|
#thinking-tokens: xxx
|
||||||
|
|
||||||
## Verify the SSL cert when connecting to models (default: True)
|
## Verify the SSL cert when connecting to models (default: True)
|
||||||
|
|
|
@ -173,7 +173,7 @@ Set the reasoning_effort API parameter (default: not set)
|
||||||
Environment variable: `AIDER_REASONING_EFFORT`
|
Environment variable: `AIDER_REASONING_EFFORT`
|
||||||
|
|
||||||
### `--thinking-tokens VALUE`
|
### `--thinking-tokens VALUE`
|
||||||
Set the thinking token budget for models that support it (default: not set)
|
Set the thinking token budget for models that support it. Use 0 to disable. (default: not set)
|
||||||
Environment variable: `AIDER_THINKING_TOKENS`
|
Environment variable: `AIDER_THINKING_TOKENS`
|
||||||
|
|
||||||
### `--verify-ssl`
|
### `--verify-ssl`
|
||||||
|
|
|
@ -25,7 +25,7 @@ aider --model r1
|
||||||
```
|
```
|
||||||
|
|
||||||
Inside the aider chat, you can use `/thinking-tokens 4k` or `/reasoning-effort low` to change
|
Inside the aider chat, you can use `/thinking-tokens 4k` or `/reasoning-effort low` to change
|
||||||
the amount of reasoning.
|
the amount of reasoning. Use `/thinking-tokens 0` to disable thinking tokens.
|
||||||
|
|
||||||
The rest of this document describes more advanced details which are mainly needed
|
The rest of this document describes more advanced details which are mainly needed
|
||||||
if you're configuring aider to work with a lesser known reasoning model or one served
|
if you're configuring aider to work with a lesser known reasoning model or one served
|
||||||
|
@ -47,6 +47,7 @@ You can use the `--thinking-tokens` switch to request
|
||||||
the model use a certain number of thinking tokens.
|
the model use a certain number of thinking tokens.
|
||||||
This switch is useful for Sonnet 3.7.
|
This switch is useful for Sonnet 3.7.
|
||||||
You can specify the token budget like "1024", "1k", "8k" or "0.01M".
|
You can specify the token budget like "1024", "1k", "8k" or "0.01M".
|
||||||
|
Use "0" to disable thinking tokens.
|
||||||
|
|
||||||
### Model compatibility and settings
|
### Model compatibility and settings
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,12 @@ After you authenticate a file appears:
|
||||||
~/.config/github-copilot/apps.json
|
~/.config/github-copilot/apps.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On Windows the config can be found in:
|
||||||
|
|
||||||
|
```
|
||||||
|
~\AppData\Local\github-copilot\apps.json
|
||||||
|
```
|
||||||
|
|
||||||
Copy the `oauth_token` value – that string is your `OPENAI_API_KEY`.
|
Copy the `oauth_token` value – that string is your `OPENAI_API_KEY`.
|
||||||
|
|
||||||
*Note:* tokens created by the Neovim **copilot.lua** plugin (old `hosts.json`) sometimes lack the
|
*Note:* tokens created by the Neovim **copilot.lua** plugin (old `hosts.json`) sometimes lack the
|
||||||
|
|
|
@ -52,10 +52,9 @@ will confirm you wish to opt-in to analytics.
|
||||||
- `--no-analytics` will turn off analytics for the current session.
|
- `--no-analytics` will turn off analytics for the current session.
|
||||||
- By default, if you don't provide `--analytics` or `--no-analytics`,
|
- By default, if you don't provide `--analytics` or `--no-analytics`,
|
||||||
aider will enable analytics for a random subset of users.
|
aider will enable analytics for a random subset of users.
|
||||||
|
Such randomly selected users will be asked if they wish to opt-in to analytics.
|
||||||
This will never happen if you have permanently disabled analytics
|
This will never happen if you have permanently disabled analytics
|
||||||
with `--analytics-disable`.
|
with `--analytics-disable`.
|
||||||
Randomly selected users will be asked if they wish to opt-in to analytics.
|
|
||||||
|
|
||||||
|
|
||||||
## Opting in
|
## Opting in
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ cog.out(get_help_md())
|
||||||
| **/save** | Save commands to a file that can reconstruct the current chat session's files |
|
| **/save** | Save commands to a file that can reconstruct the current chat session's files |
|
||||||
| **/settings** | Print out the current settings |
|
| **/settings** | Print out the current settings |
|
||||||
| **/test** | Run a shell command and add the output to the chat on non-zero exit code |
|
| **/test** | Run a shell command and add the output to the chat on non-zero exit code |
|
||||||
| **/think-tokens** | Set the thinking token budget (supports formats like 8096, 8k, 10.5k, 0.5M) |
|
| **/think-tokens** | Set the thinking token budget (supports formats like 8096, 8k, 10.5k, 0.5M, or 0 to disable) |
|
||||||
| **/tokens** | Report on the number of tokens used by the current chat context |
|
| **/tokens** | Report on the number of tokens used by the current chat context |
|
||||||
| **/undo** | Undo the last git commit if it was done by aider |
|
| **/undo** | Undo the last git commit if it was done by aider |
|
||||||
| **/voice** | Record and transcribe voice input |
|
| **/voice** | Record and transcribe voice input |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue