Skip to content

Commit f7c2e8d

Browse files
Improve Google Gemini defaults, temperature, and cost reporting (#9327)
1 parent aa2a17f commit f7c2e8d

File tree

10 files changed

+360
-312
lines changed

10 files changed

+360
-312
lines changed

packages/types/src/providers/gemini.ts

Lines changed: 49 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -3,138 +3,12 @@ import type { ModelInfo } from "../model.js"
33
// https://ai.google.dev/gemini-api/docs/models/gemini
44
export type GeminiModelId = keyof typeof geminiModels
55

6-
export const geminiDefaultModelId: GeminiModelId = "gemini-2.0-flash-001"
6+
export const geminiDefaultModelId: GeminiModelId = "gemini-2.5-pro"
77

88
export const geminiModels = {
9-
// Latest models (pointing to the most recent stable versions)
10-
"gemini-flash-latest": {
11-
maxTokens: 65_536,
12-
contextWindow: 1_048_576,
13-
supportsImages: true,
14-
supportsPromptCache: true,
15-
inputPrice: 0.3,
16-
outputPrice: 2.5,
17-
cacheReadsPrice: 0.075,
18-
cacheWritesPrice: 1.0,
19-
maxThinkingTokens: 24_576,
20-
supportsReasoningBudget: true,
21-
},
22-
"gemini-flash-lite-latest": {
23-
maxTokens: 65_536,
24-
contextWindow: 1_048_576,
25-
supportsImages: true,
26-
supportsPromptCache: true,
27-
inputPrice: 0.1,
28-
outputPrice: 0.4,
29-
cacheReadsPrice: 0.025,
30-
cacheWritesPrice: 1.0,
31-
supportsReasoningBudget: true,
32-
maxThinkingTokens: 24_576,
33-
},
34-
35-
// 2.5 Flash models (09-2025 versions - most recent)
36-
"gemini-2.5-flash-preview-09-2025": {
37-
maxTokens: 65_536,
38-
contextWindow: 1_048_576,
39-
supportsImages: true,
40-
supportsPromptCache: true,
41-
inputPrice: 0.3,
42-
outputPrice: 2.5,
43-
cacheReadsPrice: 0.075,
44-
cacheWritesPrice: 1.0,
45-
maxThinkingTokens: 24_576,
46-
supportsReasoningBudget: true,
47-
},
48-
"gemini-2.5-flash-lite-preview-09-2025": {
49-
maxTokens: 65_536,
50-
contextWindow: 1_048_576,
51-
supportsImages: true,
52-
supportsPromptCache: true,
53-
inputPrice: 0.1,
54-
outputPrice: 0.4,
55-
cacheReadsPrice: 0.025,
56-
cacheWritesPrice: 1.0,
57-
supportsReasoningBudget: true,
58-
maxThinkingTokens: 24_576,
59-
},
60-
61-
// 2.5 Flash models (06-17 version)
62-
"gemini-2.5-flash-lite-preview-06-17": {
63-
maxTokens: 64_000,
64-
contextWindow: 1_048_576,
65-
supportsImages: true,
66-
supportsPromptCache: true,
67-
inputPrice: 0.1,
68-
outputPrice: 0.4,
69-
cacheReadsPrice: 0.025,
70-
cacheWritesPrice: 1.0,
71-
supportsReasoningBudget: true,
72-
maxThinkingTokens: 24_576,
73-
},
74-
75-
// 2.5 Flash models (05-20 versions)
76-
"gemini-2.5-flash-preview-05-20:thinking": {
77-
maxTokens: 65_535,
78-
contextWindow: 1_048_576,
79-
supportsImages: true,
80-
supportsPromptCache: true,
81-
inputPrice: 0.15,
82-
outputPrice: 3.5,
83-
cacheReadsPrice: 0.0375,
84-
cacheWritesPrice: 1.0,
85-
maxThinkingTokens: 24_576,
86-
supportsReasoningBudget: true,
87-
requiredReasoningBudget: true,
88-
},
89-
"gemini-2.5-flash-preview-05-20": {
90-
maxTokens: 65_535,
91-
contextWindow: 1_048_576,
92-
supportsImages: true,
93-
supportsPromptCache: true,
94-
inputPrice: 0.15,
95-
outputPrice: 0.6,
96-
cacheReadsPrice: 0.0375,
97-
cacheWritesPrice: 1.0,
98-
},
99-
100-
// 2.5 Flash models (04-17 versions)
101-
"gemini-2.5-flash-preview-04-17:thinking": {
102-
maxTokens: 65_535,
103-
contextWindow: 1_048_576,
104-
supportsImages: true,
105-
supportsPromptCache: false,
106-
inputPrice: 0.15,
107-
outputPrice: 3.5,
108-
maxThinkingTokens: 24_576,
109-
supportsReasoningBudget: true,
110-
requiredReasoningBudget: true,
111-
},
112-
"gemini-2.5-flash-preview-04-17": {
113-
maxTokens: 65_535,
114-
contextWindow: 1_048_576,
115-
supportsImages: true,
116-
supportsPromptCache: false,
117-
inputPrice: 0.15,
118-
outputPrice: 0.6,
119-
},
120-
121-
// 2.5 Flash stable
122-
"gemini-2.5-flash": {
123-
maxTokens: 64_000,
124-
contextWindow: 1_048_576,
125-
supportsImages: true,
126-
supportsPromptCache: true,
127-
inputPrice: 0.3,
128-
outputPrice: 2.5,
129-
cacheReadsPrice: 0.075,
130-
cacheWritesPrice: 1.0,
131-
maxThinkingTokens: 24_576,
132-
supportsReasoningBudget: true,
133-
},
134-
1359
// 2.5 Pro models
136-
"gemini-2.5-pro-preview-06-05": {
137-
maxTokens: 65_535,
10+
"gemini-2.5-pro": {
11+
maxTokens: 64_000,
13812
contextWindow: 1_048_576,
13913
supportsImages: true,
14014
supportsPromptCache: true,
@@ -144,6 +18,7 @@ export const geminiModels = {
14418
cacheWritesPrice: 4.5,
14519
maxThinkingTokens: 32_768,
14620
supportsReasoningBudget: true,
21+
requiredReasoningBudget: true,
14722
tiers: [
14823
{
14924
contextWindow: 200_000,
@@ -159,7 +34,7 @@ export const geminiModels = {
15934
},
16035
],
16136
},
162-
"gemini-2.5-pro-preview-05-06": {
37+
"gemini-2.5-pro-preview-06-05": {
16338
maxTokens: 65_535,
16439
contextWindow: 1_048_576,
16540
supportsImages: true,
@@ -168,6 +43,8 @@ export const geminiModels = {
16843
outputPrice: 15,
16944
cacheReadsPrice: 0.625,
17045
cacheWritesPrice: 4.5,
46+
maxThinkingTokens: 32_768,
47+
supportsReasoningBudget: true,
17148
tiers: [
17249
{
17350
contextWindow: 200_000,
@@ -183,7 +60,7 @@ export const geminiModels = {
18360
},
18461
],
18562
},
186-
"gemini-2.5-pro-preview-03-25": {
63+
"gemini-2.5-pro-preview-05-06": {
18764
maxTokens: 65_535,
18865
contextWindow: 1_048_576,
18966
supportsImages: true,
@@ -192,8 +69,6 @@ export const geminiModels = {
19269
outputPrice: 15,
19370
cacheReadsPrice: 0.625,
19471
cacheWritesPrice: 4.5,
195-
maxThinkingTokens: 32_768,
196-
supportsReasoningBudget: true,
19772
tiers: [
19873
{
19974
contextWindow: 200_000,
@@ -209,26 +84,17 @@ export const geminiModels = {
20984
},
21085
],
21186
},
212-
"gemini-2.5-pro-exp-03-25": {
87+
"gemini-2.5-pro-preview-03-25": {
21388
maxTokens: 65_535,
21489
contextWindow: 1_048_576,
21590
supportsImages: true,
216-
supportsPromptCache: false,
217-
inputPrice: 0,
218-
outputPrice: 0,
219-
},
220-
"gemini-2.5-pro": {
221-
maxTokens: 64_000,
222-
contextWindow: 1_048_576,
223-
supportsImages: true,
22491
supportsPromptCache: true,
22592
inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
22693
outputPrice: 15,
22794
cacheReadsPrice: 0.625,
22895
cacheWritesPrice: 4.5,
22996
maxThinkingTokens: 32_768,
23097
supportsReasoningBudget: true,
231-
requiredReasoningBudget: true,
23298
tiers: [
23399
{
234100
contextWindow: 200_000,
@@ -245,127 +111,67 @@ export const geminiModels = {
245111
],
246112
},
247113

248-
// 2.0 Flash models
249-
"gemini-2.0-flash-lite-preview-02-05": {
250-
maxTokens: 8192,
114+
// 2.5 Flash models
115+
"gemini-flash-latest": {
116+
maxTokens: 65_536,
251117
contextWindow: 1_048_576,
252118
supportsImages: true,
253-
supportsPromptCache: false,
254-
inputPrice: 0,
255-
outputPrice: 0,
119+
supportsPromptCache: true,
120+
inputPrice: 0.3,
121+
outputPrice: 2.5,
122+
cacheReadsPrice: 0.075,
123+
cacheWritesPrice: 1.0,
124+
maxThinkingTokens: 24_576,
125+
supportsReasoningBudget: true,
256126
},
257-
"gemini-2.0-flash-thinking-exp-01-21": {
127+
"gemini-2.5-flash-preview-09-2025": {
258128
maxTokens: 65_536,
259129
contextWindow: 1_048_576,
260130
supportsImages: true,
261-
supportsPromptCache: false,
262-
inputPrice: 0,
263-
outputPrice: 0,
264-
},
265-
"gemini-2.0-flash-thinking-exp-1219": {
266-
maxTokens: 8192,
267-
contextWindow: 32_767,
268-
supportsImages: true,
269-
supportsPromptCache: false,
270-
inputPrice: 0,
271-
outputPrice: 0,
131+
supportsPromptCache: true,
132+
inputPrice: 0.3,
133+
outputPrice: 2.5,
134+
cacheReadsPrice: 0.075,
135+
cacheWritesPrice: 1.0,
136+
maxThinkingTokens: 24_576,
137+
supportsReasoningBudget: true,
272138
},
273-
"gemini-2.0-flash-exp": {
274-
maxTokens: 8192,
139+
"gemini-2.5-flash": {
140+
maxTokens: 64_000,
275141
contextWindow: 1_048_576,
276142
supportsImages: true,
277-
supportsPromptCache: false,
278-
inputPrice: 0,
279-
outputPrice: 0,
143+
supportsPromptCache: true,
144+
inputPrice: 0.3,
145+
outputPrice: 2.5,
146+
cacheReadsPrice: 0.075,
147+
cacheWritesPrice: 1.0,
148+
maxThinkingTokens: 24_576,
149+
supportsReasoningBudget: true,
280150
},
281-
"gemini-2.0-flash-001": {
282-
maxTokens: 8192,
151+
152+
// 2.5 Flash Lite models
153+
"gemini-flash-lite-latest": {
154+
maxTokens: 65_536,
283155
contextWindow: 1_048_576,
284156
supportsImages: true,
285157
supportsPromptCache: true,
286158
inputPrice: 0.1,
287159
outputPrice: 0.4,
288160
cacheReadsPrice: 0.025,
289161
cacheWritesPrice: 1.0,
162+
supportsReasoningBudget: true,
163+
maxThinkingTokens: 24_576,
290164
},
291-
292-
// 2.0 Pro models
293-
"gemini-2.0-pro-exp-02-05": {
294-
maxTokens: 8192,
295-
contextWindow: 2_097_152,
296-
supportsImages: true,
297-
supportsPromptCache: false,
298-
inputPrice: 0,
299-
outputPrice: 0,
300-
},
301-
302-
// 1.5 Flash models
303-
"gemini-1.5-flash-002": {
304-
maxTokens: 8192,
165+
"gemini-2.5-flash-lite-preview-09-2025": {
166+
maxTokens: 65_536,
305167
contextWindow: 1_048_576,
306168
supportsImages: true,
307169
supportsPromptCache: true,
308-
inputPrice: 0.15, // This is the pricing for prompts above 128k tokens.
309-
outputPrice: 0.6,
310-
cacheReadsPrice: 0.0375,
170+
inputPrice: 0.1,
171+
outputPrice: 0.4,
172+
cacheReadsPrice: 0.025,
311173
cacheWritesPrice: 1.0,
312-
tiers: [
313-
{
314-
contextWindow: 128_000,
315-
inputPrice: 0.075,
316-
outputPrice: 0.3,
317-
cacheReadsPrice: 0.01875,
318-
},
319-
{
320-
contextWindow: Infinity,
321-
inputPrice: 0.15,
322-
outputPrice: 0.6,
323-
cacheReadsPrice: 0.0375,
324-
},
325-
],
326-
},
327-
"gemini-1.5-flash-exp-0827": {
328-
maxTokens: 8192,
329-
contextWindow: 1_048_576,
330-
supportsImages: true,
331-
supportsPromptCache: false,
332-
inputPrice: 0,
333-
outputPrice: 0,
334-
},
335-
"gemini-1.5-flash-8b-exp-0827": {
336-
maxTokens: 8192,
337-
contextWindow: 1_048_576,
338-
supportsImages: true,
339-
supportsPromptCache: false,
340-
inputPrice: 0,
341-
outputPrice: 0,
342-
},
343-
344-
// 1.5 Pro models
345-
"gemini-1.5-pro-002": {
346-
maxTokens: 8192,
347-
contextWindow: 2_097_152,
348-
supportsImages: true,
349-
supportsPromptCache: false,
350-
inputPrice: 0,
351-
outputPrice: 0,
352-
},
353-
"gemini-1.5-pro-exp-0827": {
354-
maxTokens: 8192,
355-
contextWindow: 2_097_152,
356-
supportsImages: true,
357-
supportsPromptCache: false,
358-
inputPrice: 0,
359-
outputPrice: 0,
360-
},
361-
362-
// Experimental models
363-
"gemini-exp-1206": {
364-
maxTokens: 8192,
365-
contextWindow: 2_097_152,
366-
supportsImages: true,
367-
supportsPromptCache: false,
368-
inputPrice: 0,
369-
outputPrice: 0,
174+
supportsReasoningBudget: true,
175+
maxThinkingTokens: 24_576,
370176
},
371177
} as const satisfies Record<string, ModelInfo>

0 commit comments

Comments
 (0)