Model Provider Updater
Use this repo-level skill to update the FastGPT plugin static model registry in packages/infrastructure/src/static-data/models/provider/*/index.ts.
Only work on providers already registered by packages/infrastructure/src/static-data/models/index.ts; never add a new provider directory or registry import as part of this workflow unless the user explicitly asks to add a new provider.
This skill was restored from the old .codex/skills/model-provider-updater layout. The plugin code has since moved from the legacy modules/model/* tree into the v1 packages/infrastructure/src/static-data/models/* tree, so use the paths and commands below rather than the old modules/model or .agents/skills paths.
Add-Only Policy
This workflow is strictly additive. Never remove an existing provider preset, even when an official source marks it deprecated, retired, unavailable, superseded, or absent from the current catalog. Record such findings in the run summary when useful, but leave the registry entry unchanged.
Every executable update plan must keep each provider's remove array empty. The helper script retains removal support for legacy or explicitly separate workflows, but this skill must not populate or apply removal operations.
Complete-Audit Invariant
A repository-wide refresh is complete only when every provider currently registered by packages/infrastructure/src/static-data/models/index.ts appears exactly once in the plan and has a non-pending audit result. Never infer coverage from the number of changed files: providers with no additions must still be recorded as checked.
apply-plan enforces this invariant by default and rejects missing providers, duplicate aliases, or auditStatus: "pending". Use --allow-partial only when the user explicitly scopes the request to named providers; never use it to make an incomplete full refresh pass.
Coverage alone is not sufficient. Each provider audit must also preserve a verifiable catalog diff:
- Check every URL prefilled from
references/provider_sources.json; add newly discovered official catalog, release-note, deprecation, or pricing URLs when they are needed to establish the current state. - Record every exact, in-scope primary model ID found in official sources in
candidateModelIds, including candidates that will be deliberately skipped. - Compare
candidateModelIdswith the local inventory. Every candidate missing locally must appear in exactly one ofaddorskip; everyskipentry requires a concrete reason. - Record
checkedAtas the current run date. Stale plans are rejected and must be re-audited rather than replayed. - Set
catalogStatustoreviewedwhen an official in-scope catalog was enumerated. Useno-in-scope-models,dynamic-catalog, orno-authoritative-catalogonly when that is the actual result, and explain it inauditNote.
This candidate ledger is the completion proof. A reachable page, a search snippet, or an auditStatus marker by itself is never proof that the catalog was scanned.
Workflow
-
Inventory the current registry.
node .codex/skills/model-provider-updater/scripts/model_provider_presets.mjs inventoryUse
--jsonwhen another script or a temporary comparison file needs structured output. -
Check every registered provider one by one against official sources.
Start from every URL listed for that provider in
references/provider_sources.json, but verify the current official page/API during the run because model catalogs change often. When a provider publishes both a catalog and release notes/changelog, inspect both: catalog pages can lag a just-released model. Use official provider docs, official pricing/model pages, release notes, deprecation pages, or official model-list APIs. Do not use third-party blogs, search snippets, or aggregator pages as evidence unless the provider is that aggregator, such as OpenRouter.check-sourcesonly checks whether source-hint URLs are reachable enough to use as starting points. A 403 access-limited result can still be acceptable for docs that block automated requests, and a passing source check is not evidence that the provider catalog was audited. -
Build the candidate ledger and classify every difference conservatively.
For a general model refresh, add only primary LLM/chat/reasoning models. Do not add derived or specialized non-LLM variants just because the provider docs list them, such as TTS, STT, transcription, audio, image, video, realtime, moderation, or batch-only model IDs (
gpt-4o-transcribe,gpt-4o-mini-tts, and similar). Also skip open-weight/checkpoint style IDs that encode parameter scale or architecture details when the provider has productized main model IDs, such as Qwenqwen3.6-27b,qwen3.5-397b-a17b,qwen3.5-122b-a10b, orqwen3.5-35b-a3b; prefermax,plus,flash, or other documented main product model IDs instead. Handle those only when the user explicitly asks for that modality/model class or when the provider itself is a modality-specific or open-model provider already maintained for that type.Exclude experimental, preview, beta, alpha, test, and similarly unstable model IDs from additions. Exclude models whose official release date is more than one year before the current run date; record each excluded candidate in
skipwith a reason such asexperimental/previeworreleased more than one year ago. This applies even when the provider still lists the model as available (for example, skipdeepseek-v4-flash-vision-exp,hy3-preview, andgemini-embedding-001during a current refresh). Do not remove such models if they already exist locally because this workflow is add-only.Transcribe exact official model IDs into
candidateModelIds; do not rely on prose such as "latest models checked." Compare that list mechanically with the local inventory. Add a preset when an official source lists an in-scope model that is absent locally and it belongs to an existing provider. Clone the closest existing preset in the same provider and family, then adjust context, output limit, vision, reasoning, tool calling, response-format, and field-map fields from official docs or the closest local pattern. When the new model is newer or more capable than its clone source, setinsertBeforeto the existing model that it must precede; cloning and display placement are separate decisions.If a missing candidate is intentionally excluded by the scope rules, put it in
skipwith its exact model ID and a specific reason. The plan is incomplete while any missing candidate is neither added nor skipped.Keep every existing preset. Deprecated, retired, unavailable, superseded, preview, experimental, and dated candidate IDs may be noted in the audit summary, but must not be removed by this workflow.
-
Create and apply an update plan.
For a full refresh, generate the all-provider template without
--provider, then fill the audit evidence and confirmed additions. Keep everyremovearray empty:node .codex/skills/model-provider-updater/scripts/model_provider_presets.mjs plan-template > /tmp/model-provider-plan.jsonFor an explicitly scoped request,
plan-template --provider OpenAIandapply-plan --allow-partialare allowed. The template pre-populates the configured officialsources; do not delete an unvisited source to bypass checking it.Dry-run before writing:
node .codex/skills/model-provider-updater/scripts/model_provider_presets.mjs apply-plan --plan /tmp/model-provider-plan.json --dry-run node .codex/skills/model-provider-updater/scripts/model_provider_presets.mjs apply-plan --plan /tmp/model-provider-plan.json --writeThe plan format is documented in
references/plan.example.json. That file includes an intentionally unregisteredExampleProvidershape example, so useplan-templatefor executable plans instead of applying the example file directly. Keep every audited provider in the plan:- Use
auditStatus: "checked"with emptyaddandremovewhen the provider was checked and no registry change is needed. - Use
auditStatus: "changed"when adding presets. auditStatus: "pending"is template state only and cannot be applied.- Fill
catalogStatus,auditNote,candidateModelIds, andskipfor every provider, even when nothing changes.
replacesupports top-level provider-model fields only, such asmaxContext,maxTokens,vision,reasoning,responseFormatList, orfieldMap. Do not use dotted paths such asfieldMap.max_tokens; replace the full top-level object instead.insertBeforeaccepts an exact existing model ID and places the cloned addition before it. Use it to preserve newest-or-most-capable-first ordering; otherwise additions are inserted aftercloneFromfor backward compatibility.The script only edits providers registered by
packages/infrastructure/src/static-data/models/index.ts, validates the whole plan before writing any file, and errors on incomplete provider coverage, unchecked configured sources, pending states, missing audit notes, duplicate IDs, unaccounted catalog candidates, or missing addition evidence. Although the script can mechanically process removals for legacy workflows, this skill must always submit emptyremovearrays. - Use
-
Validate.
bun run test bun tsc --noEmitIf the full suite is too broad for the change, run the model inventory plus targeted TypeScript validation and state the skipped coverage clearly.
Evidence Rules
- Record every official source URL checked, the check date, catalog status, exact candidate model IDs, and an audit note for every provider, including providers with no changes.
- Do not mark a provider checked until all configured source URLs have been inspected and every missing candidate has an
addor reasonedskipdisposition. - Treat model catalogs and release notes as complementary evidence. If they conflict because a release is newer than the catalog page, use the newer official release/model page and record the discrepancy in
auditNote. - Do not add removal entries to the plan. Record retirement or deprecation findings only in the run summary when they materially affect users.
- Prefer primary API references over marketing pages when fields disagree.
- When official docs group many modality-specific variants under one family, treat the main public chat/LLM model as the preset target and skip derivative IDs unless the request names that capability.
- When official docs list both provider-hosted main model IDs and open-weight/checkpoint IDs in one table, target the main hosted IDs and skip parameter-scale checkpoint IDs unless the user explicitly asks to support open-source model names.
- Treat aliases such as
*-latestas stable presets only if the provider documents them as public model IDs. - Keep existing ordering style inside each provider file: newest or most capable models first when that is already the local pattern.
- Preserve local compatibility fields unless official docs prove they are wrong.
Helper Script
scripts/model_provider_presets.mjs supports:
inventory: list registered providers, provider files, model counts, and type counts.plan-template: create a JSON update plan skeleton for all or selected providers.apply-plan: validate complete provider/source/candidate coverage and mechanically apply cloned additions. Its legacy removal capability is out of scope for this skill.check-sources: sanity-check source hint URLs fromreferences/provider_sources.json.
Use the script for repeatable mechanics, then review the diff manually before final validation.