feat: validate custom NVIDIA NIM model availability - #492
Open
jyje wants to merge 2 commits into
Open
Conversation
jyje
force-pushed
the
feat/nvidia-model-availability-validation
branch
from
August 13, 2026 12:44
f86ae36 to
d94ed3c
Compare
🦋 Changeset detectedLatest commit: ade29ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
jyje
marked this pull request as ready for review
August 14, 2026 00:28
`unavailable` aborts the run before inference with no override, so every inconclusive catalogue lookup that resolves to it is a total blocker. Four paths could reach it without evidence that the model cannot be invoked. - Derive "custom endpoint" by comparing the resolved base URL against the provider's built-in default rather than testing whether the env var is set. Pinning `NVIDIA_BASE_URL` to the documented hosted endpoint made the public hosted catalogue authoritative over entitlement it does not model. - Treat an empty `data` array as `unknown`. A proxied gateway that hides its catalogue from a key without list scope still serves inference. - Bound the lookup with a 5s `AbortSignal.timeout`. The request now targets user-supplied infrastructure, where a stalled host held every run for undici's 300s default. - Build the catalogue URL from `pathname` so a base URL carrying a query string keeps its last path segment, and fall back to `unknown` if the URL cannot be resolved at all. Also surface the availability reason in the thrown error, which previously blamed credentials for a model simply not loaded on the endpoint. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
jyje
force-pushed
the
feat/nvidia-model-availability-validation
branch
from
August 29, 2026 07:46
cb1d2e9 to
ade29ca
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
NVIDIA_BASE_URLNIM-compatible endpoint before inference starts./modelsresponse as unavailable.Why
A custom NVIDIA NIM deployment exposes the models actually loaded by that endpoint. Checking its model catalogue before inference gives users an actionable error instead of waiting for the first inference request to fail.
The default NVIDIA hosted endpoint remains non-authoritative for this check, so its catalogue cannot block inference without stronger entitlement guarantees.
Validation
pnpm run format:checkpnpm run lint:checkpnpm testd94ed3cd78dcd74ac2d290b9db97a796917fcc2c/v1/modelsendpointLive verification cases
nvidia/nemotron-3-super-120b-a12b, credential present,baseUrlIsCustom=trueGET https://integrate.api.nvidia.com/v1/models{ status: "available" }availableopenwiki-live-verification-nonexistent-model, credential present,baseUrlIsCustom=trueGET https://integrate.api.nvidia.com/v1/models{ status: "unavailable" }unavailablebaseUrlIsCustom=true{ status: "unknown" }unknownbaseUrlIsCustom=false{ status: "unknown" }unknownbaseUrlIsCustom=trueError("offline"){ status: "unknown" }unknownThe positive and negative cases intentionally mark the reachable NVIDIA service as NIM-compatible to exercise the custom-endpoint adapter. Production use of the built-in hosted endpoint sets
baseUrlIsCustom=false; the hosted-default case verifies that this path remains non-authoritative and does not issue a catalogue request.Quoted directly from the successful Actions log:
Reviewer reproduction
From a checkout of this PR branch, install dependencies and run the focused offline suite:
To exercise the behavior against a custom NVIDIA NIM deployment, configure the provider with the API root that exposes
/models:Expected positive behavior: the selected model appears in
data[].id, availability resolves toavailable, and the run proceeds to inference.To verify the early unavailable-model error:
Expected negative behavior: OpenWiki stops before inference and reports that NVIDIA NIM does not make the selected model available. If the catalogue request cannot be completed, validation returns
unknownand preserves the existing inference path.The temporary live-verification workflow and test file are not included in this PR branch.
Related issue
This is the NVIDIA provider follow-up for #490 and reuses the shared availability contract introduced in #491.
Feedback is very welcome - please feel free to suggest changes or point out anything I may have missed.