Skip to content
Open
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions .changeset/gemini-model-meta-refresh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@tanstack/ai-gemini': minor
---

Sync Gemini model metadata with Google's current published model list (#620, #621).

**Added**

- `gemini-3.1-flash-lite` (stable GA) — joins the existing `gemini-3.1-flash-lite-preview` entry and qualifies for the native combined tools + `responseSchema` streaming path (`GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS`).

**Removed (retired by Google — these ids now 404 against the Gemini API or are no longer published)**

- `gemini-3-pro-preview` (verified 404; superseded by `gemini-3.1-pro-preview`)
- `gemini-2.5-flash-preview-09-2025` (superseded by stable `gemini-2.5-flash`)
- `gemini-2.5-flash-lite-preview-09-2025` (superseded by stable `gemini-2.5-flash-lite`)
- `gemini-2.0-flash` and `gemini-2.0-flash-lite` (2.0 line retired from Google's published list)
- `gemini-2.0-flash-preview-image-generation` (image; superseded by `gemini-2.5-flash-image`)

**Fixed**

- `gemini-3.5-flash` was missing from `GeminiChatModelToolCapabilitiesByName`, leaving its provider-tool typing broken.

If you were passing a removed id to `geminiText()` / `geminiSummarize()`, switch to the listed successor (e.g. `gemini-2.0-flash` → `gemini-2.5-flash`).
1 change: 0 additions & 1 deletion docs/adapters/gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ These models use the `generateContent` API and support resolution tiers (1K, 2K,
| `gemini-3.1-flash-image-preview` | Latest and fastest Gemini native image generation |
| `gemini-3-pro-image-preview` | Higher quality Gemini native image generation |
| `gemini-2.5-flash-image` | Gemini 2.5 Flash with image generation |
| `gemini-2.0-flash-preview-image-generation` | Gemini 2.0 Flash image generation |

### Imagen Models

Expand Down
2 changes: 1 addition & 1 deletion docs/adapters/openrouter.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ OpenRouter provides access to 300+ models from various providers. Models use the
```typescript
model: "openai/gpt-5.1"
model: "anthropic/claude-sonnet-4.5"
model: "google/gemini-3-pro-preview"
model: "google/gemini-3.1-pro-preview"
model: "meta-llama/llama-4-maverick"
model: "deepseek/deepseek-v3.2"
```
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/multimodal-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const message = {
```

**Supported modalities:**
- `gemini-2.0-flash`: text, image, audio, video
- `gemini-2.5-flash`: text, image, audio, video

### Ollama

Expand Down
1 change: 0 additions & 1 deletion docs/media/image-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ interface GeneratedImage {
| `gemini-3.1-flash-image-preview` | Latest and fastest Gemini native image generation |
| `gemini-3-pro-image-preview` | Higher quality Gemini native image generation |
| `gemini-2.5-flash-image` | Gemini 2.5 Flash with image generation |
| `gemini-2.0-flash-preview-image-generation` | Gemini 2.0 Flash image generation |

### Gemini Imagen Models

Expand Down
4 changes: 2 additions & 2 deletions examples/ts-react-chat/src/lib/model-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export const MODEL_OPTIONS: Array<ModelOption> = [
},
{
provider: 'gemini',
model: 'gemini-2.0-flash',
label: 'Gemini - 2.0 Flash',
model: 'gemini-2.5-flash',
label: 'Gemini - 2.5 Flash',
},

// Gemini Interactions (stateful, experimental — `@tanstack/ai-gemini/experimental`)
Expand Down
6 changes: 5 additions & 1 deletion examples/ts-react-chat/src/routes/api.structured-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ function adapterFor(provider: Provider, model?: string): AnyTextAdapter {
// `generateContentStream` call. Gemini 2.x is documented as brittle
// for the combination and falls back to the engine's legacy
// finalization path.
//
// Default is `gemini-3.5-flash`: the newest *stable* (non-preview)
// 3.x id, matching the dropdown's first entry. The previous default
// (`gemini-3-pro-preview`) was retired by Google and now 404s.
return geminiText(
(baseModel || 'gemini-3-pro-preview') as 'gemini-3-pro-preview',
(baseModel || 'gemini-3.5-flash') as 'gemini-3.5-flash',
)
case 'grok':
return grokText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ const PROVIDER_MODELS: Record<
// hit the engine's legacy finalization path instead.
//
// Naming gotcha: Google uses a dash separator for the major version
// (`gemini-3-pro-preview`) but a dot separator for the minor version
// (`gemini-3-flash-preview`) but a dot separator for the minor version
// (`gemini-3.1-pro-preview`). The dropdown values mirror the canonical
// ids from `ai-gemini/model-meta` — `GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS`
// keys on the exact string, so any drift here silently breaks
// combined-mode routing.
gemini: [
{ value: 'gemini-3.5-flash', label: 'Gemini 3.5 Flash' },
{ value: 'gemini-3-pro-preview', label: 'Gemini 3 Pro (Preview)' },
{ value: 'gemini-3-flash-preview', label: 'Gemini 3 Flash (Preview)' },
{ value: 'gemini-3.1-pro-preview', label: 'Gemini 3.1 Pro (Preview)' },
{ value: 'gemini-3.1-flash-lite', label: 'Gemini 3.1 Flash Lite' },
{
value: 'gemini-3.1-flash-lite-preview',
label: 'Gemini 3.1 Flash Lite (Preview)',
Expand Down
5 changes: 0 additions & 5 deletions examples/ts-svelte-chat/src/lib/model-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export const MODEL_OPTIONS: Array<ModelOption> = [
},

// Gemini
{
provider: 'gemini',
model: 'gemini-2.0-flash',
label: 'Gemini - 2.0 Flash',
},
{
provider: 'gemini',
model: 'gemini-2.5-flash',
Expand Down
2 changes: 1 addition & 1 deletion examples/ts-svelte-chat/src/routes/api/chat/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const adapterConfig = {
}),
gemini: () =>
createChatOptions({
adapter: geminiText('gemini-2.0-flash'),
adapter: geminiText('gemini-2.5-flash'),
}),
ollama: () =>
createChatOptions({
Expand Down
5 changes: 0 additions & 5 deletions examples/ts-vue-chat/src/lib/model-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export const MODEL_OPTIONS: Array<ModelOption> = [
},

// Gemini
{
provider: 'gemini',
model: 'gemini-2.0-flash',
label: 'Gemini - 2.0 Flash',
},
{
provider: 'gemini',
model: 'gemini-2.5-flash',
Expand Down
2 changes: 1 addition & 1 deletion examples/ts-vue-chat/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export default defineConfig({
adapter = anthropicText(selectedModel)
break
case 'gemini':
selectedModel = model || 'gemini-2.0-flash'
selectedModel = model || 'gemini-2.5-flash'
adapter = geminiText(selectedModel)
break
case 'ollama':
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-code-mode-skills/test-cli/adapters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface AdapterDefinition {
const OPENAI_MODEL = process.env.OPENAI_MODEL || 'gpt-4o'
const ANTHROPIC_MODEL =
process.env.ANTHROPIC_MODEL || 'claude-sonnet-4-20250514'
const GEMINI_MODEL = process.env.GEMINI_MODEL || 'gemini-2.0-flash'
const GEMINI_MODEL = process.env.GEMINI_MODEL || 'gemini-2.5-flash'

/**
* Create OpenAI adapter
Expand Down
4 changes: 2 additions & 2 deletions packages/ai-code-mode-skills/test-cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ program

try {
const { geminiText } = await import('@tanstack/ai-gemini')
const modelName = model || 'gemini-2.0-flash'
const modelName = model || 'gemini-2.5-flash'
adapter = geminiText(modelName, { apiKey })
logInfo(`Using Gemini adapter with model: ${modelName}`)
} catch (error) {
Expand Down Expand Up @@ -721,7 +721,7 @@ program

try {
const { geminiText } = await import('@tanstack/ai-gemini')
const modelName = model || 'gemini-2.0-flash'
const modelName = model || 'gemini-2.5-flash'
adapter = geminiText(modelName, { apiKey })
logInfo(`Using Gemini adapter with model: ${modelName}`)
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions packages/ai-gemini/src/adapters/summarize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type GeminiSummarizeModel = (typeof GEMINI_MODELS)[number]
*
* @example
* ```typescript
* const adapter = createGeminiSummarize('AIza...', 'gemini-2.0-flash');
* const adapter = createGeminiSummarize('AIza...', 'gemini-2.5-flash');
* ```
*/
export function createGeminiSummarize<TModel extends GeminiSummarizeModel>(
Expand All @@ -44,7 +44,7 @@ export function createGeminiSummarize<TModel extends GeminiSummarizeModel>(
*
* @example
* ```typescript
* const adapter = geminiSummarize('gemini-2.0-flash');
* const adapter = geminiSummarize('gemini-2.5-flash');
* await summarize({ adapter, text: 'Long article text...' });
* ```
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ai-gemini/src/image/image-provider-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export type GeminiNativeImageModels =
| 'gemini-3.1-flash-image-preview'
| 'gemini-3-pro-image-preview'
| 'gemini-2.5-flash-image'
| 'gemini-2.0-flash-preview-image-generation'

/**
* Model-specific size options mapping.
Expand Down
Loading