From c1b2ff20de98236c3f2bff4af578619eec1003a2 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:02:19 +0700 Subject: [PATCH 01/29] feat: Add method to fetch model info from openrouter pages --- aider/models.py | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/aider/models.py b/aider/models.py index cc54f03d3..8289a424a 100644 --- a/aider/models.py +++ b/aider/models.py @@ -211,7 +211,7 @@ class ModelInfoManager: def get_model_info(self, model): cached_info = self.get_model_from_cached_json_db(model) - + litellm_info = None if litellm._lazy_module or not cached_info: try: @@ -219,13 +219,52 @@ class ModelInfoManager: except Exception as ex: if "model_prices_and_context_window.json" not in str(ex): print(str(ex)) - + if litellm_info: return litellm_info - + + if not cached_info and model.startswith("openrouter/"): + openrouter_info = self.fetch_openrouter_model_info(model) + if openrouter_info: + return openrouter_info + return cached_info + def fetch_openrouter_model_info(self, model): + """ + Fetch model info by scraping the openrouter model page. + Expected URL: https://openrouter.ai/ + Example: openrouter/qwen/qwen-2.5-72b-instruct:free + Returns a dict with keys: max_input_tokens, input_cost, output_cost. + """ + url_part = model[len("openrouter/"):] + url = "https://openrouter.ai/" + url_part + import requests + try: + response = requests.get(url, timeout=5) + if response.status_code != 200: + return {} + html = response.text + from bs4 import BeautifulSoup + soup = BeautifulSoup(html, "html.parser") + text = soup.get_text() + import re + context_match = re.search(r"([\d,]+)\s*context", text) + if context_match: + context_str = context_match.group(1).replace(",", "") + context_size = int(context_str) + else: + context_size = None + input_cost_match = re.search(r"\$\s*0\s*/M input tokens", text, re.IGNORECASE) + output_cost_match = re.search(r"\$\s*0\s*/M output tokens", text, re.IGNORECASE) + input_cost = 0 if input_cost_match else None + output_cost = 0 if output_cost_match else None + return {"max_input_tokens": context_size, "input_cost": input_cost, "output_cost": output_cost} + except Exception as e: + print("Error fetching openrouter info:", str(e)) + return {} + model_info_manager = ModelInfoManager() From 4600dbcda5c991b9f630cfd571bb8f884c5e41ab Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:05:55 +0700 Subject: [PATCH 02/29] feat: Print parsed model parameters in fetch_openrouter_model_info() method --- aider/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index 8289a424a..108dd9a97 100644 --- a/aider/models.py +++ b/aider/models.py @@ -260,7 +260,9 @@ class ModelInfoManager: output_cost_match = re.search(r"\$\s*0\s*/M output tokens", text, re.IGNORECASE) input_cost = 0 if input_cost_match else None output_cost = 0 if output_cost_match else None - return {"max_input_tokens": context_size, "input_cost": input_cost, "output_cost": output_cost} + params = {"max_input_tokens": context_size, "input_cost": input_cost, "output_cost": output_cost} + print("Parsed model parameters:", params) + return params except Exception as e: print("Error fetching openrouter info:", str(e)) return {} From 08d48f42ad6c826ad108d5d3becef2c602c27fe3 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:08:57 +0700 Subject: [PATCH 03/29] refactor: Remove BeautifulSoup dependency and use regex to strip HTML tags --- aider/models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aider/models.py b/aider/models.py index 108dd9a97..28bc05f85 100644 --- a/aider/models.py +++ b/aider/models.py @@ -246,10 +246,8 @@ class ModelInfoManager: if response.status_code != 200: return {} html = response.text - from bs4 import BeautifulSoup - soup = BeautifulSoup(html, "html.parser") - text = soup.get_text() import re + text = re.sub(r'<[^>]+>', ' ', html) context_match = re.search(r"([\d,]+)\s*context", text) if context_match: context_str = context_match.group(1).replace(",", "") From 5e48f6898d17163e94a30c15df4507a6c23711cb Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:10:23 +0700 Subject: [PATCH 04/29] fix: Improve print statement to include model name in parameters output --- aider/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index 28bc05f85..fbe6ed181 100644 --- a/aider/models.py +++ b/aider/models.py @@ -259,7 +259,7 @@ class ModelInfoManager: input_cost = 0 if input_cost_match else None output_cost = 0 if output_cost_match else None params = {"max_input_tokens": context_size, "input_cost": input_cost, "output_cost": output_cost} - print("Parsed model parameters:", params) + print(f"Model '{model}': Parsed parameters: {params}") return params except Exception as e: print("Error fetching openrouter info:", str(e)) From 44e5525e6f46f04b020b3feea19b63669d214dd7 Mon Sep 17 00:00:00 2001 From: Stefan Hladnik Date: Tue, 18 Mar 2025 03:17:56 +0700 Subject: [PATCH 05/29] style: Remove unnecessary blank lines in ModelInfoManager class --- aider/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aider/models.py b/aider/models.py index fbe6ed181..1bf2168b6 100644 --- a/aider/models.py +++ b/aider/models.py @@ -211,7 +211,7 @@ class ModelInfoManager: def get_model_info(self, model): cached_info = self.get_model_from_cached_json_db(model) - + litellm_info = None if litellm._lazy_module or not cached_info: try: @@ -219,15 +219,15 @@ class ModelInfoManager: except Exception as ex: if "model_prices_and_context_window.json" not in str(ex): print(str(ex)) - + if litellm_info: return litellm_info - + if not cached_info and model.startswith("openrouter/"): openrouter_info = self.fetch_openrouter_model_info(model) if openrouter_info: return openrouter_info - + return cached_info @@ -264,7 +264,7 @@ class ModelInfoManager: except Exception as e: print("Error fetching openrouter info:", str(e)) return {} - + model_info_manager = ModelInfoManager() From 2651d9967681accad317e1b7023a7303e20c1a0a Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:17:57 +0700 Subject: [PATCH 06/29] feat: Update cost extraction to capture non-zero input/output costs --- aider/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aider/models.py b/aider/models.py index 1bf2168b6..53b99c772 100644 --- a/aider/models.py +++ b/aider/models.py @@ -254,10 +254,10 @@ class ModelInfoManager: context_size = int(context_str) else: context_size = None - input_cost_match = re.search(r"\$\s*0\s*/M input tokens", text, re.IGNORECASE) - output_cost_match = re.search(r"\$\s*0\s*/M output tokens", text, re.IGNORECASE) - input_cost = 0 if input_cost_match else None - output_cost = 0 if output_cost_match else None + input_cost_match = re.search(r"\$\s*([\d.]+)\s*/M input tokens", text, re.IGNORECASE) + output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE) + input_cost = float(input_cost_match.group(1)) if input_cost_match else None + output_cost = float(output_cost_match.group(1)) if output_cost_match else None params = {"max_input_tokens": context_size, "input_cost": input_cost, "output_cost": output_cost} print(f"Model '{model}': Parsed parameters: {params}") return params From 29587cd07cc824ce2795f9b255540dd4c7f66575 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:24:04 +0700 Subject: [PATCH 07/29] fix: Update return keys in fetch_openrouter_model_info() to match JSON metadata --- aider/models.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index 53b99c772..1ca6276fd 100644 --- a/aider/models.py +++ b/aider/models.py @@ -236,7 +236,7 @@ class ModelInfoManager: Fetch model info by scraping the openrouter model page. Expected URL: https://openrouter.ai/ Example: openrouter/qwen/qwen-2.5-72b-instruct:free - Returns a dict with keys: max_input_tokens, input_cost, output_cost. + Returns a dict with keys: max_tokens, max_input_tokens, max_output_tokens, input_cost_per_token, output_cost_per_token. """ url_part = model[len("openrouter/"):] url = "https://openrouter.ai/" + url_part @@ -258,7 +258,13 @@ class ModelInfoManager: output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE) input_cost = float(input_cost_match.group(1)) if input_cost_match else None output_cost = float(output_cost_match.group(1)) if output_cost_match else None - params = {"max_input_tokens": context_size, "input_cost": input_cost, "output_cost": output_cost} + params = { + "max_input_tokens": context_size, + "max_tokens": context_size, + "max_output_tokens": context_size, + "input_cost_per_token": input_cost, + "output_cost_per_token": output_cost, + } print(f"Model '{model}': Parsed parameters: {params}") return params except Exception as e: From 4765a90f97722b124ea9166c7442b4baec6d48ef Mon Sep 17 00:00:00 2001 From: Stefan Hladnik Date: Tue, 18 Mar 2025 03:38:24 +0700 Subject: [PATCH 08/29] fix: Adjust input and output cost calculations to use million scale --- aider/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index 1ca6276fd..3499e7820 100644 --- a/aider/models.py +++ b/aider/models.py @@ -256,8 +256,8 @@ class ModelInfoManager: context_size = None input_cost_match = re.search(r"\$\s*([\d.]+)\s*/M input tokens", text, re.IGNORECASE) output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE) - input_cost = float(input_cost_match.group(1)) if input_cost_match else None - output_cost = float(output_cost_match.group(1)) if output_cost_match else None + input_cost = float(input_cost_match.group(1)) / 1000000 if input_cost_match else None + output_cost = float(output_cost_match.group(1)) / 1000000 if output_cost_match else None params = { "max_input_tokens": context_size, "max_tokens": context_size, From b37773c6300428c5d7ac277f927862431601b01b Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:38:25 +0700 Subject: [PATCH 09/29] style: Update import location and add SSL verification in fetch_openrouter_model_info() --- aider/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index 3499e7820..ed014bb54 100644 --- a/aider/models.py +++ b/aider/models.py @@ -240,9 +240,9 @@ class ModelInfoManager: """ url_part = model[len("openrouter/"):] url = "https://openrouter.ai/" + url_part - import requests try: - response = requests.get(url, timeout=5) + import requests + response = requests.get(url, timeout=5, verify=self.verify_ssl) if response.status_code != 200: return {} html = response.text From 87ccacb99f79aeab6d3747d3b6c05d55377d9e30 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:46:36 +0700 Subject: [PATCH 10/29] fix: Return empty dict if any required parameters are missing --- aider/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/models.py b/aider/models.py index ed014bb54..749b2c79c 100644 --- a/aider/models.py +++ b/aider/models.py @@ -258,6 +258,8 @@ class ModelInfoManager: output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE) input_cost = float(input_cost_match.group(1)) / 1000000 if input_cost_match else None output_cost = float(output_cost_match.group(1)) / 1000000 if output_cost_match else None + if context_size is None or input_cost is None or output_cost is None: + return {} params = { "max_input_tokens": context_size, "max_tokens": context_size, From d64427d726685f8687bd7400041b16fce2170c95 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:49:59 +0700 Subject: [PATCH 11/29] feat: Add error handling for unavailable model in response text --- aider/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aider/models.py b/aider/models.py index 749b2c79c..dc55e0a8a 100644 --- a/aider/models.py +++ b/aider/models.py @@ -246,6 +246,9 @@ class ModelInfoManager: if response.status_code != 200: return {} html = response.text + if f'The model "{url_part}" is not available' in html: + print(f"Error: Model '{url_part}' is not available") + sys.exit(1) import re text = re.sub(r'<[^>]+>', ' ', html) context_match = re.search(r"([\d,]+)\s*context", text) From 21cca34392a8bac0bb6ffbc1226a8877578944ad Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:53:27 +0700 Subject: [PATCH 12/29] fix: Allow arbitrary characters in model availability check regex --- aider/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index dc55e0a8a..fe92e8aa5 100644 --- a/aider/models.py +++ b/aider/models.py @@ -246,10 +246,10 @@ class ModelInfoManager: if response.status_code != 200: return {} html = response.text - if f'The model "{url_part}" is not available' in html: + import re + if re.search(rf'The model\s*.*{re.escape(url_part)}.* is not available', html, re.IGNORECASE): print(f"Error: Model '{url_part}' is not available") sys.exit(1) - import re text = re.sub(r'<[^>]+>', ' ', html) context_match = re.search(r"([\d,]+)\s*context", text) if context_match: From cdd730e627e7e9f2a18d77e72c96b1600706e6eb Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:54:27 +0700 Subject: [PATCH 13/29] feat: Print error message in red for unavailable models --- aider/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index fe92e8aa5..f78376948 100644 --- a/aider/models.py +++ b/aider/models.py @@ -248,7 +248,7 @@ class ModelInfoManager: html = response.text import re if re.search(rf'The model\s*.*{re.escape(url_part)}.* is not available', html, re.IGNORECASE): - print(f"Error: Model '{url_part}' is not available") + print(f"\033[91mError: Model '{url_part}' is not available\033[0m") sys.exit(1) text = re.sub(r'<[^>]+>', ' ', html) context_match = re.search(r"([\d,]+)\s*context", text) From 7c3d96d0e7a9360f60e4148c585f6553bb73b2c5 Mon Sep 17 00:00:00 2001 From: Stefan Hladnik Date: Tue, 18 Mar 2025 04:13:40 +0700 Subject: [PATCH 14/29] fix: Remove debug print statement from ModelInfoManager class --- aider/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index f78376948..a190f5f97 100644 --- a/aider/models.py +++ b/aider/models.py @@ -270,7 +270,6 @@ class ModelInfoManager: "input_cost_per_token": input_cost, "output_cost_per_token": output_cost, } - print(f"Model '{model}': Parsed parameters: {params}") return params except Exception as e: print("Error fetching openrouter info:", str(e)) From b3d9e0d1b058da0f9a560e3a6637b0cd446da7d8 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 12:18:48 +0700 Subject: [PATCH 15/29] fix: Return empty dict instead of exiting on model availability error --- aider/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index a190f5f97..bc1d54e12 100644 --- a/aider/models.py +++ b/aider/models.py @@ -249,7 +249,7 @@ class ModelInfoManager: import re if re.search(rf'The model\s*.*{re.escape(url_part)}.* is not available', html, re.IGNORECASE): print(f"\033[91mError: Model '{url_part}' is not available\033[0m") - sys.exit(1) + return {} text = re.sub(r'<[^>]+>', ' ', html) context_match = re.search(r"([\d,]+)\s*context", text) if context_match: From b6587de38973fba34cee7807252b5d421959804f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 13:38:50 -0700 Subject: [PATCH 16/29] chore: Update polyglot leaderboard data --- aider/website/_data/polyglot_leaderboard.yml | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/aider/website/_data/polyglot_leaderboard.yml b/aider/website/_data/polyglot_leaderboard.yml index 6052fa1c8..292454207 100644 --- a/aider/website/_data/polyglot_leaderboard.yml +++ b/aider/website/_data/polyglot_leaderboard.yml @@ -1225,3 +1225,28 @@ seconds_per_case: 50.1 total_cost: 1.8451 +- dirname: 2025-05-07-19-32-40--gemini0506-diff-fenced-completion_cost + test_cases: 225 + model: Gemini 2.5 Pro Preview 05-06 + edit_format: diff-fenced + commit_hash: 3b08327-dirty + pass_rate_1: 36.4 + pass_rate_2: 76.9 + pass_num_1: 82 + pass_num_2: 173 + percent_cases_well_formed: 97.3 + error_outputs: 15 + num_malformed_responses: 7 + num_with_malformed_responses: 6 + user_asks: 105 + lazy_comments: 0 + syntax_errors: 0 + indentation_errors: 0 + exhausted_context_windows: 0 + test_timeouts: 2 + total_tests: 225 + command: aider --model gemini/gemini-2.5-pro-preview-03-25 + date: 2025-05-07 + versions: 0.82.4.dev + seconds_per_case: 165.3 + total_cost: 37.4104 \ No newline at end of file From 5ff3d1a0c5461579951c70f4e36f4d498ac6189e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 13:40:40 -0700 Subject: [PATCH 17/29] feat: Update Gemini model aliases to 05-06 preview --- aider/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index dd0abd452..3cb0a5c5c 100644 --- a/aider/models.py +++ b/aider/models.py @@ -91,8 +91,8 @@ MODEL_ALIASES = { "flash": "gemini/gemini-2.5-flash-preview-04-17", "quasar": "openrouter/openrouter/quasar-alpha", "r1": "deepseek/deepseek-reasoner", - "gemini-2.5-pro": "gemini/gemini-2.5-pro-exp-03-25", - "gemini": "gemini/gemini-2.5-pro-preview-03-25", + "gemini-2.5-pro": "gemini/gemini-2.5-pro-preview-05-06", + "gemini": "gemini/gemini-2.5-pro-preview-05-06", "gemini-exp": "gemini/gemini-2.5-pro-exp-03-25", "grok3": "xai/grok-3-beta", "optimus": "openrouter/openrouter/optimus-alpha", From 592dea0f8c421c1cdf1ff5e88714812a19e67978 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 18:17:16 -0700 Subject: [PATCH 18/29] chore: Update weak model name for gemini to 2.5 flash preview --- aider/resources/model-settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/resources/model-settings.yml b/aider/resources/model-settings.yml index 1046023a3..4504ffffd 100644 --- a/aider/resources/model-settings.yml +++ b/aider/resources/model-settings.yml @@ -1397,7 +1397,7 @@ overeager: true edit_format: diff-fenced use_repo_map: true - weak_model_name: gemini/gemini-2.0-flash + weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - name: vertex_ai/gemini-2.5-pro-preview-05-06 edit_format: diff-fenced From 4ab8faf21e04489caf1d2f0dfbace03521e90b25 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 18:27:35 -0700 Subject: [PATCH 19/29] copy --- HISTORY.md | 5 +- aider/website/HISTORY.md | 5 +- aider/website/assets/sample-analytics.jsonl | 108 +++++++++--------- .../website/docs/config/adv-model-settings.md | 2 +- aider/website/docs/faq.md | 9 +- 5 files changed, 65 insertions(+), 64 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 48a965555..5ea1c939f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,17 +1,18 @@ # Release history ### main branch - +- Automatically fetch model parameters (context window, pricing) for OpenRouter models directly from their website, by Stefan Hladnik. - Added support for `gemini-2.5-pro-preview-05-06` models. - Enabled support for `thinking_tokens` and `reasoning_effort` parameters for OpenRouter models. - Added model settings for `openrouter/google/gemini-2.5-pro-preview-03-25`. Introduced `--attribute-co-authored-by` option to add co-author trailer to commit messages, by Andrew Grigorev. - Added `--disable-playwright` flag to prevent Playwright installation prompts and usage, by Andrew Grigorev. +- The `aider scrape` command-line tool will now use Playwright for web scraping if it is available, by Jon Keys. - Added repomap support for OCaml and OCaml interface files, by Andrey Popp. - Improved cost calculation using `litellm.completion_cost` where available. - Fixed linter command execution on Windows by adopting `oslex` for argument quoting, by Titusz Pan. - Improved cross-platform display of shell commands by using `oslex` for robust argument quoting, by Titusz Pan. - Aider wrote 44% of the code in this release. +- Aider wrote 45% of the code in this release. ### Aider v0.82.3 diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index 81eedc99c..60fba240e 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -25,17 +25,18 @@ cog.out(text) ### main branch - +- Automatically fetch model parameters (context window, pricing) for OpenRouter models directly from their website, by Stefan Hladnik. - Added support for `gemini-2.5-pro-preview-05-06` models. - Enabled support for `thinking_tokens` and `reasoning_effort` parameters for OpenRouter models. - Added model settings for `openrouter/google/gemini-2.5-pro-preview-03-25`. Introduced `--attribute-co-authored-by` option to add co-author trailer to commit messages, by Andrew Grigorev. - Added `--disable-playwright` flag to prevent Playwright installation prompts and usage, by Andrew Grigorev. +- The `aider scrape` command-line tool will now use Playwright for web scraping if it is available, by Jon Keys. - Added repomap support for OCaml and OCaml interface files, by Andrey Popp. - Improved cost calculation using `litellm.completion_cost` where available. - Fixed linter command execution on Windows by adopting `oslex` for argument quoting, by Titusz Pan. - Improved cross-platform display of shell commands by using `oslex` for robust argument quoting, by Titusz Pan. - Aider wrote 44% of the code in this release. +- Aider wrote 45% of the code in this release. ### Aider v0.82.3 diff --git a/aider/website/assets/sample-analytics.jsonl b/aider/website/assets/sample-analytics.jsonl index ba787a162..4a5968384 100644 --- a/aider/website/assets/sample-analytics.jsonl +++ b/aider/website/assets/sample-analytics.jsonl @@ -1,57 +1,3 @@ -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190053} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 16858, "completion_tokens": 143, "total_tokens": 17001, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190062} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190237} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 17173, "completion_tokens": 312, "total_tokens": 17485, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190243} -{"event": "command_exit", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190249} -{"event": "exit", "properties": {"reason": "/exit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190249} -{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190260} -{"event": "repo", "properties": {"num_files": 615}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190262} -{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190262} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190262} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-flash-preview-04-17", "weak_model": "gemini/gemini-2.5-flash-preview-04-17", "editor_model": "gemini/gemini-2.5-flash-preview-04-17", "edit_format": "diff", "prompt_tokens": 10189, "completion_tokens": 116, "total_tokens": 10305, "cost": 0.0015979499999999999, "total_cost": 0.0015979499999999999}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190272} -{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190955} -{"event": "repo", "properties": {"num_files": 615}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190955} -{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190955} -{"event": "cli session", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190955} -{"event": "command_edit", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745190964} -{"event": "command_ask", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191011} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191011} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "ask", "prompt_tokens": 8442, "completion_tokens": 417, "total_tokens": 8859, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191025} -{"event": "command_ask", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191054} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191054} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191127} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 14287, "completion_tokens": 1995, "total_tokens": 16282, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191145} -{"event": "command_clear", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191182} -{"event": "command_ask", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191214} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191214} -{"event": "command_clear", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191224} -{"event": "command_edit", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191228} -{"event": "command_ask", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191286} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191286} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "ask", "prompt_tokens": 8481, "completion_tokens": 1848, "total_tokens": 10329, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191334} -{"event": "command_clear", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191533} -{"event": "ai-comments execute", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191535} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191535} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 8611, "completion_tokens": 89, "total_tokens": 8700, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745191553} -{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192191} -{"event": "repo", "properties": {"num_files": 615}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192191} -{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192191} -{"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192196} -{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192301} -{"event": "no-repo", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192301} -{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192301} -{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192301} -{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 7873, "completion_tokens": 147, "total_tokens": 8020, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192314} -{"event": "exit", "properties": {"reason": "Completed --message"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192314} -{"event": "ai-comments file-add", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192315} -{"event": "ai-comments file-add", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192318} -{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192612} -{"event": "repo", "properties": {"num_files": 615}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192612} -{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192612} -{"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745192615} -{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745194554} -{"event": "repo", "properties": {"num_files": 615}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745194556} -{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745194556} {"event": "cli session", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745194556} {"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745194568} {"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745194656} @@ -998,3 +944,57 @@ {"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746664482} {"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 19959, "completion_tokens": 176, "total_tokens": 20135, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746664554} {"event": "exit", "properties": {"reason": "Completed --message"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746664554} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666729} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666730} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666730} +{"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666733} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666821} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666822} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666822} +{"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666825} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666956} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666956} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666956} +{"event": "cli session", "properties": {"main_model": "gemini/gemini-2.0-flash", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.0-flash", "edit_format": "diff"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666956} +{"event": "exit", "properties": {"reason": "Completed main CLI coder.run"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666960} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666962} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666962} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666962} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666966} +{"event": "model warning", "properties": {"main_model": "gemini/REDACTED", "weak_model": "gemini/REDACTED", "editor_model": "gemini/REDACTED"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666968} +{"event": "exit", "properties": {"reason": "Keyboard interrupt during model warnings"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666988} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666997} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666997} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666997} +{"event": "cli session", "properties": {"main_model": "gemini/gemini-2.5-flash-preview-04-17", "weak_model": "gemini/gemini-2.5-flash-preview-04-17", "editor_model": "gemini/gemini-2.5-flash-preview-04-17", "edit_format": "diff"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666997} +{"event": "command_exit", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666999} +{"event": "exit", "properties": {"reason": "/exit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746666999} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667009} +{"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "openrouter/REDACTED", "editor_model": "openrouter/REDACTED"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667011} +{"event": "exit", "properties": {"reason": "Keyboard interrupt during model warnings"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667027} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667033} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667033} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667033} +{"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667036} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667201} +{"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "openrouter/REDACTED", "editor_model": "openrouter/REDACTED"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667203} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667207} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667207} +{"event": "cli session", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "openrouter/REDACTED", "editor_model": "openrouter/REDACTED", "edit_format": "whole"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667207} +{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667209} +{"event": "command_exit", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667229} +{"event": "exit", "properties": {"reason": "/exit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667229} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667436} +{"event": "repo", "properties": {"num_files": 621}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667439} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667439} +{"event": "cli session", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "openrouter/REDACTED", "editor_model": "openrouter/REDACTED", "edit_format": "whole"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667439} +{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667441} +{"event": "message_send", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "openrouter/REDACTED", "editor_model": "openrouter/REDACTED", "edit_format": "whole", "prompt_tokens": 9655, "completion_tokens": 395, "total_tokens": 10050, "cost": 0.00168525, "total_cost": 0.00168525}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667458} +{"event": "command_exit", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667467} +{"event": "exit", "properties": {"reason": "/exit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667467} +{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667540} +{"event": "no-repo", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667540} +{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667540} +{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667540} +{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 23450, "completion_tokens": 234, "total_tokens": 23684, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667620} +{"event": "exit", "properties": {"reason": "Completed --message"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746667620} diff --git a/aider/website/docs/config/adv-model-settings.md b/aider/website/docs/config/adv-model-settings.md index e9301d5b5..6d91b6922 100644 --- a/aider/website/docs/config/adv-model-settings.md +++ b/aider/website/docs/config/adv-model-settings.md @@ -694,7 +694,7 @@ cog.out("```\n") - name: gemini/gemini-2.5-pro-preview-05-06 edit_format: diff-fenced - weak_model_name: gemini/gemini-2.0-flash + weak_model_name: gemini/gemini-2.5-flash-preview-04-17 use_repo_map: true overeager: true diff --git a/aider/website/docs/faq.md b/aider/website/docs/faq.md index 6a9d144f9..39c132394 100644 --- a/aider/website/docs/faq.md +++ b/aider/website/docs/faq.md @@ -264,13 +264,12 @@ tr:hover { background-color: #f5f5f5; } - - - + + + - + -
Model NameTotal TokensPercent
gemini/gemini-2.5-pro-exp-03-251,332,23167.3%
gemini/gemini-2.5-pro-preview-03-25442,01922.3%
o3138,8427.0%
gemini/gemini-2.5-pro-exp-03-251,269,23966.2%
gemini/gemini-2.5-pro-preview-03-25442,01923.1%
o3138,8427.2%
openrouter/anthropic/claude-3.7-sonnet41,0172.1%
gemini/gemini-2.5-flash-preview-04-1710,3050.5%
openrouter/REDACTED15,5870.8%
gemini/gemini-2.5-pro-preview-05-068,5760.4%
openrouter/REDACTED5,5370.3%
gemini/REDACTED1,9890.1%
From 03acee1ed271150fda006050a6e2af6d601d36d3 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 19:19:21 -0700 Subject: [PATCH 20/29] copy --- aider/website/_posts/2025-05-07-gemini-cost.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/_posts/2025-05-07-gemini-cost.md b/aider/website/_posts/2025-05-07-gemini-cost.md index c54c18e05..fdadee5ed 100644 --- a/aider/website/_posts/2025-05-07-gemini-cost.md +++ b/aider/website/_posts/2025-05-07-gemini-cost.md @@ -41,7 +41,7 @@ completed the benchmark at a cost of about $37. ## Investigation detail -The version of litellm available at that time appears to have been +The version of litellm available at that time of the benchmark appears to have been excluding reasoning tokens from the token counts it reported. So even though aider had correct per-token pricing, it did not have the correct token counts used during the benchmark. From aaacee5d4d07ad4c6ca356dc0e0aa27adb283511 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 19:28:02 -0700 Subject: [PATCH 21/29] copy --- aider/website/_posts/2025-05-07-gemini-cost.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/_posts/2025-05-07-gemini-cost.md b/aider/website/_posts/2025-05-07-gemini-cost.md index fdadee5ed..32c9d9041 100644 --- a/aider/website/_posts/2025-05-07-gemini-cost.md +++ b/aider/website/_posts/2025-05-07-gemini-cost.md @@ -1,7 +1,7 @@ --- title: Gemini 2.5 Pro Preview 03-25 benchmark cost excerpt: The $6.32 benchmark cost reported for Gemini 2.5 Pro Preview 03-25 was incorrect. -draft: true +draft: false nav_exclude: true --- {% if page.date %} From 0c236d00352d49b49230e3b1ab693e0b47fcbe8e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 20:28:46 -0700 Subject: [PATCH 22/29] except --- aider/coders/base_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index b36ad5098..8d1f73502 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1989,7 +1989,7 @@ class Coder: try: # Try and use litellm's built in cost calculator. Seems to work for non-streaming only? cost = litellm.completion_cost(completion_response=completion) - except ValueError: + except Exception: cost = 0 if not cost: From 8956eef3394a1743732b7feac60b00ba8606d5d1 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 20:28:50 -0700 Subject: [PATCH 23/29] copy --- aider/website/_data/polyglot_leaderboard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/_data/polyglot_leaderboard.yml b/aider/website/_data/polyglot_leaderboard.yml index 292454207..ded7cefcb 100644 --- a/aider/website/_data/polyglot_leaderboard.yml +++ b/aider/website/_data/polyglot_leaderboard.yml @@ -1245,7 +1245,7 @@ exhausted_context_windows: 0 test_timeouts: 2 total_tests: 225 - command: aider --model gemini/gemini-2.5-pro-preview-03-25 + command: aider --model gemini/gemini-2.5-pro-preview-05-06 date: 2025-05-07 versions: 0.82.4.dev seconds_per_case: 165.3 From e7de5382fb49a50747fc75c203dd82b985241a8d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 20:32:11 -0700 Subject: [PATCH 24/29] feat: Add reasoning_effort to Gemini 2.5 models in model_settings.yml --- aider/resources/model-settings.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/resources/model-settings.yml b/aider/resources/model-settings.yml index 4504ffffd..a6cbc3016 100644 --- a/aider/resources/model-settings.yml +++ b/aider/resources/model-settings.yml @@ -1398,6 +1398,7 @@ edit_format: diff-fenced use_repo_map: true weak_model_name: gemini/gemini-2.5-flash-preview-04-17 + accepts_settings: ["reasoning_effort"] - name: vertex_ai/gemini-2.5-pro-preview-05-06 edit_format: diff-fenced @@ -1405,10 +1406,11 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 + accepts_settings: ["reasoning_effort"] - name: openrouter/google/gemini-2.5-pro-preview-05-06 overeager: true edit_format: diff-fenced use_repo_map: true weak_model_name: openrouter/google/gemini-2.0-flash-001 - + accepts_settings: ["reasoning_effort"] From 8727ffbe68b26c2c99d64c96d993c77081a186c5 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 20:54:06 -0700 Subject: [PATCH 25/29] feat: Add thinking_tokens to Gemini 2.5 model settings --- aider/resources/model-settings.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aider/resources/model-settings.yml b/aider/resources/model-settings.yml index a6cbc3016..1a7f4d894 100644 --- a/aider/resources/model-settings.yml +++ b/aider/resources/model-settings.yml @@ -962,12 +962,14 @@ edit_format: diff-fenced use_repo_map: true weak_model_name: gemini/gemini-2.0-flash + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: gemini/gemini-2.5-pro-exp-03-25 edit_format: diff-fenced use_repo_map: true overeager: true weak_model_name: gemini/gemini-2.5-flash-preview-04-17 + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/google/gemini-2.5-pro-exp-03-25:free edit_format: diff-fenced @@ -981,6 +983,7 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: vertex_ai/gemini-2.5-pro-preview-03-25 edit_format: diff-fenced @@ -988,6 +991,7 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/openrouter/quasar-alpha use_repo_map: true @@ -1375,17 +1379,17 @@ - name: gemini/gemini-2.5-flash-preview-04-17 edit_format: diff use_repo_map: true - accepts_settings: ["thinking_tokens"] + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: gemini-2.5-flash-preview-04-17 edit_format: diff use_repo_map: true - accepts_settings: ["thinking_tokens"] + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 edit_format: diff use_repo_map: true - accepts_settings: ["thinking_tokens"] + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/google/gemini-2.5-pro-preview-03-25 overeager: true @@ -1398,7 +1402,7 @@ edit_format: diff-fenced use_repo_map: true weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort"] + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: vertex_ai/gemini-2.5-pro-preview-05-06 edit_format: diff-fenced @@ -1406,11 +1410,11 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort"] + accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/google/gemini-2.5-pro-preview-05-06 overeager: true edit_format: diff-fenced use_repo_map: true weak_model_name: openrouter/google/gemini-2.0-flash-001 - accepts_settings: ["reasoning_effort"] + accepts_settings: ["reasoning_effort", "thinking_tokens"] From a98b531bcc9c3738110b2e538a246fb7e4dbe81f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 7 May 2025 21:02:00 -0700 Subject: [PATCH 26/29] feat: add prompt_tokens and completion_tokens to results summary --- benchmark/benchmark.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index a3c2ca850..b3bbc94ea 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -492,6 +492,8 @@ def summarize_results(dirname, stats_languages=None): res.syntax_errors = 0 res.indentation_errors = 0 res.lazy_comments = 0 + res.prompt_tokens = 0 + res.completion_tokens = 0 res.reasoning_effort = None res.thinking_tokens = None @@ -523,6 +525,9 @@ def summarize_results(dirname, stats_languages=None): res.syntax_errors += results.get("syntax_errors", 0) res.indentation_errors += results.get("indentation_errors", 0) + res.prompt_tokens += results.get("prompt_tokens", 0) + res.completion_tokens += results.get("completion_tokens", 0) + res.reasoning_effort = results.get("reasoning_effort") res.thinking_tokens = results.get("thinking_tokens") @@ -590,6 +595,8 @@ def summarize_results(dirname, stats_languages=None): show("syntax_errors") show("indentation_errors") show("exhausted_context_windows") + show("prompt_tokens", red=None) + show("completion_tokens", red=None) show("test_timeouts") print(f" total_tests: {res.total_tests}") @@ -950,6 +957,8 @@ def run_test_real( indentation_errors=indentation_errors, lazy_comments=lazy_comments, # Add the count of pattern matches to the results reasoning_effort=reasoning_effort, + prompt_tokens=coder.message_tokens_sent, + completion_tokens=coder.message_tokens_received, thinking_tokens=thinking_tokens, chat_hashes=list( zip( From 5090f2815163b12fa672290bac9db0d464df71b8 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 7 May 2025 21:08:29 -0700 Subject: [PATCH 27/29] feat: Track total tokens and use in benchmark stats --- aider/coders/base_coder.py | 15 +++++++++++++-- benchmark/benchmark.py | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 8d1f73502..72b7999ed 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -108,8 +108,6 @@ class Coder: partial_response_content = "" commit_before_message = [] message_cost = 0.0 - message_tokens_sent = 0 - message_tokens_received = 0 add_cache_headers = False cache_warming_thread = None num_cache_warming_pings = 0 @@ -128,6 +126,8 @@ class Coder: from_coder=None, summarize_from_coder=True, **kwargs, + + ): import aider.coders as coders @@ -175,6 +175,8 @@ class Coder: commands=from_coder.commands.clone(), total_cost=from_coder.total_cost, ignore_mentions=from_coder.ignore_mentions, + total_tokens_sent=from_coder.total_tokens_sent, + total_tokens_received=from_coder.total_tokens_received, file_watcher=from_coder.file_watcher, ) use_kwargs.update(update) # override to complete the switch @@ -327,6 +329,8 @@ class Coder: chat_language=None, detect_urls=True, ignore_mentions=None, + total_tokens_sent=0, + total_tokens_received=0, file_watcher=None, auto_copy_context=False, auto_accept_architect=True, @@ -373,6 +377,10 @@ class Coder: self.need_commit_before_edits = set() self.total_cost = total_cost + self.total_tokens_sent = total_tokens_sent + self.total_tokens_received = total_tokens_received + self.message_tokens_sent = 0 + self.message_tokens_received = 0 self.verbose = verbose self.abs_fnames = set() @@ -2057,6 +2065,9 @@ class Coder: if not self.usage_report: return + self.total_tokens_sent += self.message_tokens_sent + self.total_tokens_received += self.message_tokens_received + self.io.tool_output(self.usage_report) prompt_tokens = self.message_tokens_sent diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index b3bbc94ea..3cfbe104d 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -957,8 +957,8 @@ def run_test_real( indentation_errors=indentation_errors, lazy_comments=lazy_comments, # Add the count of pattern matches to the results reasoning_effort=reasoning_effort, - prompt_tokens=coder.message_tokens_sent, - completion_tokens=coder.message_tokens_received, + prompt_tokens=coder.total_tokens_sent, + completion_tokens=coder.total_tokens_received, thinking_tokens=thinking_tokens, chat_hashes=list( zip( From bdec02e290dc33d25a3f95c0e5c2a7591a432f63 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 7 May 2025 21:08:37 -0700 Subject: [PATCH 28/29] style: Run linter on base_coder.py --- aider/coders/base_coder.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 72b7999ed..7ae781450 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -126,8 +126,6 @@ class Coder: from_coder=None, summarize_from_coder=True, **kwargs, - - ): import aider.coders as coders From aeaf2590213bd72c3508330136a80cec9cd52494 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 May 2025 21:16:14 -0700 Subject: [PATCH 29/29] 2.5-pro does not support thinking_budget --- aider/resources/model-settings.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/aider/resources/model-settings.yml b/aider/resources/model-settings.yml index 1a7f4d894..ee07b31f4 100644 --- a/aider/resources/model-settings.yml +++ b/aider/resources/model-settings.yml @@ -962,14 +962,12 @@ edit_format: diff-fenced use_repo_map: true weak_model_name: gemini/gemini-2.0-flash - accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: gemini/gemini-2.5-pro-exp-03-25 edit_format: diff-fenced use_repo_map: true overeager: true weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/google/gemini-2.5-pro-exp-03-25:free edit_format: diff-fenced @@ -983,7 +981,6 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: vertex_ai/gemini-2.5-pro-preview-03-25 edit_format: diff-fenced @@ -991,7 +988,6 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/openrouter/quasar-alpha use_repo_map: true @@ -1402,7 +1398,6 @@ edit_format: diff-fenced use_repo_map: true weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: vertex_ai/gemini-2.5-pro-preview-05-06 edit_format: diff-fenced @@ -1410,11 +1405,9 @@ weak_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 overeager: true editor_model_name: vertex_ai-language-models/gemini-2.5-flash-preview-04-17 - accepts_settings: ["reasoning_effort", "thinking_tokens"] - name: openrouter/google/gemini-2.5-pro-preview-05-06 overeager: true edit_format: diff-fenced use_repo_map: true weak_model_name: openrouter/google/gemini-2.0-flash-001 - accepts_settings: ["reasoning_effort", "thinking_tokens"]