Skip to content

Commit

Permalink
Merge pull request #1287 from luarss/topic/openai-model-fix
Browse files Browse the repository at this point in the history
OpenAI model updates
  • Loading branch information
penguine-ip authored Jan 19, 2025
2 parents 6550f48 + 5be2d4c commit c4ed7fe
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 35 deletions.
72 changes: 46 additions & 26 deletions deepeval/models/gpt_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,55 +27,70 @@ def log_retry_error(retry_state):


valid_gpt_models = [
"gpt-4o-mini",
"gpt-4o",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-3.5-turbo",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-instruct",
"gpt-3.5-turbo-instruct-0914",
"gpt-4",
"gpt-4-0125-preview",
"gpt-4-0613",
"gpt-4-1106-preview",
"gpt-4",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-turbo-preview",
"gpt-4o",
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"gpt-4o-2024-11-20",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4-32k",
"gpt-4-0613",
"gpt-4-32k-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0125",
]

structured_outputs_models = [
"gpt-4o",
"gpt-4o-mini"
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"gpt-4o-2024-11-20",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
]

json_mode_models = [
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-3.5-turbo",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-instruct",
"gpt-3.5-turbo-instruct-0914",
"gpt-4",
"gpt-4-0125-preview",
"gpt-4-0613",
"gpt-4-1106-preview",
"gpt-4",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-turbo-preview",
"gpt-4-32k",
"gpt-4-0613",
"gpt-4-32k-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0125",
]

model_pricing = {
"gpt-4o-mini": {"input": 0.150 / 1e6, "output": 0.600 / 1e6},
"gpt-4o": {"input": 5.00 / 1e6, "output": 15.00 / 1e6},
"gpt-4o": {"input": 2.50 / 1e6, "output": 10.00 / 1e6},
"gpt-4-turbo": {"input": 10.00 / 1e6, "output": 30.00 / 1e6},
"gpt-4-turbo-preview": {"input": 10.00 / 1e6, "output": 30.00 / 1e6},
"gpt-4-0125-preview": {"input": 10.00 / 1e6, "output": 30.00 / 1e6},
"gpt-4-1106-preview": {"input": 10.00 / 1e6, "output": 30.00 / 1e6},
"gpt-4": {"input": 30.00 / 1e6, "output": 60.00 / 1e6},
"gpt-4-32k": {"input": 60.00 / 1e6, "output": 120.00 / 1e6},
"gpt-3.5-turbo-1106": {"input": 1.00 / 1e6, "output": 2.00 / 1e6},
"gpt-3.5-turbo": {"input": 1.50 / 1e6, "output": 2.00 / 1e6},
"gpt-3.5-turbo": {"input": 0.50 / 1e6, "output": 1.50 / 1e6},
"gpt-3.5-turbo-16k": {"input": 3.00 / 1e6, "output": 4.00 / 1e6},
"gpt-3.5-turbo-0125": {"input": 0.50 / 1e6, "output": 1.50 / 1e6},
"gpt-3.5-turbo-instruct": {"input": 1.50 / 1e6, "output": 2.00 / 1e6},
}

default_gpt_model = "gpt-4o"
Expand Down Expand Up @@ -383,15 +398,20 @@ def trim_and_load_json(


valid_multimodal_gpt_models = [
"gpt-4o-mini",
"gpt-4o",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"gpt-4o-2024-11-20",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4",
"gpt-4-0125-preview",
"gpt-4-0613",
"gpt-4-1106-preview",
"gpt-4",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-turbo-preview",
"gpt-4-32k",
"gpt-4-0613",
"gpt-4-32k-0613",
]

Expand Down
27 changes: 18 additions & 9 deletions deepeval/models/gpt_model_schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,35 @@ def log_retry_error(retry_state):
"gpt-4o-2024-11-20",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4-32k",
"gpt-4-32k-0613",
]

structured_outputs_models = [
"gpt-4o",
"gpt-4o-mini"
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"gpt-4o-2024-11-20",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
]

json_mode_models = [
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-3.5-turbo",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-instruct",
"gpt-3.5-turbo-instruct-0914",
"gpt-4",
"gpt-4-0125-preview",
"gpt-4-0613",
"gpt-4-1106-preview",
"gpt-4",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-turbo-preview",
"gpt-4-32k",
"gpt-4-0613",
"gpt-4-32k-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0125",
]

default_gpt_model = "gpt-4o"
Expand Down

0 comments on commit c4ed7fe

Please sign in to comment.