diff --git a/src/models/index.ts b/src/models/index.ts index a446944..1298b83 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -13,6 +13,7 @@ export const oaiEncodings = z.enum([ export const chatModels = z.enum([ "gpt-4o", + "gpt-4o-mini", "gpt-3.5-turbo", "gpt-4", "gpt-4-32k", @@ -125,6 +126,7 @@ export function isChatModel( return ( model === "gpt-3.5-turbo" || model === "gpt-4o" || + model === "gpt-4o-mini" || model === "gpt-4" || model === "gpt-4-1106-preview" || model === "gpt-4-32k" diff --git a/src/models/tokenizer.ts b/src/models/tokenizer.ts index 477b27c..e897a4a 100644 --- a/src/models/tokenizer.ts +++ b/src/models/tokenizer.ts @@ -46,7 +46,7 @@ export class TiktokenTokenizer implements Tokenizer { "<|im_end|>": 100265, "<|im_sep|>": 100266, }) - : model === "gpt-4o" + : model === "gpt-4o" || model === "gpt-4o-mini" ? get_encoding("o200k_base", { "<|im_start|>": 200264, "<|im_end|>": 200265, diff --git a/src/sections/ChatGPTEditor.tsx b/src/sections/ChatGPTEditor.tsx index 18e6d13..a2c84ca 100644 --- a/src/sections/ChatGPTEditor.tsx +++ b/src/sections/ChatGPTEditor.tsx @@ -54,6 +54,7 @@ function getChatGPTEncoding( | "gpt-4-1106-preview" | "gpt-4" | "gpt-4o" + | "gpt-4o-mini" | "gpt-4-32k" ) { const isGpt3 = model === "gpt-3.5-turbo"; @@ -77,6 +78,7 @@ export function ChatGPTEditor(props: { | "gpt-4-1106-preview" | "gpt-4-32k" | "gpt-4o" + | "gpt-4o-mini" | "gpt-3.5-turbo"; onChange: (value: string) => void; }) {