Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 124 additions & 53 deletions packages/types/src/providers/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,73 @@ export type GeminiModelId = keyof typeof geminiModels
export const geminiDefaultModelId: GeminiModelId = "gemini-2.0-flash-001"

export const geminiModels = {
"gemini-2.5-flash-preview-04-17:thinking": {
maxTokens: 65_535,
// Latest models (pointing to the most recent stable versions)
"gemini-flash-latest": {
maxTokens: 65_536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.15,
outputPrice: 3.5,
supportsPromptCache: true,
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.075,
cacheWritesPrice: 1.0,
maxThinkingTokens: 24_576,
supportsReasoningBudget: true,
requiredReasoningBudget: true,
},
"gemini-2.5-flash-preview-04-17": {
maxTokens: 65_535,
"gemini-flash-lite-latest": {
maxTokens: 65_536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.15,
outputPrice: 0.6,
supportsPromptCache: true,
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
cacheWritesPrice: 1.0,
supportsReasoningBudget: true,
maxThinkingTokens: 24_576,
},

// 2.5 Flash models (09-2025 versions - most recent)
"gemini-2.5-flash-preview-09-2025": {
maxTokens: 65_536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.075,
cacheWritesPrice: 1.0,
maxThinkingTokens: 24_576,
supportsReasoningBudget: true,
},
"gemini-2.5-flash-lite-preview-09-2025": {
maxTokens: 65_536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
cacheWritesPrice: 1.0,
supportsReasoningBudget: true,
maxThinkingTokens: 24_576,
},

// 2.5 Flash models (06-17 version)
"gemini-2.5-flash-lite-preview-06-17": {
maxTokens: 64_000,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
cacheWritesPrice: 1.0,
supportsReasoningBudget: true,
maxThinkingTokens: 24_576,
},

// 2.5 Flash models (05-20 versions)
"gemini-2.5-flash-preview-05-20:thinking": {
maxTokens: 65_535,
contextWindow: 1_048_576,
Expand All @@ -48,6 +96,29 @@ export const geminiModels = {
cacheReadsPrice: 0.0375,
cacheWritesPrice: 1.0,
},

// 2.5 Flash models (04-17 versions)
"gemini-2.5-flash-preview-04-17:thinking": {
maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.15,
outputPrice: 3.5,
maxThinkingTokens: 24_576,
supportsReasoningBudget: true,
requiredReasoningBudget: true,
},
"gemini-2.5-flash-preview-04-17": {
maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.15,
outputPrice: 0.6,
},

// 2.5 Flash stable
"gemini-2.5-flash": {
maxTokens: 64_000,
contextWindow: 1_048_576,
Expand All @@ -60,15 +131,9 @@ export const geminiModels = {
maxThinkingTokens: 24_576,
supportsReasoningBudget: true,
},
"gemini-2.5-pro-exp-03-25": {
maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
},
"gemini-2.5-pro-preview-03-25": {

// 2.5 Pro models
"gemini-2.5-pro-preview-06-05": {
maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
Expand All @@ -77,6 +142,8 @@ export const geminiModels = {
outputPrice: 15,
cacheReadsPrice: 0.625,
cacheWritesPrice: 4.5,
maxThinkingTokens: 32_768,
supportsReasoningBudget: true,
tiers: [
{
contextWindow: 200_000,
Expand Down Expand Up @@ -116,7 +183,7 @@ export const geminiModels = {
},
],
},
"gemini-2.5-pro-preview-06-05": {
"gemini-2.5-pro-preview-03-25": {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Backward-compatibility regression: gemini-2.5-pro-preview-03-25 no longer includes maxThinkingTokens and supportsReasoningBudget. Losing these flags can disable reasoning-budget controls for users pinned to this version. Unless docs confirm the capability was removed, keep these fields to preserve behavior.

Suggested fix:

Suggested change
"gemini-2.5-pro-preview-03-25": {
inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
outputPrice: 15,
cacheReadsPrice: 0.625,
cacheWritesPrice: 4.5,
maxThinkingTokens: 32_768,
supportsReasoningBudget: true,
tiers: [

maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
Expand All @@ -125,8 +192,6 @@ export const geminiModels = {
outputPrice: 15,
cacheReadsPrice: 0.625,
cacheWritesPrice: 4.5,
maxThinkingTokens: 32_768,
supportsReasoningBudget: true,
tiers: [
{
contextWindow: 200_000,
Expand All @@ -142,6 +207,14 @@ export const geminiModels = {
},
],
},
"gemini-2.5-pro-exp-03-25": {
maxTokens: 65_535,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
},
"gemini-2.5-pro": {
maxTokens: 64_000,
contextWindow: 1_048_576,
Expand Down Expand Up @@ -169,16 +242,8 @@ export const geminiModels = {
},
],
},
"gemini-2.0-flash-001": {
maxTokens: 8192,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
cacheWritesPrice: 1.0,
},

// 2.0 Flash models
"gemini-2.0-flash-lite-preview-02-05": {
maxTokens: 8192,
contextWindow: 1_048_576,
Expand All @@ -187,14 +252,6 @@ export const geminiModels = {
inputPrice: 0,
outputPrice: 0,
},
"gemini-2.0-pro-exp-02-05": {
maxTokens: 8192,
contextWindow: 2_097_152,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
},
"gemini-2.0-flash-thinking-exp-01-21": {
maxTokens: 65_536,
contextWindow: 1_048_576,
Expand All @@ -219,6 +276,28 @@ export const geminiModels = {
inputPrice: 0,
outputPrice: 0,
},
"gemini-2.0-flash-001": {
maxTokens: 8192,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
cacheWritesPrice: 1.0,
},

// 2.0 Pro models
"gemini-2.0-pro-exp-02-05": {
maxTokens: 8192,
contextWindow: 2_097_152,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
},

// 1.5 Flash models
"gemini-1.5-flash-002": {
maxTokens: 8192,
contextWindow: 1_048_576,
Expand Down Expand Up @@ -259,6 +338,8 @@ export const geminiModels = {
inputPrice: 0,
outputPrice: 0,
},

// 1.5 Pro models
"gemini-1.5-pro-002": {
maxTokens: 8192,
contextWindow: 2_097_152,
Expand All @@ -275,6 +356,8 @@ export const geminiModels = {
inputPrice: 0,
outputPrice: 0,
},

// Experimental models
"gemini-exp-1206": {
maxTokens: 8192,
contextWindow: 2_097_152,
Expand All @@ -283,16 +366,4 @@ export const geminiModels = {
inputPrice: 0,
outputPrice: 0,
},
"gemini-2.5-flash-lite-preview-06-17": {
maxTokens: 64_000,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
cacheWritesPrice: 1.0,
supportsReasoningBudget: true,
maxThinkingTokens: 24_576,
},
} as const satisfies Record<string, ModelInfo>
Loading