feat: add NVIDIA provider as supported model provider#3421
feat: add NVIDIA provider as supported model provider#3421Priyanshu-sde wants to merge 2 commits into
Conversation
|
This pr closes #3356 |
Sayt-0
left a comment
There was a problem hiding this comment.
Thanks for adding NVIDIA NIM as a built-in alias. The core wiring is correct (APIType, base_url, TokenEnvVar), TestCatalogAliases covers it, and the example model resolves against the models.dev snapshot, so TestParseExamples passes without special-casing. A few items should be addressed before this is a complete first-class provider, matching how the other OpenAI-compatible aliases are wired.
Functional
- Register
nvidiainopenModelHostProviders(pkg/model/provider/openai/client.go). NVIDIA NIM fronts open-weight models (Nemotron, Llama, Qwen, DeepSeek) whose chat templates often reject more than one system message. Without this entry, the per-source system messages are not coalesced, which reproduces the empty-stream /System message must be at the beginningfailures (#3145, #2327, #3344). The shipped example already emits multiple system messages (agent instruction plus thefilesystem,shell, andthinktoolsets), so it is likely to hit this path. - Add a row for
nvidiato theopenAIAliasProvidersend-to-end table (pkg/model/provider/openai_alias_providers_test.go) withmergesSystemMessages: true, matching every other alias.
Docs (each existing alias ships these)
| File | Content |
|---|---|
docs/providers/overview/index.md |
built-in providers table |
docs/concepts/models/index.md |
providers table |
docs/configuration/models/index.md |
provider enumerations (lines 20, 51, 403) |
docs/providers/nvidia/index.md |
dedicated provider page (missing) |
Optional (non-blocking)
agent-schema.jsonprovider description ends inetc., so addingnvidiathere is nice-to-have.- Absence from
cloudProviders/DefaultModelsinpkg/config/auto.gois consistent withnebius/xai/minimax(nvidia simply will not participate in auto-selection).NVIDIA_API_KEYis still forwarded as a credential viaProviderAPIKeyEnvVars()since it iterates the aliases.
See inline comments for the specific anchors.
|
Thanks so much for the detailed and thorough review, @Sayt-0 ,
This is genuinely one of the more educational reviews I've gotten. I'll keep digging into the codebase and try to pick up more issues I can meaningfully contribute to. Thanks again for the guidance! |
|
Hi @Priyanshu-sde ! You're welcome. Don't hesitate if you want to contribute again ! |
|
The changes looks good. Approved ! Have a nice day ! |
|
one last thing: your commits must be signed in this repo |
|
Hi @Sayt-0 , I have updated to signed commits, also that's a new thing i got to learn about Thank you |
Summary
Add first-class support for NVIDIA (NIM / build.nvidia.com) as an OpenAI-compatible model provider. Hosted NVIDIA models work via a new alias, while self-hosted NVIDIA NIM is supported by overriding
base_url.Changes
nvidiaalias inpkg/model/provider/aliases.go:APIType: "openai"BaseURL: "https://integrate.api.nvidia.com/v1"TokenEnvVar: "NVIDIA_API_KEY"nvidiatoTestCatalogAliasesinpkg/model/provider/aliases_test.go.examples/nvidia.yamldemonstrating NVIDIA NIM with thenvidia/nemotron-3-super-120b-a12bmodel.Notes
pkg/modelsdev/snapshot.json, allowing example validation without special-casing.base_urlto point to a local NIM endpoint.Testing
task test— all tests pass.task lint— no issues.