Skip to content

feat(ai-gemini): add Nano Banana 2.1 image model #1640

Closed

Description

@tombeckenham

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 the gemini-<version>-flash-image pattern 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 in GEMINI_IMAGE_MODELS
  • packages/ai-gemini/src/image/image-provider-options.ts: add it to the GeminiNativeImageModels union (sizes and image input modalities)
  • Unit test for native generateContent routing and size parsing
  • E2E coverage as the repo requires
  • Changeset, docs (docs/adapters/gemini.md, docs/media/image-generation.md), and the media-generation skill 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

  1. added a commit that references this issue on Oct 7, 2026
    73f9ddc
  2. added a commit that references this issue on Oct 7, 2026
    8421e3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

has-prAn open PR references this issuewaiting-on: maintainerThe ball is in the maintainers’ court

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions