Skip to content

ci(ai-gateway): keep /models.json in sync with models.dev#5204

Merged
andrelandgraf merged 4 commits into
mainfrom
feat/models-json-sync-check
Jul 4, 2026
Merged

ci(ai-gateway): keep /models.json in sync with models.dev#5204
andrelandgraf merged 4 commits into
mainfrom
feat/models-json-sync-check

Conversation

@andrelandgraf

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5203. Adds a drift check that keeps the Neon AI Gateway catalog served at /models.json in sync with its upstream source of truth — the neon provider in the models.dev API, which Neon maintains.

  • .github/workflows/models-sync-check.yml — scheduled (daily) + workflow_dispatch job that runs the check and fails on any drift.
  • src/scripts/check-models-sync.js — fetches https://models.dev/api.json, extracts the neon provider, and compares it to the committed src/app/models.json/data.json (what backs /models.json). It fails on:
    • models present in one catalog but not the other, and
    • per-model capability drift (name, family, attachment, reasoning, reasoning_options, tool_call, temperature, structured_output, open_weights, knowledge, dates, modalities, limit, cost, status).
    • Endpoint-specific fields are ignored on both sides so they don't cause false positives: the provider convenience field we add, and description/benchmarks/weights/links.
  • package.jsonnpm run check:models-sync for local runs (--ci terse, --json machine-readable; NEON_MODELS_URL=https://neon.com/models.json compares the live endpoint instead of the repo file).
  • Also regenerates data.json to pick up the latest models.dev Neon changes (adds qwen35-122b-a10b's reasoning_options).

Heads up — currently reports drift (expected)

The companion models.dev PR (anomalyco/models.dev#3019) that adds these 12 models and removes gpt-5-5 is merged but not yet deployed to models.dev/api.json. Until it redeploys, the check reports the expected delta:

In models.dev but missing from /models.json (1):  gpt-5-5
In /models.json but not in models.dev (12):        + gpt-5-3-codex, claude-opus-4-8, gemma-3-12b, ... 
Field drift (4 models): gemini-2-5-pro, gemini-3-1-pro, gemini-3-pro, gpt-5-4 (cost)

Once models.dev redeploys the merged neon provider, the daily job goes green (both catalogs derive from the same TOMLs). The workflow is schedule + manual only (not a PR gate), so it won't block merges.

Test plan

  • node src/scripts/check-models-sync.js exits 1 on drift, 0 when in sync; --json and --ci modes verified.
  • eslint clean on the new script.

Adds a scheduled GitHub Action + script that verifies the /models.json catalog
stays in sync with the upstream models.dev `neon` provider, failing on any
model or capability drift. Also regenerates data.json to pick up qwen35's
reasoning_options.
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview, Comment Jul 4, 2026 3:55am

Request Review

…rovider

`npm run generate:models` fetches the models.dev neon provider (with all
base_model-inherited values resolved) and regenerates data.json, applying the
same transform /models.json uses (adds per-model provider, drops
description/benchmarks/weights/links, points doc at the AI Gateway page).
Pairs with the sync check, which now points users at this command.
…atalog

Regenerated src/app/models.json/data.json from the local models.dev neon
provider (neon-catalog-sync-2026-07). Adds the legacy context_over_200k cost
block and normalizes tier key order for gpt-5-4, gpt-5-4-mini, gemini-3-flash,
and gemini-3-1-flash-lite. Sync check passes (36 models match).

@philip philip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🛳️

@andrelandgraf andrelandgraf merged commit 06cf33d into main Jul 4, 2026
2 checks passed
@andrelandgraf andrelandgraf deleted the feat/models-json-sync-check branch July 4, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants