From 174702babeae0473603a41ec465a2e6edba24d60 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 3 Feb 2024 08:39:19 -0800 Subject: [PATCH] Updated gpt-4 turbo model switches --- HISTORY.md | 2 +- aider/main.py | 6 +++--- aider/models/__init__.py | 1 - aider/models/openai.py | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index d2c2de506..d8ab087d8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,7 +2,7 @@ ### v0.23.0 -- Added support for the new `gpt-4-0125-preview`, use `--model gpt-4-0125-preview`. +- Added support for `--model gpt-4-0125-preview` and OpenAI's alias `--model gpt-4-turbo-preview`. The `--4turbo` switch remains an alias for `--model gpt-4-1106-preview` at this time. - New `/test` command that runs a command and adds the output to the chat on non-zero exit status. - Improved streaming of markdown to the terminal. - Added `/quit` as alias for `/exit`. diff --git a/aider/main.py b/aider/main.py index d0f74f93a..a77695580 100644 --- a/aider/main.py +++ b/aider/main.py @@ -157,15 +157,15 @@ def main(argv=None, input=None, output=None, force_git_root=None): default=False, help="Override to skip model availability check (default: False)", ) - default_4_turbo_model = models.GPT4_1106_PREVIEW + default_4_turbo_model = "gpt-4-1106-preview" core_group.add_argument( "--4-turbo", "--4turbo", "--4", action="store_const", dest="model", - const=default_4_turbo_model.name, - help=f"Use {default_4_turbo_model.name} model for the main chat (gpt-4 is better)", + const=default_4_turbo_model, + help=f"Use {default_4_turbo_model} model for the main chat (gpt-4 is better)", ) default_3_model = models.GPT35_1106 core_group.add_argument( diff --git a/aider/models/__init__.py b/aider/models/__init__.py index 76f1c3e35..5a8e1fdba 100644 --- a/aider/models/__init__.py +++ b/aider/models/__init__.py @@ -4,7 +4,6 @@ from .openrouter import OpenRouterModel GPT4 = Model.create("gpt-4") GPT4_0613 = Model.create("gpt-4-0613") -GPT4_1106_PREVIEW = Model.create("gpt-4-1106-preview") GPT35 = Model.create("gpt-3.5-turbo") GPT35_1106 = Model.create("gpt-3.5-turbo-1106") GPT35_16k = Model.create("gpt-3.5-turbo-16k") diff --git a/aider/models/openai.py b/aider/models/openai.py index 7121f62b8..995271681 100644 --- a/aider/models/openai.py +++ b/aider/models/openai.py @@ -9,6 +9,7 @@ known_tokens = { "gpt-4": 8, "gpt-4-1106-preview": 128, "gpt-4-0125-preview": 128, + "gpt-4-turbo-preview": 128, "gpt-3.5-turbo-1106": 16, } @@ -34,7 +35,7 @@ class OpenAIModel(Model): self.tokenizer = tiktoken.encoding_for_model(name) if self.is_gpt4(): - if name in ("gpt-4-1106-preview", "gpt-4-0125-preview"): + if name in ("gpt-4-1106-preview", "gpt-4-0125-preview", "gpt-4-turbo-preview"): self.edit_format = "udiff" else: self.edit_format = "diff"