Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(models): add `gpt-4o-2024-08-06` pricing, and make it available on playground and evals (#2845)

Marc Klingen0fcdac0cf155
diff --git a/packages/shared/prisma/migrations/20240807111358_models_add_openai_gpt_4o_2024_08_06/migration.sql b/packages/shared/prisma/migrations/20240807111358_models_add_openai_gpt_4o_2024_08_06/migration.sql
new file mode 100644
index 0000000000..09ee506896
--- /dev/null
+++ b/packages/shared/prisma/migrations/20240807111358_models_add_openai_gpt_4o_2024_08_06/migration.sql
@@ -0,0 +1,18 @@
+
+INSERT INTO models (
+ id,
+ project_id,
+ model_name,
+ match_pattern,
+ start_date,
+ input_price,
+ output_price,
+ total_price,
+ unit,
+ tokenizer_id,
+ tokenizer_config
+)
+VALUES
+ -- gpt-4o-2024-08-06
+ ('clzjr85f70000ymmzg7hqffra', NULL, 'gpt-4o-2024-08-06', '(?i)^(gpt-4o-2024-08-06)$', NULL, 0.0000025, 0.000010, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4o" }')
+
\ No newline at end of file
diff --git a/packages/shared/src/features/evals/types.ts b/packages/shared/src/features/evals/types.ts
index d8687bd8a3..38e79e667d 100644
--- a/packages/shared/src/features/evals/types.ts
+++ b/packages/shared/src/features/evals/types.ts
@@ -81,6 +81,7 @@ export const evalModelsByAdapter: Record<LLMAdapter, string[]> = {
[LLMAdapter.OpenAI]: [
"gpt-4o",
"gpt-4o-mini",
+ "gpt-4o-2024-08-06", // cheaper than gpt-4o
"gpt-4-turbo-preview",
"gpt-3.5-turbo",
] as const,
diff --git a/packages/shared/src/server/llm/types.ts b/packages/shared/src/server/llm/types.ts
index 102f77f701..ff40db3f2d 100644
--- a/packages/shared/src/server/llm/types.ts
+++ b/packages/shared/src/server/llm/types.ts
@@ -48,6 +48,7 @@ export const ZodModelConfig = z.object({
// NOTE: Update docs page when changing this!
export const openAIModels = [
"gpt-4o",
+ "gpt-4o-2024-08-06",
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
diff --git a/web/src/utils/types.ts b/web/src/utils/types.ts
index f0cd1950a2..a11e071b18 100644
--- a/web/src/utils/types.ts
+++ b/web/src/utils/types.ts
@@ -58,6 +58,7 @@ const chatModels = [
"gpt-4-1106-preview",
"gpt-4-vision-preview",
"gpt-4o-2024-05-13",
+ "gpt-4o-2024-08-06",
"gpt-4o",
];
diff --git a/worker/src/features/tokenisation/types.ts b/worker/src/features/tokenisation/types.ts
index 29ae814068..6bdfdd2c5e 100644
--- a/worker/src/features/tokenisation/types.ts
+++ b/worker/src/features/tokenisation/types.ts
@@ -58,6 +58,7 @@ export const isTiktokenModel = (model: string): model is TiktokenModel => {
"gpt-4-vision-preview",
"gpt-4o",
"gpt-4o-2024-05-13",
+ // "gpt-4o-2024-08-06", not supported by js-tiktoken yet, configured to use gpt-4o tokenizer
].includes(model);
};
const chatModels = [