From e6dc4475e6c97adf34afb7981a1bcde86fd087c5 Mon Sep 17 00:00:00 2001 From: nai-degen Date: Thu, 25 Jan 2024 14:07:42 -0600 Subject: [PATCH] fixes max context size for nu-gpt4-turbo --- .../middleware/request/preprocessors/validate-context-size.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/proxy/middleware/request/preprocessors/validate-context-size.ts b/src/proxy/middleware/request/preprocessors/validate-context-size.ts index 69c1061..a54714a 100644 --- a/src/proxy/middleware/request/preprocessors/validate-context-size.ts +++ b/src/proxy/middleware/request/preprocessors/validate-context-size.ts @@ -48,7 +48,9 @@ export const validateContextSize: RequestPreprocessor = async (req) => { let modelMax: number; if (model.match(/gpt-3.5-turbo-16k/)) { modelMax = 16384; - } else if (model.match(/gpt-4-1106(-preview)?/)) { + } else if (model.match(/gpt-4-turbo(-preview)?$/)) { + modelMax = 131072; + } else if (model.match(/gpt-4-(0125|1106)(-preview)?$/)) { modelMax = 131072; } else if (model.match(/^gpt-4(-\d{4})?-vision(-preview)?$/)) { modelMax = 131072;