Charlie Roffe

Principal Architect & Engineering Director · Cloud & AI

Madrid, Spain · LinkedIn · GitHub

ADR-029: Curated Gemini Model Lineup

Context

ADR-005 standardized every demo on a single model, Gemini 3.5 Flash, while every demo already rendered a model picker built for more than one entry. Google has since shipped newer generations: Gemini 3.8 Flash (newest stable Flash) and Gemini 3.5 Flash-Lite (newest stable low-cost tier).

Opening the picker exposed a latent gap: the API forwarded any `model` string from the request body straight to Vertex AI. With one hard-coded default that never mattered; with a real picker anyone could route traffic — and cost — to an arbitrary model through the public API.

Decision

Offer a curated, allowlisted Gemini lineup defined once in `src/data/models.ts` and shared by client and server: Gemini 3.8 Flash (GA, default for every demo and the copilot) and Gemini 3.5 Flash-Lite (GA, fastest and cheapest).

1. One source of truth: the pickers render the list; the server only accepts ids on it.
2. Self-healing allowlist: a missing, retired or arbitrary model id resolves to the default instead of erroring, so cached pages keep working and no request reaches a model the site does not offer.
3. EU residency is the entry bar (ADR-013): a model joins only if Vertex serves it on the `eu` multi-region endpoint, and the CI gate verifies every lineup model there before any image is built.
4. The copilot honours the picker: the model is checkpointed with the copilot session (ADR-024) and returned so the telemetry shows what actually ran.

Consequences

Benefits:
* Visitors compare speed, cost and depth across tiers on identical inputs.
* The public API's cost exposure is bounded by an explicit list instead of by convention.
* Adding or retiring a model is a one-file change, re-verified by the CI gate on every deploy.

Trade-offs:
* The lineup is limited to what the `eu` endpoint serves, which can trail the global endpoint. Gemini 3.1 Pro (preview) was evaluated for a deep-reasoning tier and excluded: on 2026-10-06 Vertex returned 404 for it on `eu`. It joins with a one-line change once it is served there.
* A preview model, if added later, must be badged in the picker and never be the default.

Alternatives considered

1. Upgrade only the single default (3.5 → 3.8 Flash): Rejected — keeps the picker decorative and leaves the open model parameter in place.
2. Add Gemini 3.1 Pro via the global endpoint: Rejected — the global endpoint offers no data-residency guarantee (ADR-013).
3. Multi-provider lineup (Claude, Llama via Model Garden): Rejected for now — separate APIs, quotas and EU-availability matrices per provider, against ADR-005's single-SDK integration.
4. Reject unknown model ids with HTTP 400: Rejected — every page cached before a lineup change would start failing; resolving to the default is equally safe and keeps clients working.

Architecture Decision Records