From f28ff877af17f6388d9fd5c76bd67ddbb925a3ef Mon Sep 17 00:00:00 2001 From: akira0245 <33274390+akira0245@users.noreply.github.com> Date: Thu, 15 Jun 2023 00:25:19 +0800 Subject: [PATCH] Add gpt-3.5-turbo-16k model option, update gpt-3.5 prompt cost (#351) * add gpt-3.5-turbo-16k model option. update gpt-3.5 prompt cost * add gpt-4-0613 models --- src/constants/chat.ts | 30 ++++++++++++++++++++++++++++-- src/types/chat.ts | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/constants/chat.ts b/src/constants/chat.ts index e5baecc..9676de0 100644 --- a/src/constants/chat.ts +++ b/src/constants/chat.ts @@ -19,6 +19,7 @@ Respond using Markdown.`; export const modelOptions: ModelOptions[] = [ 'gpt-3.5-turbo', + 'gpt-3.5-turbo-16k', 'gpt-4', 'gpt-4-32k', // 'gpt-3.5-turbo-0301', @@ -31,21 +32,38 @@ export const defaultModel = 'gpt-3.5-turbo'; export const modelMaxToken = { 'gpt-3.5-turbo': 4096, 'gpt-3.5-turbo-0301': 4096, + 'gpt-3.5-turbo-0613': 4096, + 'gpt-3.5-turbo-16k': 16384, + 'gpt-3.5-turbo-16k-0613': 16384, 'gpt-4': 8192, 'gpt-4-0314': 8192, + 'gpt-4-0613': 8192, 'gpt-4-32k': 32768, 'gpt-4-32k-0314': 32768, + 'gpt-4-32k-0613': 32768, }; export const modelCost = { 'gpt-3.5-turbo': { - prompt: { price: 0.002, unit: 1000 }, + prompt: { price: 0.0015, unit: 1000 }, completion: { price: 0.002, unit: 1000 }, }, 'gpt-3.5-turbo-0301': { - prompt: { price: 0.002, unit: 1000 }, + prompt: { price: 0.0015, unit: 1000 }, completion: { price: 0.002, unit: 1000 }, }, + 'gpt-3.5-turbo-0613': { + prompt: { price: 0.0015, unit: 1000 }, + completion: { price: 0.002, unit: 1000 }, + }, + 'gpt-3.5-turbo-16k': { + prompt: { price: 0.003, unit: 1000 }, + completion: { price: 0.004, unit: 1000 }, + }, + 'gpt-3.5-turbo-16k-0613': { + prompt: { price: 0.003, unit: 1000 }, + completion: { price: 0.004, unit: 1000 }, + }, 'gpt-4': { prompt: { price: 0.03, unit: 1000 }, completion: { price: 0.06, unit: 1000 }, @@ -54,6 +72,10 @@ export const modelCost = { prompt: { price: 0.03, unit: 1000 }, completion: { price: 0.06, unit: 1000 }, }, + 'gpt-4-0613': { + prompt: { price: 0.03, unit: 1000 }, + completion: { price: 0.06, unit: 1000 }, + }, 'gpt-4-32k': { prompt: { price: 0.06, unit: 1000 }, completion: { price: 0.12, unit: 1000 }, @@ -62,6 +84,10 @@ export const modelCost = { prompt: { price: 0.06, unit: 1000 }, completion: { price: 0.12, unit: 1000 }, }, + 'gpt-4-32k-0613': { + prompt: { price: 0.06, unit: 1000 }, + completion: { price: 0.12, unit: 1000 }, + }, }; export const defaultUserMaxToken = 4000; diff --git a/src/types/chat.ts b/src/types/chat.ts index bda9dfa..1b957e3 100644 --- a/src/types/chat.ts +++ b/src/types/chat.ts @@ -49,7 +49,7 @@ export interface Folder { color?: string; } -export type ModelOptions = 'gpt-4' | 'gpt-4-32k' | 'gpt-3.5-turbo'; +export type ModelOptions = 'gpt-4' | 'gpt-4-32k' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' ; // | 'gpt-3.5-turbo-0301'; // | 'gpt-4-0314' // | 'gpt-4-32k-0314'