Skip to content

Commit

Permalink
Merge pull request #100 from rxyshww/feature-4o-mini
Browse files Browse the repository at this point in the history
Feature 4o mini
  • Loading branch information
phodal authored Dec 5, 2024
2 parents 4a82216 + 44d5092 commit 255d2a0
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 42 deletions.
6 changes: 0 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ examples:
"provider": "openai",
"model": "gpt-4",
},
{
"title": "GPT-3.5 turbo",
"provider": "openai",
"model": "gpt-3.5-turbo",
"temperature": 0.75,
},
{
"title": "QWen turbo",
"provider": "tongyi",
Expand Down
4 changes: 2 additions & 2 deletions docs/features/chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ For example, use openai:
"autodev.chat.models": [
{
"provider": "openai", // chat provider
"title": "GPT-3.5 turbo", // Text displayed in selector
"model": "gpt-3.5-turbo" // Used chat model
"title": "GPT-4O Mini", // Text displayed in selector
"model": "gpt-4o-mini" // Used chat model
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion gui-sidebar/src/redux/slices/serverStateReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const initialState: ServerState = {
config: {
models: [
// new FreeTrial({ model: "gpt-4" }),
// new FreeTrial({ model: "gpt-3.5-turbo" }),
// new FreeTrial({ model: "gpt-4o-mini" }),
],
} as any,
contextProviders: [],
Expand Down
4 changes: 2 additions & 2 deletions gui-sidebar/src/redux/slices/stateSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ const initialState: State = {
model: "gpt-4",
},
{
title: "GPT-3.5 turbo",
title: "GPT-4O Mini",
provider: "openai",
model: "gpt-3.5-turbo",
model: "gpt-4o-mini",
},
{
title: "ERNIE-Bot turbo",
Expand Down
7 changes: 1 addition & 6 deletions gui-sidebar/src/shims/llm-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,13 @@ const DEFAULT_ARGS = {
};

const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = {
"gpt-3.5-turbo": 4096,
"gpt-3.5-turbo-0613": 4096,
"gpt-3.5-turbo-16k": 16_384,
"gpt-4": 8192,
"gpt-35-turbo-16k": 16_384,
"gpt-35-turbo-0613": 4096,
"gpt-35-turbo": 4096,
"gpt-4-32k": 32_768,
"gpt-4-turbo-preview": 128_000,
"gpt-4-vision": 128_000,
"gpt-4-0125-preview": 128_000,
"gpt-4-1106-preview": 128_000,
"gpt-4o-mini": 4096,
};

const TOKEN_BUFFER_FOR_SAFETY = 350;
Expand Down
4 changes: 1 addition & 3 deletions gui-sidebar/src/shims/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,11 @@ type ModelProvider =
export type ModelName =
| "AUTODETECT"
// OpenAI
| "gpt-3.5-turbo"
| "gpt-3.5-turbo-16k"
| "gpt-4"
| "gpt-3.5-turbo-0613"
| "gpt-4-32k"
| "gpt-4-turbo-preview"
| "gpt-4-vision-preview"
| "gpt-4o-mini"
// Open Source
| "mistral-7b"
| "mistral-8x7b"
Expand Down
19 changes: 9 additions & 10 deletions gui-sidebar/src/util/modelData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,14 @@ const gpt4vision: ModelPackage = {
icon: "openai.png",
};

const gpt35turbo: ModelPackage = {
title: "GPT-3.5-Turbo",
const gpt4omini: ModelPackage = {
title: "GPT-4O Mini",
description:
"A faster, cheaper OpenAI model with slightly lower capabilities",
params: {
model: "gpt-3.5-turbo",
model: "gpt-4o-mini",
contextLength: 8096,
title: "GPT-3.5-Turbo",
title: "GPT-4O Mini",
},
providerOptions: ["openai", "freetrial"],
icon: "openai.png",
Expand Down Expand Up @@ -621,7 +621,7 @@ const AUTODETECT: ModelPackage = {
export const MODEL_INFO: ModelPackage[] = [
gpt4turbo,
gpt4,
gpt35turbo,
gpt4omini,
geminiPro,
claude3Opus,
claude3Sonnet,
Expand All @@ -641,15 +641,14 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = {
openai: {
title: "OpenAI",
provider: "openai",
description: "Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",
description: "Use gpt-4o-mini or any other OpenAI model",
longDescription:
"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",
"Use gpt-4o-mini or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",
icon: "openai.png",
tags: [ModelProviderTag["Requires API Key"]],
packages: [
gpt4,
gpt35turbo,
gpt4turbo,
gpt4omini,
gpt4vision,
{
...AUTODETECT,
Expand Down Expand Up @@ -935,7 +934,7 @@ After it's up and running, you can start using Continue.`,
{ ...claude3Haiku, title: "Claude 3 Haiku (trial)" },
{ ...geminiPro, title: "Gemini Pro (trial)" },
{ ...gpt4vision, title: "GPT-4 Vision (trial)" },
{ ...gpt35turbo, title: "GPT-3.5-Turbo (trial)" },
{ ...gpt4omini, title: "GPT-4O Mini (trial)" },
{
...AUTODETECT,
params: {
Expand Down
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
"type": "array",
"default": [
{
"title": "GPT-3.5 turbo",
"title": "GPT-4O Mini",
"provider": "openai",
"model": "gpt-3.5-turbo",
"model": "gpt-4o-mini",
"temperature": 0.75
},
{
Expand Down Expand Up @@ -406,6 +406,7 @@
"autodev.openai.model": {
"type": "string",
"enum": [
"gpt-4o-mini",
"gpt-4o",
"gpt-4o-2024-05-13",
"gpt-4-turbo",
Expand All @@ -419,16 +420,9 @@
"gpt-4-0613",
"gpt-4-32k",
"gpt-4-32k-0314",
"gpt-4-32k-0613",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0301",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-16k-0613"
"gpt-4-32k-0613"
],
"default": "gpt-3.5-turbo",
"default": "gpt-4o-mini",
"description": "%configuration.openai.model.description%",
"order": 8
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class OpenAILanguageModelProvider implements ILanguageModelProvider {
return model;
}

return this.configService.get<string>('openai.model', 'gpt-3.5-turbo');
return this.configService.get<string>('openai.model', 'gpt-4o-mini');
}

private _resolveComletionModel(model?: string) {
Expand Down

0 comments on commit 255d2a0

Please sign in to comment.