Support Gemini 4 Neon (`gemini-4-neon`) on `GoogleModel`

Merged
DS
18d ago
+185-19

Why we make these changes

Google released Gemini 4 Neon (gemini-4-neon) on 2026-11-18 (announcement, what's new).

Like gemini-4-hydrogen, Neon supports the low, medium, high and xhigh thinking levels and rejects minimal. Without a profile entry, thinking=False and 'minimal' send MINIMAL, which the Gemini API answers with a 400, and 'xhigh' and 'max' send HIGH. Vertex's thinking table doesn't list Neon yet, so the levels apply on the Gemini API only, the way the gemini-3.1-flash-image levels do.

There is no issue for this. Mirrors #13299 (Gemini 4 Hydrogen) and #13057 (Gemini 4 Carbon).

New public surface

  • 'gemini-4-neon' in LatestGoogleModelNames and KnownModelName (google:, google-cloud:, gateway/google:, gateway/google-cloud:).

User-visible behavior

Agent('google:gemini-4-neon', model_settings={'thinking': 'xhigh'})
# before: sends thinkingLevel HIGH
# after:  sends thinkingLevel XHIGH on the Gemini API; thinking='max' does the same

Agent('google:gemini-4-neon', model_settings={'thinking': False})
# before: sends thinkingLevel MINIMAL: 400 "Thinking level MINIMAL is not supported for this model"
# after:  sends thinkingLevel LOW on the Gemini API, as on the other Gemini 4 models

On google-cloud:gemini-4-neon, and on both gateway/ ids, which reach Google Cloud, nothing changes: the model keeps the default levels.

  • Docs: docs/models/google.md names Neon in the thinking and long decode sections, and the Google row of docs/capabilities/thinking.md gives its xhigh mapping.
  • add-new-model skill: neon joins the Gemini 4 element lines, a new element name starts a new line, and the "remove the older id" clause applies within a line, so Hydrogen stays listed.

Verification

  • tests/test_thinking_wire_contract.py: recorded Gemini API case google-gemini-4-neon-xhigh (sends XHIGH through GoogleModel's default v1beta endpoint, accepted), matched on the request body.
  • tests/models/google/test_transport.py: test_neon_thinking_levels_follow_the_client_transport (Gemini API gets LOW to XHIGH; GoogleCloudProvider and a Vertex client in GoogleProvider keep the defaults; a user-set google_thinking_levels wins).
  • tests/test_capability_spec.py: gemini-4-neon in the model-name schema on all four Google prefixes. tests/models/test_model_names.py, tests/profiles/test_google.py, tests/test_thinking.py and the docs alias and parity tests pass locally.
  • Live on the Gemini API (2026-11-18): gemini-4-neon answers 400 Thinking level MINIMAL is not supported for this model and accepts LOW, MEDIUM, HIGH and XHIGH, as Google's thinking table lists. GoogleModel end to end: thinking=False and 'minimal' send LOW, and max_tokens=80_000 continues past the 65,536-token cap in a second request and returns 80,000 output tokens.
  • Google Cloud (Vertex) and Pydantic AI Gateway: not attempted. #13927 tracks checking both live.

What changes for existing users

Nothing.

Deliberately out of scope

  • GoogleInteractionsModel (#12636): Neon support follows once it merges.
  • gemini-4-hydrogen stays listed: Neon is a new line under the curation rule, and Hydrogen remains the cheaper model.
  • Explicit caching: Neon answers 400 Explicit caching is not supported; Google's model page documents it, and the docs don't track caching support per model.
  • Docs aliases: at $15 per 1M output tokens, Neon fits google:medium under docs/model_aliases/AGENTS.md, but genai-prices doesn't price it yet, so google:medium stays on gemini-3.8-flash. #13927 repoints it.
  • OpenRouter lists google/gemini-4-neon with reasoning.mandatory: true, but _MANDATORY_REASONING_MODEL_PREFIXES is unchanged here; #13927 adds it after a live check, as #13301 does for Hydrogen.
PR decisions

2026-11-18 · Neon is a new line next to Hydrogen

  • Decision: Add gemini-4-neon as a new Gemini 4 element line; keep gemini-4-hydrogen in the literals
  • Why: A new element name starts a new line; Hydrogen stays the cheaper model ($7.50 vs $15 per 1M output)
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · Interactions, Vertex and Gateway out of scope

  • Decision: Add the id on GoogleModel only; Vertex and Gateway checks go to #13927
  • Why: David's scope: GoogleInteractionsModel is not on main and no Vertex project was available; same split as Hydrogen
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · Neon thinking levels on the Gemini API only

  • Decision: GoogleModel.profile gives gemini-4-neon LOW to XHIGH behind not self._is_google_cloud; Vertex keeps the default levels
  • Why: A branch review found the levels would also apply on Google Cloud, where only the Gemini API was probed. Rule applied: keep one entry for both transports only if Vertex's thinking table lists the model with the same levels; otherwise gate the levels to the Gemini API, test Google Cloud and say "Gemini API" in the docs. The table has no Neon row
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · google:medium held until genai-prices prices Neon

  • Decision: Leave docs/model_aliases/aliases.json unchanged
  • Why: Placement reads prices from genai-prices, which has no gemini-4-neon entry
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · OpenRouter mandatory reasoning deferred

  • Decision: Leave _MANDATORY_REASONING_MODEL_PREFIXES unchanged; #13927 adds gemini-4-neon
  • Why: An OpenRouter-surface change with its own live probe, as #13301 does for Hydrogen
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · Curation-rule edit narrowed

  • Decision: neon joins the Gemini 4 element lines; "A new element name starts a new line"; the "remove the older id" clause applies within a line
  • Why: The public id carries generation 4, so only the element list needs neon; an unscoped removal clause would drop Hydrogen
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · Pre-push review 1 of 3

  • Decision: remediated: curation-rule removal scoped to within a line; Neon rows added to the thinking tests, later removed when the levels moved behind the Gemini API gate. Dismissed: the levels comment's verified-live date, which the public-id re-probe set
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · Pre-push review 2 of 3

  • Decision: remediated: the gemini-4-neon branch also sets google_supports_minimal_thinking_level to False, which the flag's docstring derives from the level set; the transport test asserts it
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · Pre-push review 3 of 3

  • Decision: no findings
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · douwebot: Neon is a second transport-gated model · iter 1

2026-11-18 · pydanty review-lite: no code change

  • Decision: Neon rows in the google_model_profile test tables and the OpenRouter prefix are not added; both gateway/ ids keep the default levels
  • Why: Those tables have no transport, so a row would pin the Google Cloud defaults, and gemini-3.1-flash-image has none; #13927 tracks OpenRouter; both gateway/ ids use GoogleCloudProvider
  • Source: https://github.com/pydantic/pydantic-ai/pull/13928#issuecomment-6995066100
  • Session: b4caad06-6408-4291-8a8b-b0873c24d068

2026-11-18 · pydanty change request dismissed

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

https://claude.ai/code/session_01HhQjZ9tbHAesHz649PFGoi