Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GPT-4-0806 model in models.py #98

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions spice/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
10 changes: 10 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -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
Loading