forked from mckaywrigley/chatbot-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (mckaywrigley#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
a37e9b0
commit 8d96800
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, | ||
}, | ||
}; |