-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: add DEFAULT_MODEL environment variable (#280)
* ✨ feat: add DEFAULT_MODEL environment variable * set the model maxLength setting in the models definition * set the model tokenLimit setting in the models definition
- Loading branch information
1 parent
3f82710
commit 00c6c72
Showing
9 changed files
with
94 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
OPENAI_API_KEY=YOUR_KEY | ||
OPENAI_API_KEY=YOUR_KEY | ||
DEFAULT_MODEL=gpt-3.5-turbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
export interface OpenAIModel { | ||
id: string; | ||
name: string; | ||
maxLength: number; // maximum length of a message | ||
tokenLimit: number; | ||
} | ||
|
||
export enum OpenAIModelID { | ||
GPT_3_5 = 'gpt-3.5-turbo', | ||
GPT_4 = 'gpt-4', | ||
} | ||
|
||
// in case the `DEFAULT_MODEL` environment variable is not set or set to an unsupported model | ||
export const fallbackModelID = OpenAIModelID.GPT_3_5; | ||
|
||
export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = { | ||
[OpenAIModelID.GPT_3_5]: { | ||
id: OpenAIModelID.GPT_3_5, | ||
name: 'Default (GPT-3.5)', | ||
name: 'GPT-3.5', | ||
maxLength: 12000, | ||
tokenLimit: 3000, | ||
}, | ||
[OpenAIModelID.GPT_4]: { | ||
id: OpenAIModelID.GPT_4, | ||
name: 'GPT-4', | ||
maxLength: 24000, | ||
tokenLimit: 6000, | ||
}, | ||
}; |
00c6c72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chatbot-ui – ./
chatbotui.vercel.app
chatbot-ui-mckay-personal.vercel.app
chatbot-ui-git-main-mckay-personal.vercel.app
chatbotui.com
www.chatbotui.com