Repository navigation
Refresh NVIDIA free metadata and detect catalog drift #7378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
diegosouzapw
merged 3 commits into
cheaper-inference:release/v3.8.49
from
JxnLexn:dev/nvidia-free-metadata-drift
Jul 18, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [ | ||
| "deepseek-ai/deepseek-v4-pro", | ||
| "google/gemma-4-31b-it", | ||
| "minimaxai/minimax-m2.7", | ||
| "mistralai/devstral-2-123b-instruct-2512", | ||
| "mistralai/mistral-large-3-675b-instruct-2512", | ||
| "mistralai/mistral-small-4-119b-2603", | ||
| "nvidia/nemotron-3-super-120b-a12b", | ||
| "openai/gpt-oss-120b", | ||
| "openai/gpt-oss-20b", | ||
| "poolside/laguna-xs-2.1", | ||
| "qwen/qwen3.5-122b-a10b", | ||
| "qwen/qwen3.5-397b-a17b", | ||
| "stepfun-ai/step-3.5-flash", | ||
| "thinkingmachines/inkling", | ||
| "z-ai/glm-5.1", | ||
| "z-ai/glm-5.2" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| import { FREE_MODEL_BUDGETS } from "../../open-sse/config/freeModelCatalog.data.ts"; | ||
| import reviewedLiveIds from "../../open-sse/config/nvidiaHostedModels.snapshot.json" with { type: "json" }; | ||
|
|
||
| const NVIDIA_MODELS_URL = "https://integrate.api.nvidia.com/v1/models"; | ||
|
|
||
| export interface NvidiaCatalogDrift { | ||
| liveCount: number; | ||
| reviewedLiveCount: number; | ||
| documentedFreeCount: number; | ||
| newLiveIds: string[]; | ||
| removedLiveIds: string[]; | ||
| documentedMissingUpstreamIds: string[]; | ||
| } | ||
|
|
||
| function normalizeIds(ids: Iterable<string>): Set<string> { | ||
| return new Set( | ||
| [...ids].filter((id) => typeof id === "string" && id.trim().length > 0).map((id) => id.trim()) | ||
| ); | ||
| } | ||
|
|
||
| export function computeNvidiaCatalogDrift( | ||
| liveIdsInput: Iterable<string>, | ||
| reviewedLiveIdsInput: Iterable<string>, | ||
| documentedFreeIdsInput: Iterable<string> | ||
| ): NvidiaCatalogDrift { | ||
| const liveIds = normalizeIds(liveIdsInput); | ||
| const reviewedIds = normalizeIds(reviewedLiveIdsInput); | ||
| const documentedFreeIds = normalizeIds(documentedFreeIdsInput); | ||
| return { | ||
| liveCount: liveIds.size, | ||
| reviewedLiveCount: reviewedIds.size, | ||
| documentedFreeCount: documentedFreeIds.size, | ||
| newLiveIds: [...liveIds].filter((id) => !reviewedIds.has(id)).sort(), | ||
| removedLiveIds: [...reviewedIds].filter((id) => !liveIds.has(id)).sort(), | ||
| documentedMissingUpstreamIds: [...documentedFreeIds].filter((id) => !liveIds.has(id)).sort(), | ||
| }; | ||
| } | ||
|
|
||
| function printIds(label: string, ids: string[]): void { | ||
| console.log(`${label} (${ids.length})`); | ||
| for (const id of ids) console.log(` - ${id}`); | ||
| } | ||
|
|
||
| async function main(): Promise<void> { | ||
| const apiKey = process.env.NVIDIA_API_KEY?.trim(); | ||
| if (!apiKey) { | ||
| console.error("NVIDIA_API_KEY is required to query the live NVIDIA NIM model catalog."); | ||
| process.exitCode = 2; | ||
| return; | ||
| } | ||
|
|
||
| let liveIds: string[] = []; | ||
| try { | ||
| const response = await fetch(NVIDIA_MODELS_URL, { | ||
| headers: { Authorization: `Bearer ${apiKey}`, Accept: "application/json" }, | ||
| signal: AbortSignal.timeout(30_000), | ||
| }); | ||
| if (!response.ok) { | ||
| console.error(`NVIDIA model catalog returned HTTP ${response.status}.`); | ||
| process.exitCode = 2; | ||
| return; | ||
| } | ||
|
|
||
| const body = (await response.json()) as { data?: Array<{ id?: unknown }> } | null; | ||
| liveIds = (body && Array.isArray(body.data) ? body.data : []) | ||
| .map((model) => model?.id) | ||
| .filter((id): id is string => typeof id === "string"); | ||
| } catch (error) { | ||
| console.error( | ||
| "Failed to fetch or parse NVIDIA model catalog:", | ||
| error instanceof Error ? error.message : error | ||
| ); | ||
| process.exitCode = 2; | ||
| return; | ||
| } | ||
| const documentedFreeIds = FREE_MODEL_BUDGETS.filter((model) => model.provider === "nvidia").map( | ||
| (model) => model.modelId | ||
| ); | ||
| const drift = computeNvidiaCatalogDrift(liveIds, reviewedLiveIds, documentedFreeIds); | ||
|
|
||
| console.log( | ||
| `NVIDIA catalog: ${drift.liveCount} live model(s), ${drift.reviewedLiveCount} reviewed live model(s), ${drift.documentedFreeCount} documented free/trial model(s).` | ||
| ); | ||
| printIds("New live models requiring metadata review", drift.newLiveIds); | ||
| printIds("Reviewed models removed from the live catalog", drift.removedLiveIds); | ||
| printIds( | ||
| "Documented free models missing from the live catalog", | ||
| drift.documentedMissingUpstreamIds | ||
| ); | ||
|
|
||
| if ( | ||
| drift.newLiveIds.length || | ||
| drift.removedLiveIds.length || | ||
| drift.documentedMissingUpstreamIds.length | ||
| ) { | ||
| console.warn( | ||
| "Catalog drift requires review. Availability alone does not prove that a model is free; verify NVIDIA's model page before updating FREE_MODEL_BUDGETS." | ||
| ); | ||
| if (process.argv.includes("--strict")) process.exitCode = 1; | ||
| } else { | ||
| console.log("No NVIDIA catalog drift detected."); | ||
| } | ||
| } | ||
|
|
||
| const isDirectExecution = process.argv[1]?.endsWith("check-nvidia-catalog-drift.ts"); | ||
| if (isDirectExecution) { | ||
| await main(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { test } from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
| import { computeNvidiaCatalogDrift } from "../../scripts/check/check-nvidia-catalog-drift.ts"; | ||
|
|
||
| test("NVIDIA catalog drift separates new live ids from removed documented ids", () => { | ||
| assert.deepEqual( | ||
| computeNvidiaCatalogDrift( | ||
| ["z-ai/glm-5.2", "openai/gpt-oss-120b", "new/model", "new/model"], | ||
| ["z-ai/glm-5.2", "openai/gpt-oss-120b", "removed/model"], | ||
| ["z-ai/glm-5.2", "openai/gpt-oss-120b", "retired/model"] | ||
| ), | ||
| { | ||
| liveCount: 3, | ||
| reviewedLiveCount: 3, | ||
| documentedFreeCount: 3, | ||
| newLiveIds: ["new/model"], | ||
| removedLiveIds: ["removed/model"], | ||
| documentedMissingUpstreamIds: ["retired/model"], | ||
| } | ||
| ); | ||
| }); | ||
|
|
||
| test("NVIDIA catalog drift is empty when live and documented ids match", () => { | ||
| const drift = computeNvidiaCatalogDrift(["b", "a"], ["a", "b"], ["a"]); | ||
| assert.deepEqual(drift.newLiveIds, []); | ||
| assert.deepEqual(drift.removedLiveIds, []); | ||
| assert.deepEqual(drift.documentedMissingUpstreamIds, []); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.