Skip to content

Commit db52d7f

Browse files
feat(models): add Gemini 3.5 Flash Lite and 3.1 Flash Lite to Gemini API provider (#1334)
* feat(models): add Gemini 3.5 Flash Lite and 3.1 Flash Lite to Gemini API provider Adds the two new stable Flash Lite models so users can select them directly instead of relying on gemini-flash-lite-latest (#1251). Model ids, limits and pricing verified against the official Gemini API docs and the OpenRouter catalog. * fix(models): support minimal thinking level for Gemini 3.1 Flash Lite The official model docs list minimal, low, medium, and high thinking levels for gemini-3.1-flash-lite; add the missing minimal level (CodeRabbit review on #1334). * fix(models): default Flash Lite reasoning effort to minimal The documented API defaults are On (minimal) for gemini-3.5-flash-lite and minimal is the lowest supported level for gemini-3.1-flash-lite; defaulting to medium would raise unset users above the cheap tier. Addressed via CodeRabbit review on #1334. --------- Co-authored-by: Eason Liang <[email protected]>
1 parent 1ad8f52 commit db52d7f

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

‎packages/types/src/__tests__/google-models.test.ts‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,41 @@ describe.each([
1010
expect(model.cacheWritesPrice).toBe(0.5)
1111
})
1212
})
13+
14+
describe.each([
15+
["gemini-3.5-flash-lite", geminiModels["gemini-3.5-flash-lite"]],
16+
["gemini-3.1-flash-lite", geminiModels["gemini-3.1-flash-lite"]],
17+
])("Gemini 3.x Flash Lite model %s", (_modelId, model) => {
18+
it("is registered with the documented limits and multimodal support", () => {
19+
expect(model.maxTokens).toBe(65_536)
20+
expect(model.contextWindow).toBe(1_048_576)
21+
expect(model.supportsImages).toBe(true)
22+
expect(model.supportsPromptCache).toBe(true)
23+
expect(model.supportsReasoningBudget).toBe(false)
24+
})
25+
})
26+
27+
it("exposes the documented thinking levels and pricing for Gemini 3.5 Flash Lite", () => {
28+
const model = geminiModels["gemini-3.5-flash-lite"]
29+
expect(model.supportsReasoningEffort).toEqual(["minimal", "low", "medium", "high"])
30+
// The documented API default is On (minimal):
31+
// https://ai.google.dev/gemini-api/docs/thinking
32+
expect(model.reasoningEffort).toBe("minimal")
33+
expect(model.inputPrice).toBe(0.3)
34+
expect(model.outputPrice).toBe(2.5)
35+
expect(model.cacheReadsPrice).toBe(0.03)
36+
expect(model.cacheWritesPrice).toBe(1.0)
37+
})
38+
39+
it("exposes the documented thinking levels and pricing for Gemini 3.1 Flash Lite", () => {
40+
const model = geminiModels["gemini-3.1-flash-lite"]
41+
// https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-1-flash-lite
42+
// "choosing from minimal, low, medium, or high thinking levels"
43+
expect(model.supportsReasoningEffort).toEqual(["minimal", "low", "medium", "high"])
44+
// Lowest supported level, matching the cheap/free Flash Lite tier.
45+
expect(model.reasoningEffort).toBe("minimal")
46+
expect(model.inputPrice).toBe(0.25)
47+
expect(model.outputPrice).toBe(1.5)
48+
expect(model.cacheReadsPrice).toBe(0.025)
49+
expect(model.cacheWritesPrice).toBe(1.0)
50+
})

‎packages/types/src/providers/gemini.ts‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,37 @@ export const geminiModels = {
145145
outputPrice: 3.0,
146146
cacheReadsPrice: 0.05,
147147
},
148+
// 3.x Flash Lite models
149+
"gemini-3.5-flash-lite": {
150+
maxTokens: 65_536,
151+
contextWindow: 1_048_576,
152+
supportsImages: true,
153+
supportsPromptCache: true,
154+
supportsReasoningEffort: ["minimal", "low", "medium", "high"],
155+
// Matches the documented API default thinking level (On (minimal)).
156+
reasoningEffort: "minimal",
157+
inputPrice: 0.3,
158+
outputPrice: 2.5,
159+
cacheReadsPrice: 0.03,
160+
cacheWritesPrice: 1.0,
161+
supportsReasoningBudget: false,
162+
},
163+
"gemini-3.1-flash-lite": {
164+
maxTokens: 65_536,
165+
contextWindow: 1_048_576,
166+
supportsImages: true,
167+
supportsPromptCache: true,
168+
supportsReasoningEffort: ["minimal", "low", "medium", "high"],
169+
// Lowest level of the supported set: keeps the cheap/free tier's
170+
// default latency and cost in line with the Flash Lite tier.
171+
reasoningEffort: "minimal",
172+
inputPrice: 0.25,
173+
outputPrice: 1.5,
174+
cacheReadsPrice: 0.025,
175+
cacheWritesPrice: 1.0,
176+
supportsReasoningBudget: false,
177+
},
178+
148179
// 2.5 Pro models
149180
"gemini-2.5-pro": {
150181
maxTokens: 64_000,

0 commit comments

Comments
 (0)