Skip to content

Commit 3c90b6a

Browse files
authored
🚀 feat: Support for GPT-3.5 Turbo/0125 Model (danny-avila#1704)
* 🚀 feat: Support for GPT-3.5 Turbo/0125 Model * ci: fix tx test
1 parent 3a8e2bd commit 3c90b6a

File tree

7 files changed

+15
-4
lines changed

7 files changed

+15
-4
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ GOOGLE_KEY=user_provided
101101
#============#
102102

103103
OPENAI_API_KEY=user_provided
104-
# OPENAI_MODELS=gpt-3.5-turbo-0301,gpt-3.5-turbo,gpt-4,gpt-4-0613,gpt-4-vision-preview,gpt-3.5-turbo-0613,gpt-3.5-turbo-16k-0613,gpt-4-0125-preview,gpt-4-turbo-preview,gpt-4-1106-preview,gpt-3.5-turbo-1106,gpt-3.5-turbo-instruct,gpt-3.5-turbo-instruct-0914,gpt-3.5-turbo-16k
104+
# OPENAI_MODELS=gpt-3.5-turbo-0125,gpt-3.5-turbo-0301,gpt-3.5-turbo,gpt-4,gpt-4-0613,gpt-4-vision-preview,gpt-3.5-turbo-0613,gpt-3.5-turbo-16k-0613,gpt-4-0125-preview,gpt-4-turbo-preview,gpt-4-1106-preview,gpt-3.5-turbo-1106,gpt-3.5-turbo-instruct,gpt-3.5-turbo-instruct-0914,gpt-3.5-turbo-16k
105105

106106
DEBUG_OPENAI=false
107107

@@ -127,7 +127,7 @@ DEBUG_OPENAI=false
127127
# Plugins #
128128
#============#
129129

130-
# PLUGIN_MODELS=gpt-4,gpt-4-turbo-preview,gpt-4-0125-preview,gpt-4-1106-preview,gpt-4-0613,gpt-3.5-turbo,gpt-3.5-turbo-1106,gpt-3.5-turbo-0613
130+
# PLUGIN_MODELS=gpt-4,gpt-4-turbo-preview,gpt-4-0125-preview,gpt-4-1106-preview,gpt-4-0613,gpt-3.5-turbo,gpt-3.5-turbo-0125,gpt-3.5-turbo-1106,gpt-3.5-turbo-0613
131131

132132
DEBUG_PLUGINS=true
133133

api/models/tx.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const tokenValues = {
1212
'16k': { prompt: 3, completion: 4 },
1313
'gpt-3.5-turbo-1106': { prompt: 1, completion: 2 },
1414
'gpt-4-1106': { prompt: 10, completion: 30 },
15+
'gpt-3.5-turbo-0125': { prompt: 0.5, completion: 1.5 },
1516
};
1617

1718
/**
@@ -29,6 +30,8 @@ const getValueKey = (model, endpoint) => {
2930

3031
if (modelName.includes('gpt-3.5-turbo-16k')) {
3132
return '16k';
33+
} else if (modelName.includes('gpt-3.5-turbo-0125')) {
34+
return 'gpt-3.5-turbo-0125';
3235
} else if (modelName.includes('gpt-3.5-turbo-1106')) {
3336
return 'gpt-3.5-turbo-1106';
3437
} else if (modelName.includes('gpt-3.5')) {

api/models/tx.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ describe('getMultiplier', () => {
9090
expect(getMultiplier({ tokenType: 'completion', model: 'gpt-4-turbo-vision-preview' })).toBe(
9191
tokenValues['gpt-4-1106'].completion,
9292
);
93+
expect(getMultiplier({ tokenType: 'completion', model: 'gpt-3.5-turbo-0125' })).toBe(
94+
tokenValues['gpt-3.5-turbo-0125'].completion,
95+
);
9396
});
9497

9598
it('should return defaultRate if derived valueKey does not match any known patterns', () => {

api/utils/tokens.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const openAIModels = {
5555
'gpt-3.5-turbo-16k': 16375, // -10 from max
5656
'gpt-3.5-turbo-16k-0613': 16375, // -10 from max
5757
'gpt-3.5-turbo-1106': 16375, // -10 from max
58+
'gpt-3.5-turbo-0125': 16375, // -10 from max
5859
'mistral-': 31990, // -10 from max
5960
};
6061

api/utils/tokens.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ describe('getModelMaxTokens', () => {
9292
expect(getModelMaxTokens('gpt-4-0125-preview')).toBe(
9393
maxTokensMap[EModelEndpoint.openAI]['gpt-4-0125'],
9494
);
95+
expect(getModelMaxTokens('gpt-3.5-turbo-0125')).toBe(
96+
maxTokensMap[EModelEndpoint.openAI]['gpt-3.5-turbo-0125'],
97+
);
9598
});
9699

97100
test('should return correct tokens for Anthropic models', () => {

docs/install/configuration/dotenv.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ DEBUG_OPENAI=false
317317
- Leave it blank or commented out to use internal settings.
318318

319319
```bash
320-
OPENAI_MODELS=gpt-3.5-turbo-0301,gpt-3.5-turbo,gpt-4,gpt-4-0613,gpt-4-vision-preview,gpt-3.5-turbo-0613,gpt-3.5-turbo-16k-0613,gpt-4-0125-preview,gpt-4-turbo-preview,gpt-4-1106-preview,gpt-3.5-turbo-1106,gpt-3.5-turbo-instruct,gpt-3.5-turbo-instruct-0914,gpt-3.5-turbo-16k
320+
OPENAI_MODELS=gpt-3.5-turbo-0125,gpt-3.5-turbo-0301,gpt-3.5-turbo,gpt-4,gpt-4-0613,gpt-4-vision-preview,gpt-3.5-turbo-0613,gpt-3.5-turbo-16k-0613,gpt-4-0125-preview,gpt-4-turbo-preview,gpt-4-1106-preview,gpt-3.5-turbo-1106,gpt-3.5-turbo-instruct,gpt-3.5-turbo-instruct-0914,gpt-3.5-turbo-16k
321321
```
322322

323323
- Titling is enabled by default when initiating a conversation.
@@ -383,7 +383,7 @@ Here are some useful documentation about plugins:
383383
- Identify the available models, separated by commas **without spaces**. The first model in the list will be set as default. Leave it blank or commented out to use internal settings.
384384

385385
```bash
386-
PLUGIN_MODELS=gpt-4,gpt-4-turbo-preview,gpt-4-0125-preview,gpt-4-1106-preview,gpt-4-0613,gpt-3.5-turbo,gpt-3.5-turbo-1106,gpt-3.5-turbo-0613
386+
PLUGIN_MODELS=gpt-4,gpt-4-turbo-preview,gpt-4-0125-preview,gpt-4-1106-preview,gpt-4-0613,gpt-3.5-turbo,gpt-3.5-turbo-0125,gpt-3.5-turbo-1106,gpt-3.5-turbo-0613
387387
```
388388

389389
- Set to false or comment out to disable debug mode for plugins

packages/data-provider/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const defaultModels = {
9191
'claude-instant-1-100k',
9292
],
9393
[EModelEndpoint.openAI]: [
94+
'gpt-3.5-turbo-0125',
9495
'gpt-3.5-turbo-16k-0613',
9596
'gpt-3.5-turbo-16k',
9697
'gpt-4-turbo-preview',

0 commit comments

Comments
 (0)