Skip to content

Commit 2861512

Browse files
committed
feat: add gpt-5
1 parent 9c9d845 commit 2861512

4 files changed

Lines changed: 47 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "llm-info",
3-
"version": "1.0.56",
3+
"version": "1.0.57",
44
"description": "Information on LLM models, context window token limit, output token limit, pricing and more",
55
"homepage": "https://eval.16x.engineer/",
66
"repository": {

src/ModelInfoMap.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,47 @@ export const ModelInfoMap: Record<
133133
small: true,
134134
legacy: false,
135135
},
136+
[ModelEnum['gpt-5']]: {
137+
name: 'GPT-5',
138+
provider: AI_PROVIDERS.OPENAI,
139+
contextWindowTokenLimit: 400000,
140+
outputTokenLimit: 128000,
141+
pricePerMillionInputTokens: 1.25,
142+
pricePerMillionOutputTokens: 10,
143+
tokenizerId: 'Xenova/gpt-4o',
144+
supportsImageInput: true,
145+
reasoning: true,
146+
legacy: false,
147+
openRouterModelId: 'openai/gpt-5',
148+
},
149+
[ModelEnum['gpt-5-mini']]: {
150+
name: 'GPT-5 mini',
151+
provider: AI_PROVIDERS.OPENAI,
152+
contextWindowTokenLimit: 400000,
153+
outputTokenLimit: 128000,
154+
pricePerMillionInputTokens: 0.25,
155+
pricePerMillionOutputTokens: 2,
156+
tokenizerId: 'Xenova/gpt-4o',
157+
supportsImageInput: true,
158+
reasoning: true,
159+
small: true,
160+
legacy: false,
161+
openRouterModelId: 'openai/gpt-5-mini',
162+
},
163+
[ModelEnum['gpt-5-nano']]: {
164+
name: 'GPT-5 nano',
165+
provider: AI_PROVIDERS.OPENAI,
166+
contextWindowTokenLimit: 400000,
167+
outputTokenLimit: 128000,
168+
pricePerMillionInputTokens: 0.05,
169+
pricePerMillionOutputTokens: 0.4,
170+
tokenizerId: 'Xenova/gpt-4o',
171+
supportsImageInput: true,
172+
reasoning: true,
173+
small: true,
174+
legacy: false,
175+
openRouterModelId: 'openai/gpt-5-mini',
176+
},
136177
[ModelEnum['o1-preview']]: {
137178
name: 'o1-preview',
138179
provider: AI_PROVIDERS.OPENAI,

src/model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export enum ModelEnum {
88
'gpt-4.1' = 'gpt-4.1',
99
'gpt-4.1-mini' = 'gpt-4.1-mini',
1010
'gpt-4.1-nano' = 'gpt-4.1-nano',
11+
'gpt-5' = 'gpt-5',
12+
'gpt-5-mini' = 'gpt-5-mini',
13+
'gpt-5-nano' = 'gpt-5-nano',
1114
'o1-preview' = 'o1-preview',
1215
'o1-mini' = 'o1-mini',
1316
'o1' = 'o1',

test/openai.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('OpenAI API', () => {
44
// Skip test if OPENAI_API_KEY is not set
55
const testFn = process.env.OPENAI_API_KEY ? it : it.skip;
66

7-
const testModels = [ModelEnum['gpt-4.1']];
7+
const testModels = [ModelEnum['gpt-4.1'], ModelEnum['gpt-5']];
88
// const testModels = [
99
// ModelEnum['gpt-4.1'],
1010
// ModelEnum['o4-mini'],
@@ -22,7 +22,7 @@ describe('OpenAI API', () => {
2222
const response = await openai.chat.completions.create({
2323
model,
2424
messages: [{ role: 'user', content: 'Hello, who are you?' }],
25-
max_completion_tokens: 100,
25+
max_completion_tokens: 200,
2626
});
2727

2828
expect(response.choices[0].message.content).toBeTruthy();

0 commit comments

Comments
 (0)