Skip to content

Commit

Permalink
Merge branch 'Aider-AI:main' into moa
Browse files Browse the repository at this point in the history
  • Loading branch information
gembancud authored Feb 25, 2025
2 parents 4912f9e + b6e46d6 commit dc0717a
Show file tree
Hide file tree
Showing 33 changed files with 910 additions and 498 deletions.
19 changes: 19 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Release history

### Aider v0.75.1

- Added support for `openrouter/anthropic/claude-3.7-sonnet`

### Aider v0.75.0

- Basic support for Claude 3.7 Sonnet
- Use `--model sonnet` to use the new 3.7
- Thinking support coming soon.
- Bugfix to `/editor` command.
- Aider wrote 46% of the code in this release.

### Aider v0.74.3

- Downgrade streamlit dependency to avoid threading bug.
- Added support for tree-sitter language pack.
- Added openrouter/o3-mini-high model configuration.
- Added build.gradle.kts to special files for Kotlin project support, by Lucas Shadler.

### Aider v0.74.2

- Prevent more than one cache warming thread from becoming active.
Expand Down
2 changes: 1 addition & 1 deletion aider/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from packaging import version

__version__ = "0.74.3.dev"
__version__ = "0.75.2.dev"
safe_version = __version__

try:
Expand Down
2 changes: 1 addition & 1 deletion aider/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_parser(default_config_files, git_root):
const=opus_model,
help=f"Use {opus_model} model for the main chat",
)
sonnet_model = "claude-3-5-sonnet-20241022"
sonnet_model = "anthropic/claude-3-7-sonnet-20250219"
group.add_argument(
"--sonnet",
action="store_const",
Expand Down
8 changes: 6 additions & 2 deletions aider/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def cmd_tokens(self, args):

fence = "`" * 3

file_res = []
# files
for fname in self.coder.abs_fnames:
relative_fname = self.coder.get_rel_fname(fname)
Expand All @@ -414,7 +415,7 @@ def cmd_tokens(self, args):
# approximate
content = f"{relative_fname}\n{fence}\n" + content + "{fence}\n"
tokens = self.coder.main_model.token_count(content)
res.append((tokens, f"{relative_fname}", "/drop to remove"))
file_res.append((tokens, f"{relative_fname}", "/drop to remove"))

# read-only files
for fname in self.coder.abs_read_only_fnames:
Expand All @@ -424,7 +425,10 @@ def cmd_tokens(self, args):
# approximate
content = f"{relative_fname}\n{fence}\n" + content + "{fence}\n"
tokens = self.coder.main_model.token_count(content)
res.append((tokens, f"{relative_fname} (read-only)", "/drop to remove"))
file_res.append((tokens, f"{relative_fname} (read-only)", "/drop to remove"))

file_res.sort()
res.extend(file_res)

self.io.tool_output(
f"Approximate context window usage for {self.coder.main_model.name}, in tokens:"
Expand Down
23 changes: 12 additions & 11 deletions aider/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

import os
import platform
import shlex
import subprocess
import tempfile

from rich.console import Console

from aider.dump import dump # noqa

DEFAULT_EDITOR_NIX = "vi"
DEFAULT_EDITOR_OS_X = "vim"
DEFAULT_EDITOR_WINDOWS = "notepad"
Expand Down Expand Up @@ -87,13 +88,13 @@ def get_environment_editor(default=None):

def discover_editor(editor_override=None):
"""
Discovers and returns the appropriate editor command as a list of arguments.
Discovers and returns the appropriate editor command.
Handles cases where the editor command includes arguments, including quoted arguments
with spaces (e.g. 'vim -c "set noswapfile"').
:return: A list of command parts ready for subprocess execution
:rtype: list[str]
:return: The editor command as a string
:rtype: str
"""
system = platform.system()
if system == "Windows":
Expand All @@ -102,14 +103,13 @@ def discover_editor(editor_override=None):
default_editor = DEFAULT_EDITOR_OS_X
else:
default_editor = DEFAULT_EDITOR_NIX

if editor_override:
editor = editor_override
else:
editor = get_environment_editor(default_editor)
try:
return shlex.split(editor)
except ValueError as e:
raise RuntimeError(f"Invalid editor command format '{editor}': {e}")

return editor


def pipe_editor(input_data="", suffix=None, editor=None):
Expand All @@ -128,9 +128,10 @@ def pipe_editor(input_data="", suffix=None, editor=None):
:rtype: str
"""
filepath = write_temp_file(input_data, suffix)
command_parts = discover_editor(editor)
command_parts.append(filepath)
subprocess.call(command_parts)
command_str = discover_editor(editor)
command_str += " " + filepath

subprocess.call(command_str, shell=True)
with open(filepath, "r") as f:
output_data = f.read()
try:
Expand Down
2 changes: 1 addition & 1 deletion aider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# Mapping of model aliases to their canonical names
MODEL_ALIASES = {
# Claude models
"sonnet": "claude-3-5-sonnet-20241022",
"sonnet": "anthropic/claude-3-7-sonnet-20250219",
"haiku": "claude-3-5-haiku-20241022",
"opus": "claude-3-opus-20240229",
# GPT models
Expand Down
76 changes: 76 additions & 0 deletions aider/resources/model-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@
"supports_system_messages": true,
"supports_response_schema": true
},
"openrouter/openai/o3-mini-high": {
"max_tokens": 100000,
"max_input_tokens": 200000,
"max_output_tokens": 100000,
"input_cost_per_token": 0.0000011,
"output_cost_per_token": 0.0000044,
"cache_read_input_token_cost": 0.00000055,
"litellm_provider": "openrouter",
"mode": "chat",
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
},
"openrouter/openai/gpt-4o-mini": {
"max_tokens": 16384,
"max_input_tokens": 128000,
Expand All @@ -115,4 +131,64 @@
"supports_prompt_caching": true,
"supports_system_messages": true
},
"claude-3-7-sonnet-20250219": {
"max_tokens": 8192,
"max_input_tokens": 200000,
"max_output_tokens": 8192,
"input_cost_per_token": 0.000003,
"output_cost_per_token": 0.000015,
"cache_creation_input_token_cost": 0.00000375,
"cache_read_input_token_cost": 0.0000003,
"litellm_provider": "anthropic",
"mode": "chat",
"supports_function_calling": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 159,
"supports_assistant_prefill": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_response_schema": true,
"deprecation_date": "2025-10-01",
"supports_tool_choice": true
},
"anthropic/claude-3-7-sonnet-20250219": {
"max_tokens": 8192,
"max_input_tokens": 200000,
"max_output_tokens": 8192,
"input_cost_per_token": 0.000003,
"output_cost_per_token": 0.000015,
"cache_creation_input_token_cost": 0.00000375,
"cache_read_input_token_cost": 0.0000003,
"litellm_provider": "anthropic",
"mode": "chat",
"supports_function_calling": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 159,
"supports_assistant_prefill": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_response_schema": true,
"deprecation_date": "2025-10-01",
"supports_tool_choice": true
},
"openrouter/anthropic/claude-3.7-sonnet": {
"max_tokens": 8192,
"max_input_tokens": 200000,
"max_output_tokens": 8192,
"input_cost_per_token": 0.000003,
"output_cost_per_token": 0.000015,
"cache_creation_input_token_cost": 0.00000375,
"cache_read_input_token_cost": 0.0000003,
"litellm_provider": "openrouter",
"mode": "chat",
"supports_function_calling": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 159,
"supports_assistant_prefill": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_response_schema": true,
"deprecation_date": "2025-10-01",
"supports_tool_choice": true
},
}
35 changes: 35 additions & 0 deletions aider/resources/model-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,32 @@
editor_model_name: anthropic/claude-3-5-sonnet-20241022
editor_edit_format: editor-diff

- name: anthropic/claude-3-7-sonnet-20250219
edit_format: diff
weak_model_name: anthropic/claude-3-5-haiku-20241022
use_repo_map: true
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19
max_tokens: 64000
cache_control: true
editor_model_name: anthropic/claude-3-7-sonnet-20250219
editor_edit_format: editor-diff

- name: openrouter/anthropic/claude-3.7-sonnet
edit_format: diff
weak_model_name: openrouter/anthropic/claude-3-5-haiku
use_repo_map: true
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19
max_tokens: 64000
cache_control: true
editor_model_name: openrouter/anthropic/claude-3.7-sonnet
editor_edit_format: editor-diff

- name: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
edit_format: diff
weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0
Expand Down Expand Up @@ -658,6 +684,15 @@
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "

- name: openrouter/openai/o3-mini-high
edit_format: diff
weak_model_name: openrouter/openai/gpt-4o-mini
use_repo_map: true
use_temperature: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "

- name: azure/o3-mini
edit_format: diff
weak_model_name: azure/gpt-4o-mini
Expand Down
1 change: 1 addition & 0 deletions aider/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"composer.lock",
"pom.xml",
"build.gradle",
"build.gradle.kts",
"build.sbt",
"go.mod",
"go.sum",
Expand Down
19 changes: 19 additions & 0 deletions aider/website/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ cog.out(text)
]]]-->


### Aider v0.75.1

- Added support for `openrouter/anthropic/claude-3.7-sonnet`

### Aider v0.75.0

- Basic support for Claude 3.7 Sonnet
- Use `--model sonnet` to use the new 3.7
- Thinking support coming soon.
- Bugfix to `/editor` command.
- Aider wrote 46% of the code in this release.

### Aider v0.74.3

- Downgrade streamlit dependency to avoid threading bug.
- Added support for tree-sitter language pack.
- Added openrouter/o3-mini-high model configuration.
- Added build.gradle.kts to special files for Kotlin project support, by Lucas Shadler.

### Aider v0.74.2

- Prevent more than one cache warming thread from becoming active.
Expand Down
70 changes: 70 additions & 0 deletions aider/website/_data/blame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3844,3 +3844,73 @@
"Viktor Sz\xE9pe": 3
start_tag: v0.73.0
total_lines: 783
- aider_percentage: 46.31
aider_total: 163
end_date: '2025-02-24'
end_tag: v0.75.0
file_counts:
aider/__init__.py:
Paul Gauthier: 1
aider/args.py:
Paul Gauthier: 7
aider/coders/base_coder.py:
Paul Gauthier: 12
Paul Gauthier (aider): 4
aider/commands.py:
FeepingCreature (aider): 6
aider/editor.py:
Paul Gauthier: 7
Paul Gauthier (aider): 5
aider/io.py:
Paul Gauthier: 3
Paul Gauthier (aider): 4
aider/linter.py:
Paul Gauthier: 1
aider/main.py:
Paul Gauthier: 16
aider/models.py:
Paul Gauthier: 4
aider/queries/tree-sitter-language-pack/javascript-tags.scm:
Paul Gauthier: 5
aider/queries/tree-sitter-languages/hcl-tags.scm:
Paul Gauthier: 3
Warren Krewenki: 74
aider/queries/tree-sitter-languages/javascript-tags.scm:
Paul Gauthier: 5
aider/repomap.py:
Paul Gauthier: 43
Paul Gauthier (aider): 11
aider/special.py:
Lucas Shadler: 1
aider/website/docs/leaderboards/index.md:
Paul Gauthier: 1
benchmark/Dockerfile:
Paul Gauthier (aider): 1
benchmark/benchmark.py:
Paul Gauthier: 4
benchmark/cpp-test.sh:
Paul Gauthier: 1
scripts/blame.py:
Paul Gauthier (aider): 2
scripts/issues.py:
Paul Gauthier (aider): 17
tests/basic/test_coder.py:
Paul Gauthier (aider): 18
tests/basic/test_editor.py:
Antti Kaihola: 1
Paul Gauthier (aider): 41
tests/basic/test_models.py:
Paul Gauthier (aider): 1
tests/basic/test_repomap.py:
Paul Gauthier (aider): 1
tests/fixtures/languages/hcl/test.tf:
Paul Gauthier (aider): 52
grand_total:
Antti Kaihola: 1
FeepingCreature (aider): 6
Lucas Shadler: 1
Paul Gauthier: 113
Paul Gauthier (aider): 157
Warren Krewenki: 74
start_tag: v0.74.0
total_lines: 352
Loading

0 comments on commit dc0717a

Please sign in to comment.