diff --git a/README.md b/README.md index 7e41767..17376fc 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ model_aliases = { "task1_model": GPT_4_0125_PREVIEW, "task2_model": "claude-3-opus-20240229", "task3_model": "claude-3-haiku-20240307", + "new_gpt4_model": "gpt-4-0806", # New GPT-4-0806 model } client = Spice(model_aliases=model_aliases) diff --git a/spice/models.py b/spice/models.py index c858f91..ad97358 100644 --- a/spice/models.py +++ b/spice/models.py @@ -112,6 +112,14 @@ class UnknownModel(TextModel, EmbeddingModel, TranscriptionModel): GPT_4_32K_0613 = TextModel("gpt-4-32k-0613", OPEN_AI, input_cost=6000, output_cost=12000, context_length=32768) +GPT_4_0806 = TextModel( + "gpt-4-0806", + OPEN_AI, + input_cost=300, # Adjust this value to the correct input cost in cents / million tokens + output_cost=600, # Adjust this value to the correct output cost in cents / million tokens + context_length=128000 # Adjust if the context length is different +) + GPT_35_TURBO = TextModel("gpt-3.5-turbo", OPEN_AI, input_cost=50, output_cost=150, context_length=16385) """Warning: This model always points to OpenAI's latest GPT-3.5-Turbo model, so the input and output costs may incorrect. We recommend using specific versions of GPT-3.5-Turbo instead.""" diff --git a/tests/test_models.py b/tests/test_models.py new file mode 100644 index 0000000..01c61d3 --- /dev/null +++ b/tests/test_models.py @@ -0,0 +1,10 @@ +import pytest +from spice.models import get_model_from_name, OPEN_AI + +def test_gpt_4_0806_model(): + model = get_model_from_name("gpt-4-0806") + assert model.name == "gpt-4-0806" + assert model.provider == OPEN_AI + assert model.input_cost == 300 # Adjust to the correct input cost + assert model.output_cost == 600 # Adjust to the correct output cost + assert model.context_length == 128000 # Adjust if the context length is different \ No newline at end of file