Curate `KnownModelName` and the provider model-name literals to the models a user would pick

Merged
DS
1mo ago
+1307-2263

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.

Closes #12093
Closes #6450

Why we make these changes

Model-name autocomplete should offer the models a user would pick. KnownModelName held about 780 ids, most of them copied from SDK unions (openai.types.AllModels, anthropic.types.ModelParam, xai_sdk's ChatModel): retired, dated, preview, audio, search and other non-chat ids. Each model-name Literal now lists, per provider and model line, the newest model of the newest generation and of the previous one, plus every id a docs model alias resolves to. The rule is in add-new-model. #6450 kept an id until its provider confirmed the shutdown; the literals now list only current models, so every id it tracks leaves them.

[!WARNING]
Compatibility impact: Code that assigns a dropped id to a variable annotated with KnownModelName, DeepSeekModelName, MetaModelName or MoonshotAIModelName (aliases without a str | arm) fails type checking.

Why this can ship in a minor release: the version policy lists adding or removing names in these model-name Literal aliases as permitted. Runtime behavior does not change: every id still resolves its profile.

Migration: annotate the variable as KnownModelName | str, or pass the id where Agent(model=...) takes it directly, which already accepts any str.

Model parameters that took Model | KnownModelName without str now take Model | KnownModelName | str, as Agent and FallbackModel already do, so a dropped id stays valid there: WrapperModel(wrapped), InstrumentedModel(wrapped), ConcurrencyLimitedModel(wrapped), limit_model_concurrency(model), and pydantic_evals' generate_dataset(model) and set_default_judge_model(model). Defaults are unchanged.

New public surface

None. OpenAIModelName, AnthropicModelName and XaiModelName become str | Literal[<curated>] instead of including the SDK's literal.

User-visible behavior

  • known_model_names(): about 780 → 256 ids (the gateway/ mirror included).
  • "Did you mean" suggestions on an unknown model id now draw only from the curated ids, by design: a typo of a dropped id gets no suggestion.
  • Added live ids: Groq qwen/qwen3.8-27b, Mistral -medium/magistral-*/ministral-*, Cohere Command A, Cerebras qwen-3.8-27b, Z.AI glm-5.3-flashx, the current Hugging Face lineup, Bedrock GPT-6/Kimi K3/GLM-5.3/gpt-oss, Bedrock Mantle GPT-6.
  • Crusoe: zai-org/GLM-5.3* now gets the GLM profile (Crusoe's live vendor id; zai/ was the old one).

Verification

  • tests/models/test_model_names.py:
    • test_known_model_names keeps KnownModelName equal to the curated aliases plus the gateway mirror.
    • test_sdk_model_literal snapshots each SDK model literal; test_curated_model_names_are_sdk_ids_or_bridges is the typo guard. Both run only when the installed SDK is the uv.lock version, so a lock bump that adds ids fails, while the lowest-versions job and the upgrade canary skip.
    • test_heroku_model_list and test_cerebras_model_list snapshot the live lists (re-recorded).
    • test_model_names_outside_the_literals_keep_their_profile pins that dropped ids still resolve their family profile.
  • tests/providers/test_crusoe.py pins the zai-org GLM-5.3 profile.
  • Each gateway/ id the curation newly lists was smoke-tested live through the Gateway; ids it refuses are in UNSUPPORTED_GATEWAY_MODEL_NAMES.
  • Live lists checked 2026-11-07 for OpenAI, Anthropic, Google, Vertex, Groq, Mistral, Cohere, DeepSeek, Moonshot, Z.AI, Cerebras, Heroku, Hugging Face, Bedrock and Bedrock Mantle.
Unverified lists and deliberate omissions
  • xAI: unverified; /v1/models returns HTTP 403 (no credits). Based on xai-sdk plus bridges.
  • Snowflake, Crusoe, Meta: verified against their docs pages only, no API key. Snowflake's GPT ids are now spelled openai-gpt-5.6-*, as its docs page writes them.
  • bedrock:global.openai.gpt-6.1-terra is left out: Converse support could not be verified (Gateway: no cost data; direct Converse in six regions: model not available for this account).
  • openai:gpt-image-2.6-flare/-sunburst are left out: they need GPT Image 2.6 geometry and quality support in the image adapter.
  • gateway/bedrock: Kimi K3, Kimi K3.1 and GLM-5.3 are left out of the Gateway mirror: the Gateway has no price data for them yet. Their direct bedrock: ids stay. gateway/bedrock:us.deepseek.r1-v1:0 is left out: the Gateway rejects the id, which native Bedrock serves.
  • Snowflake's Gemini, Grok, GLM and Qwen ids are left out: SnowflakeProvider.model_profile maps none of those families.
  • google:gemini-3.1-flash-lite and xai:grok-4.3 stay although the rule would drop them: docs model aliases (google:small, xai:small) resolve to them.
  • Realtime and transcription literals are unchanged.
  • docs/image-generation.md's geometry table still lists gpt-image-1 and Gemini 2.5 Flash Image: they still work, they just left autocomplete.

What changes for existing users

Autocomplete offers fewer, current models; any model id runs as before, except that Crusoe zai-org/GLM-5.3* ids now get the GLM profile.

PR decisions

2026-11-07 · Q1 generation counted per provider · iter -

  • Decision: The generation is counted per provider. gemini-4-argon makes gen 3 the previous generation, so every Google 2.5 id drops.
  • Why: Decided by David in session 8b8c46be-5e90-445c-af96-4d575a8bb9dd, 2026-11-07, approving local-notes/curated-model-names-proposal.md
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Q2 GPT 5.5/5.4 lines drop · iter -

  • Decision: GPT 5.5, 5.5-pro, 5.4-mini and 5.4-nano drop, because sol/terra/luna replaced them.
  • Why: Decided by David in session 8b8c46be-5e90-445c-af96-4d575a8bb9dd, 2026-11-07, approving local-notes/curated-model-names-proposal.md
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Q3 Bedrock one id per model · iter -

  • Decision: Bedrock gets one id per model, using the global. prefix when it exists, else us., else bare.
  • Why: Decided by David in session 8b8c46be-5e90-445c-af96-4d575a8bb9dd, 2026-11-07, approving local-notes/curated-model-names-proposal.md
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Q4 add live + ids in this PR · iter -

  • Decision: Live ids missing from the repo (marked +) are added in this PR, with any profile wiring they need, via the add-new-model checks.
  • Why: Decided by David in session 8b8c46be-5e90-445c-af96-4d575a8bb9dd, 2026-11-07, approving local-notes/curated-model-names-proposal.md
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Keep the ? items · iter -

  • Decision: Every id the spec marks ? is kept.
  • Why: Decided by David in session 8b8c46be-5e90-445c-af96-4d575a8bb9dd, 2026-11-07, approving local-notes/curated-model-names-proposal.md
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · D1 leave out bedrock global.openai.gpt-6.1-terra · iter -

  • Decision: Not added: Converse support unverifiable. Gateway returns 404 'No cost data available'; direct Converse in us-east-1/us-east-2/us-west-2/eu-west-1/eu-central-1/ap-south-1 returns AccessDenied 'not available for this account'. Add it to bedrock_openai_model_profile's allowed set only with a successful Converse call.
  • Why: Decided by David (manager dispatch 2026-11-07T18:24Z): do not add it unverified
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · D2 bedrock-mantle gen 6 · iter -

  • Decision: Add openai.gpt-6.1-sol, openai.gpt-6.1-terra, openai.gpt-6-luna, openai.gpt-6-astra (live Mantle /v1/models, us-east-1).
  • Why: Decided by David (manager dispatch 2026-11-07T18:24Z): rule applied to the live list; resolves via openai_model_profile
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · D3 crusoe from live docs list · iter -

  • Decision: Replace the list with the live chat ids; keep zai-org/GLM-5.3*, wired by mapping the zai-org vendor to the GLM profile in Crusoe's model_profile only, with a targeted test.
  • Why: Decided by David (manager dispatch 2026-11-07T18:24Z)
  • Source: https://docs.crusoe.ai/serverless-inference/available-models
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · D4 snowflake from docs HTML · iter -

  • Decision: Settle spellings from raw page HTML; drop ids the page no longer lists, add newest per line that resolve through existing profiles, fix spellings the HTML proves wrong; leave out ids needing new profile logic. PR body marks Snowflake verified against docs only.
  • Why: Decided by David (manager dispatch 2026-11-07T18:24Z)
  • Source: https://docs.snowflake.com/en/user-guide/snowflake-cortex/aisql-regional-availability
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Leave out gpt-image-2.6-flare/sunburst · iter -

  • Decision: Not added to the image literals: OpenAI's image guide gives GPT Image 2.6 new quality values (xhigh, max) and a markup edit input, and _openai_geometry only maps gpt-image-1.x and gpt-image-2 ids, so aspect_ratio raises for 2.6. Wiring needs geometry and quality support, which is image-model feature work.
  • Why: Same rule the manager set for D1: a + id that needs new adapter logic is left out and reported, not added unverified
  • Source: https://developers.openai.com/api/docs/guides/image-generation
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Snowflake ids left out for missing profile logic · iter -

  • Decision: gemini-4-argon, gemini-3.1-pro, gemini-3.8-flash, gemini-3.1-flash-lite, grok-4.7, glm-5.3, qwen3-next-80b-a3b, qwen3-vl-235b-a22b are on the Snowflake docs page but left out: SnowflakeProvider.model_profile maps no gemini, grok, glm or qwen family.
  • Why: D4: an id that needs new profile logic is left out and listed
  • Source: https://docs.snowflake.com/en/user-guide/snowflake-cortex/aisql-regional-availability
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · SDK snapshot gated on the uv.lock version · iter -

  • Decision: test_sdk_model_literal and the bridge/typo guard run only when the installed SDK version equals its version in uv.lock, and skip otherwise. A uv.lock bump that changes the SDK model literal fails; the lowest-versions job and the latest-versions canary install other versions and skip.
  • Why: Fail on a reviewed lock upgrade without turning unrelated CI legs red (manager lens)
  • Source: https://github.com/pydantic/pydantic-ai/blob/main/.github/workflows/latest-versions-canary.yml
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Gateway checks of newly advertised gateway ids · iter -

  • Decision: 12 new gateway/ ids smoke-tested live: 8 pass; global.moonshotai.kimi-k3, kimi-k3.1 and global.zai.glm-5.3 stay (Gateway 404 'No cost data available' is a pricing gap, not a rejection); gateway/bedrock:us.deepseek.r1-v1:0 is excluded (Gateway 400 'provided model identifier is invalid', while native Bedrock us-east-1/us-west-2 serves it).
  • Why: add-new-model skill: exclude only ids the Gateway rejects; a no-cost-data 404 keeps the literal
  • Source: https://github.com/pydantic/pydantic-ai/issues/6450
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · D5 keep alias targets in the curated literals · iter -

  • Decision: Option B: keep google:gemini-3.1-flash-lite and xai:grok-4.3; docs aliases unchanged. Rule: 'an id that a model alias resolves to always stays in the curated literal', written into the add-new-model curation rule.
  • Why: Decided by David (manager dispatch 2026-11-07T19:25Z): A and C would change what xai:small and google:small resolve to at runtime
  • Source: https://github.com/pydantic/pydantic-ai/issues/12093
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · Exclude Gateway ids without price data · iter -

  • Decision: gateway/bedrock:global.moonshotai.kimi-k3, kimi-k3.1 and global.zai.glm-5.3 go into UNSUPPORTED_GATEWAY_MODEL_NAMES while the Gateway has no price data; the direct bedrock: ids stay. The add-new-model 'No cost data' bullet now says the same.
  • Why: Decided by David (manager dispatch 2026-11-07T19:25Z): picking them from autocomplete errors today
  • Source: https://github.com/pydantic/pydantic-ai/issues/6450
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df
  • Supersedes: Gateway checks of newly advertised gateway ids

2026-11-07 · pre-push review 1 of 3 at 39f40f129519b97c67b22d7da93887661f9225fa · iter -

2026-11-07 · pre-push review 1 of 3 launch failed · iter -

2026-11-07 · pre-push review 1 of 3 at 39f40f129519b97c67b22d7da93887661f9225fa · iter -

2026-11-07 · pre-push review 2 of 3 at 666d66ac23a2fe4333ccee7b2421d50d7262f76b · iter -

2026-11-07 · pre-push review 2 of 3 at 666d66ac23a2fe4333ccee7b2421d50d7262f76b · iter -

2026-11-07 · Waiver commit 9853ee9952 skips pre-push review · iter -

  • Decision: Exempt: the delta since reviewed 666d66ac23 adds only four .github/api-compatibility-waivers JSON files.
  • Why: Rubric rungs: public API, behavior, docs, tests and code quality are untouched; the files only record the reviewed alias shape changes for the CI check, whose fingerprints a local run produced
  • Source: https://github.com/pydantic/pydantic-ai/pull/12817
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · CI repair f12c02fe6f skips pre-push review · iter -

  • Decision: Exempt test-only delta since reviewed 666d66ac23: suggestion tests repointed to curated ids (behavior unchanged: a close known id is still suggested) and the SDK snapshot gate reads the committed uv.lock via git show, because lowest-versions and the canary rewrite the working-tree uv.lock.
  • Why: Exempt-delta table: test-harness repair / fixture correction to established intended behavior; test code only
  • Source: https://github.com/pydantic/pydantic-ai/actions/runs/42408900284
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · D6 widen KnownModelName-only model parameters · iter -

  • Decision: Option A: WrapperModel, InstrumentedModel, ConcurrencyLimitedModel, limit_model_concurrency, pydantic_evals generate_dataset and set_default_judge_model (and evals _default_model) take Model | KnownModelName | str; defaults unchanged; the stream_markdown and generate_dataset examples use curated ids; built-in evaluator docs list the str arm. A repo-wide annotation sweep found no other curated-literal annotation without str.
  • Why: Decided by David (manager dispatch 2026-11-07T20:20Z): keeps the curation autocomplete-only on every entry point
  • Source: https://github.com/pydantic/pydantic-ai/pull/12817
  • Session: 2fcbc0c4-fe59-4b55-bbff-d8bbdb8d94df

2026-11-07 · pre-push review 3 of 3 at d0c81dbb54acf7e2c665057fa7ec78a1773d2a1f · iter -

2026-11-07 · pre-push review 3 of 3 at d0c81dbb54acf7e2c665057fa7ec78a1773d2a1f · iter -

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.