feat(model-sync): sync native models from modelschemas only, with no prices in model metadata #1308
- @@ -0,0 +86,21 @@86+ ? value.input_cache_read87+ : undefined,88+ }89+}90+91+export function parseCatalogModel(value: unknown): CatalogModel | null {92+ if (!isRecord(value)) return null93+ if (typeof value.rawId !== 'string' || value.rawId.length === 0) return null94+ const modalities = isRecord(value.modalities) ? value.modalities : null95+ return {96+ provider: typeof value.provider === 'string' ? value.provider : '',97+ rawId: value.rawId,98+ activity: typeof value.activity === 'string' ? value.activity : null,99+ firstSeenAt: asFiniteNumber(value.firstSeenAt),100+ deprecatedAt: asFiniteNumber(value.deprecatedAt),101+ contextWindow: asFiniteNumber(value.contextWindow),102+ maxOutput: asFiniteNumber(value.maxOutput),103+ inputModalities: asStringArray(modalities?.input),104+ outputModalities: asStringArray(modalities?.output),105+ pricing: asPricing(value.pricing),106+ capabilities: asStringArray(value.capabilities),@@ -0,0 +153,21 @@153+154+function pickNumber(155+ preferred: number | null,156+ fallback: number | null,157+): number | null {158+ return preferred ?? fallback159+}160+161+function pickList(162+ preferred: Array<string>,163+ fallback: Array<string>,164+): Array<string> {165+ return preferred.length > 0 ? preferred : fallback166+}167+168+export function toSyncModel(169+ native: CatalogModel,170+ enrich: CatalogModel | undefined,171+ provider: SyncedProvider,172+): SyncModel {173+ const src = enrich ?? native
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer
- @@ -52,6 +52,6 @@52525353 `pnpm generate:models` is the maintainer command behind the daily **Sync Model Metadata** workflow (branch `automated/sync-models`). It:545455-Fetches OpenRouter, Vercel AI Gateway, and Lovable AI Gateway catalogs.55+Fetches OpenRouter, Vercel AI Gateway, and Lovable AI Gateway catalogs (OpenRouter adapter + gateway packages).5656 Regenerates `packages/ai-openrouter/src/model-meta.ts` and the Vercel Gateway model list.57-Inserts **new** native-provider models into `packages/ai-openai`, `ai-anthropic`, `ai-gemini`, and `ai-grok`.57+Inserts **new** native-provider models from [modelschemas](https://modelschemas.com) (`@modelschemas/client`) into `ai-openai`, `ai-anthropic`, `ai-gemini`, `ai-grok`, `ai-groq`, `ai-mistral`, `ai-byteplus`, and `ai-elevenlabs`. Native ids and activities come from each provider catalog. For OpenAI, Anthropic, Gemini, and Grok, pricing and `supported_parameters` come from the modelschemas OpenRouter catalog when that row exists. BytePlus and ElevenLabs use the native catalog as-is.@@ -28,3 +28,14 @@2828 * advertises an empty tool set. Typing it as `never` makes passing another2929 * provider's `ProviderTool` to a BytePlus adapter a compile-time error.3030 */31+const DEEPSEEK_V4_FLASH_GA_260731 = {32+ name: 'deepseek-v4-flash-ga-260731',33+ context_window: 1_048_576,34+ max_output_tokens: 393_216,35+ supports: {36+ input: ['text'],37+ output: ['text'],38+ capabilities: ['reasoning', 'tool_calling'],39+ tools: [] as const,40+ },41+} as const satisfies ModelMeta@@ -320,3 +320,21 @@320320 /**321321 * All supported Groq chat model identifiers.322322 */323+const QWEN_QWEN3_8_27B = {324+ name: 'qwen/qwen3.8-27b',325+ supports: {326+ input: ['text'],327+ output: ['text'],328+ endpoints: ['chat'],329+ features: ['streaming'],330+ tools: [] as const,331+ },332+ pricing: {333+ input: {334+ normal: 0,335+ },336+ output: {337+ normal: 0,338+ },339+ },340+} as const satisfies ModelMeta<GroqTextProviderOptions>@@ -5,3 +5,7 @@55 } from './embedding/embedding-provider-options'6677 /** Provider options for vision-capable Mistral models (pixtral-*). */8+const CODESTRAL_2508 = {9+ name: 'codestral-2508',10+ context_window: 256_000,11+ max_completion_tokens: 204_800,@@ -24,3 +24,14 @@2424 * carries its own trailing comma so the existing body does not need a2525 * comma-guess. See the grok-4.5 single-line array breakage.2626 */27+export function addToStringLiteralArray(28+ content: string,29+ arrayName: string,30+ values: Array<string>,31+): string {32+ if (values.length === 0) return content33+ const open = `export const ${arrayName} = [`34+ const openIndex = content.indexOf(open)35+ if (openIndex === -1) {36+ console.warn(` Warning: Could not find array '${arrayName}' in file`)37+ return content@@ -24,3 +24,18 @@2424 * carries its own trailing comma so the existing body does not need a2525 * comma-guess. See the grok-4.5 single-line array breakage.2626 */27+export function addToStringLiteralArray(28+ content: string,29+ arrayName: string,30+ values: Array<string>,31+): string {32+ if (values.length === 0) return content33+ const open = `export const ${arrayName} = [`34+ const openIndex = content.indexOf(open)35+ if (openIndex === -1) {36+ console.warn(` Warning: Could not find array '${arrayName}' in file`)37+ return content38+ }39+ const newEntries = values.map((value) => ` '${value}',`).join('\n')40+ const insertAt = openIndex + open.length41+ return `${content.slice(0, insertAt)}\n${newEntries}${content.slice(insertAt)}`@@ -144,0 +176,21 @@176+ if (hasTools) features.push('tools')177+ if (hasStructured) {178+ features.push('json_object', 'json_schema')179+ }180+ if (hasReasoning) features.push('reasoning')181+ if (input.inputModalities.includes('image')) features.push('vision')182+ return [183+ ` input: ${inputList},`,184+ ` output: ['text'],`,185+ ` endpoints: ['chat'],`,186+ ` features: ${quoteList(features)},`,187+ ].join('\n')188+ }189+ case 'byteplus': {190+ const capabilities: Array<string> = []191+ if (hasReasoning) capabilities.push('reasoning')192+ if (hasTools) capabilities.push('tool_calling')193+ if (hasStructured) capabilities.push('structured_outputs')194+ const output = quoteList(195+ (input.outputModalities ?? ['text']).length > 0196+ ? (input.outputModalities ?? ['text'])@@ -193,0 +254,21 @@254+ referenceSatisfies: 'ModelMeta<MistralTextProviderOptions>',255+ referenceProviderOptionsEntry: 'MistralTextProviderOptions',256+ hasBothNameAndId: false,257+ providerOptionsIsMappedType: false,258+ skipPatterns: [259+ 'mistral-embed',260+ 'codestral-embed',261+ 'mistral-ocr',262+ 'mistral-moderation',263+ 'voxtral-',264+ 'mistral-vibe',265+ 'mistral-code-fim',266+ 'mistral-code-',267+ 'glm-',268+ 'zai-',269+ ],270+ acceptedActivities: [null, 'chat'],271+ requireOpenRouterEnrich: false,272+ includePricing: true,273+ outputTokenField: 'max_completion_tokens',274+ insertKind: 'model-meta',@@ -193,0 +273,21 @@273+ outputTokenField: 'max_completion_tokens',274+ insertKind: 'model-meta',275+ },276+ byteplus: {277+ packageName: '@tanstack/ai-byteplus',278+ metaFile: resolve(ROOT, 'packages/ai-byteplus/src/model-meta.ts'),279+ arrayRef: '.name',280+ contextField: 'context_window',281+ chatArrayName: 'BYTEPLUS_CHAT_MODELS',282+ providerOptionsTypeName: 'BytePlusChatModelProviderOptionsByName',283+ inputModalitiesTypeName: 'BytePlusModelInputModalitiesByName',284+ validInputModalities: ['text', 'image', 'audio', 'video', 'document'],285+ kind: 'byteplus',286+ referenceSatisfies: 'ModelMeta',287+ referenceProviderOptionsEntry: 'BytePlusTextProviderOptions',288+ hasBothNameAndId: false,289+ providerOptionsIsMappedType: true,290+ skipPatterns: [],291+ acceptedActivities: ['chat'],292+ requireOpenRouterEnrich: false,293+ includePricing: false,
tombeckenham changed the title
tombeckenham changed the title
github-actions[bot](GitHub profile, opens in a new tab) assignedAlemTuzlak
github-actions[bot](GitHub profile, opens in a new tab) added labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: maintainer
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: maintainer
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: maintainer
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: author
github-actions[bot](GitHub profile, opens in a new tab) removed labelswaiting-on: maintainer
AlemTuzlak approved these changes
github-actions[bot](GitHub profile, opens in a new tab) removed labelsmerge-conflicts
github-actions[bot](GitHub profile, opens in a new tab) added labelsmerge-conflicts
tombeckenham changed the title
- @@ -445,15 +406,13 @@445-446- // max_output_tokens447- if (model.top_provider.max_completion_tokens) {406+ if (isPositive(model.maxOutput)) {448407 lines.push(449- ` max_output_tokens: ${formatNumber(model.top_provider.max_completion_tokens)},`,408+ ` ${config.outputTokenField}: ${formatNumber(model.maxOutput)},`,450409 )451410 }452-453411 lines.push(` supports: {`)454412 lines.push(455413 buildProviderSupportsBody({456- provider: config.kind,414+ provider,457415 inputModalities,458- supportedParameters: model.supported_parameters,459- reasoningMandatory: model.reasoning?.mandatory === true,416+ outputModalities: model.outputModalities,417+ supportedParameters: model.supportedParameters,418+ reasoningMandatory: model.reasoningMandatory,
tombeckenham changed the title
Sign in to join this conversation.
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
Walkthrough
The model sync now fetches native-provider catalogs from modelschemas and uses OpenRouter data for configured enrichment. It applies provider-specific selection and insertion rules, updates provider model metadata and ID arrays, and reports held-back models. The changes also add catalog validation, insertion tests, workflow credentials, and sync documentation.
Changes: Native-provider model synchronization
scripts/model-sync/modelschemas.ts,scripts/model-sync/modelschemas.test.ts,package.json@modelschemas/client.scripts/model-sync/catalog.ts,scripts/model-sync/catalog.test.tsscripts/sync-provider-models.ts,scripts/model-sync/provider-supports.ts,scripts/model-sync/native-insert.ts,scripts/model-sync/ids.ts,scripts/model-sync/*test.ts,.github/workflows/sync-models.yml,CONTRIBUTING.md,.changeset/sync-models.mdpackages/ai-byteplus/src/model-meta.ts,packages/ai-groq/src/model-meta.ts,packages/ai-mistral/src/model-meta.tsEstimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Possibly related issues
Sequence Diagram(s)#
Suggested reviewers:
alemtuzlakMerge Risk:
Moderate · up to
0e6b8Some new models may expose incomplete or incorrect capabilities, pricing, or limits, and requested reasoning settings can be omitted. Resolve these metadata and synchronization risks before merging.
Security architecture risk:
Moderate · up to
7cc2cAn additional external source can influence shipped code because some imported strings are not safely quoted. Review and release checks limit exposure, but do not establish that injected code would be rejected.
Retained concerns
Security review details
Security Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Pre-merge checks:
4 · 
1
Full details: Title check
Explanation
The title names the feature (syncing native models from modelschemas) and the no-prices behavior, and both appear in the changeset. The objectives say unknown prices are omitted for Groq, Mistral, BytePlus, and ElevenLabs, and the sync script emits pricing only when configured. The title is accurate but long at 93 characters, and it omits the other main parts (eight providers, the OpenRouter hold-back rule, and the fail-on-missing-anchor behavior).
Full details: Description check
Explanation
The pull request description follows the repository template. It includes the Changes, Checklist, Release Impact, testing details, linked issues, public API change, and risk or rollback sections. It clearly records that the full test suite and live native sync were not run.
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.42% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 59 functions across 14 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share