Share model metadata across provider offerings
Merged
AD
3mo ago+724+724+012345678901234567890123456789-52-52-01234567890123456789
Summary
Adds an authoring-only canonical_model link from a provider offering to its underlying model record, and fills a missing context_window from it at build time. An explicit value on the offering always wins, and the link is not published.
pydantic-ai gets effective context windows through the existing lookup (pydantic/pydantic-ai#4611), with no second lookup or name translation:
provider, model = snapshot.find_provider_model(model_name, None, model_system, None)
context_window = model.context_window
Changes
canonical_modelmust resolve to an exactprovider/modelrecord. Unknown and chained references fail the build. Links resolve before removed models are filtered, so an inactive native record can still supply metadata to an active hosted offering.- 51 relationships: AWS→Anthropic (31), Google→Anthropic (11), Azure→OpenAI (8), Fireworks→DeepSeek (1). A link is only set where the value holds for every model the record matches; ambiguous rows are left out, e.g. OpenRouter's DeepSeek V4 Pro, whose selectable backends range from 512K to 1M.
- Splits stable
o1(200K) fromo1-preview(128K) and adds documented limits too1,o3,o3-mini, ando4-mini, which Azure inherits. - Explicit overrides where a host documents a different limit (e.g. Bedrock Sonnet 4.5 at 200K), each with a first-party link in the YAML.
- Only
context_windowis inherited for now. Other fields can be added deliberately later without changing the consumer lookup.
Refs #260 and pydantic/pydantic-ai#4611.