starchat-ui / types /openai.ts
matthoffner's picture
Duplicate from matthoffner/chatbot
13095e0
import { OPENAI_API_TYPE } from '../utils/app/const';
export interface OpenAIModel {
id: string;
name: string;
maxLength: number; // maximum length of a message
tokenLimit: number;
}
export enum OpenAIModelID {
Open_LLaMA = 'open-llama-7b',
GPT_3_5 = 'gpt-3.5-turbo',
GPT_3_5_AZ = 'gpt-35-turbo',
GPT_4 = 'gpt-4',
GPT_4_32K = 'gpt-4-32k',
}
// in case the `DEFAULT_MODEL` environment variable is not set or set to an unsupported model
export const fallbackModelID = OpenAIModelID.Open_LLaMA;
export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = {
[OpenAIModelID.Open_LLaMA]: {
id: OpenAIModelID.Open_LLaMA,
name: 'open-llama-7b',
maxLength: 12000,
tokenLimit: 2048,
},
[OpenAIModelID.GPT_3_5]: {
id: OpenAIModelID.GPT_3_5,
name: 'open-llama-7b',
maxLength: 12000,
tokenLimit: 4000,
},
[OpenAIModelID.GPT_3_5_AZ]: {
id: OpenAIModelID.GPT_3_5_AZ,
name: 'open-llama-7b',
maxLength: 12000,
tokenLimit: 4000,
},
[OpenAIModelID.GPT_4]: {
id: OpenAIModelID.GPT_4,
name: 'GPT-4',
maxLength: 24000,
tokenLimit: 8000,
},
[OpenAIModelID.GPT_4_32K]: {
id: OpenAIModelID.GPT_4_32K,
name: 'GPT-4-32K',
maxLength: 96000,
tokenLimit: 32000,
},
};