Repository navigation
feat(ai-gemini): add Nano Banana 2.1 image model #1640
Description
Add Nano Banana 2.1 (gemini-nano-banana-2.1) to @tanstack/ai-gemini as a native image model.
Why the daily sync did not add it
OpenRouter listed google/gemini-nano-banana-2.1 on 2026-10-06. The Sync Model Metadata run that day added it to @tanstack/ai-openrouter and @tanstack/ai-vercel-gateway (#1636), but not to @tanstack/ai-gemini.
That is by design. scripts/sync-provider-models.ts drops every new model whose output modalities include image (outputsImage), because the Gemini image arrays need hand-written entries: the size and provider-option type maps and the native image union. So each new native image model needs a manual registration, as #870 did for Nano Banana 2 Lite.
Verified facts
From GET https://generativelanguage.googleapis.com/v1beta/models on 2026-10-07:
- Model id:
gemini-nano-banana-2.1(display name "Nano Banana 2.1"). The native id matches the OpenRouter id. It does not follow thegemini-<version>-flash-imagepattern of the earlier models. - Methods:
generateContent,countTokens,batchGenerateContent - Token limits: 65536 input, 65536 output (same as
gemini-3.1-flash-image) - Modalities (OpenRouter): output
image+text
Not yet verified
- Supported aspect ratios and resolution tiers (1K / 2K / 4K)
- Pricing
- Whether it accepts image input in the same way as
gemini-3.1-flash-image
Confirm these against Google's model page or a live call before writing the type maps.
Implementation
Follow #870:
packages/ai-gemini/src/model-meta.ts: add the model constant and register it inGEMINI_IMAGE_MODELSpackages/ai-gemini/src/image/image-provider-options.ts: add it to theGeminiNativeImageModelsunion (sizes and image input modalities)- Unit test for native
generateContentrouting and size parsing - E2E coverage as the repo requires
- Changeset, docs (
docs/adapters/gemini.md,docs/media/image-generation.md), and themedia-generationskill model lists
Follow-up, out of scope here
Image models still need a manual issue each time. Generating the Gemini image entries from a catalog that carries native ids and image capabilities would remove that step; #1308 (native model sync from modelschemas) is the likely place.
Activity
feat(ai-gemini): add Nano Banana 2.1 image model (gemini-nano-banana-…
feat(ai-gemini): add Nano Banana 2.1 image model (#1641)