From a83421607a6629edcd5ff3b524368839e7d9d1b6 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 18 Jul 2024 11:57:19 -0700 Subject: [PATCH] Switch default model to gpt-4o-mini (from gpt-3.5-turbo), refs #536 --- llm/cli.py | 2 +- tests/conftest.py | 2 +- tests/test_llm.py | 10 +++++----- tests/test_templates.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/llm/cli.py b/llm/cli.py index 9b0109f..967764d 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -41,7 +41,7 @@ import yaml warnings.simplefilter("ignore", ResourceWarning) -DEFAULT_MODEL = "gpt-3.5-turbo" +DEFAULT_MODEL = "gpt-4o-mini" DEFAULT_EMBEDDING_MODEL = "ada-002" DEFAULT_TEMPLATE = "prompt: " diff --git a/tests/conftest.py b/tests/conftest.py index 8113e2e..120fe35 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -145,7 +145,7 @@ def mocked_openai_chat(httpx_mock): method="POST", url="https://api.openai.com/v1/chat/completions", json={ - "model": "gpt-3.5-turbo", + "model": "gpt-4o-mini", "usage": {}, "choices": [{"message": {"content": "Bob, Alice, Eve"}}], }, diff --git a/tests/test_llm.py b/tests/test_llm.py index e86a44e..eb418ca 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -260,7 +260,7 @@ def test_llm_default_prompt( assert len(rows) == 1 expected = { - "model": "gpt-3.5-turbo", + "model": "gpt-4o-mini", "prompt": "three names \nfor a pet pelican", "system": None, "options_json": "{}", @@ -274,7 +274,7 @@ def test_llm_default_prompt( "messages": [{"role": "user", "content": "three names \nfor a pet pelican"}] } assert json.loads(row["response_json"]) == { - "model": "gpt-3.5-turbo", + "model": "gpt-4o-mini", "choices": [{"message": {"content": "Bob, Alice, Eve"}}], } @@ -288,7 +288,7 @@ def test_llm_default_prompt( assert ( log_json[0].items() >= { - "model": "gpt-3.5-turbo", + "model": "gpt-4o-mini", "prompt": "three names \nfor a pet pelican", "system": None, "prompt_json": { @@ -299,12 +299,12 @@ def test_llm_default_prompt( "options_json": {}, "response": "Bob, Alice, Eve", "response_json": { - "model": "gpt-3.5-turbo", + "model": "gpt-4o-mini", "choices": [{"message": {"content": "Bob, Alice, Eve"}}], }, # This doesn't have the \n after three names: "conversation_name": "three names for a pet pelican", - "conversation_model": "gpt-3.5-turbo", + "conversation_model": "gpt-4o-mini", }.items() ) diff --git a/tests/test_templates.py b/tests/test_templates.py index 04654f9..6289c38 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -115,7 +115,7 @@ def test_templates_prompt_save(templates_path, args, expected_prompt, expected_e ( "'Summarize this: $input'", [], - "gpt-3.5-turbo", + "gpt-4o-mini", "Summarize this: Input text", None, ), @@ -150,7 +150,7 @@ def test_templates_prompt_save(templates_path, args, expected_prompt, expected_e ( "prompt: 'Say $hello'", ["-p", "hello", "Blah"], - "gpt-3.5-turbo", + "gpt-4o-mini", "Say Blah", None, ),