Skip to content

feat(providers): native NVIDIA NIM provider (salvage of #11703)#11774

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-aa5963ae
Apr 17, 2026
Merged

feat(providers): native NVIDIA NIM provider (salvage of #11703)#11774
teknium1 merged 2 commits into
mainfrom
hermes/hermes-aa5963ae

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Ships NVIDIA NIM (integrate.api.nvidia.com) as a first-class OpenAI-compatible provider, at parity with xai / huggingface / deepseek / zai.

Salvage of #11703 by @anniesurla. Her commit is preserved with original authorship (see commit log). A follow-up commit closes parity gaps the original PR didn't cover.

Resolves #9106.

Changes

Contributor commit (0f1545e) — core provider registration:

  • `hermes_cli/auth.py`: `PROVIDER_REGISTRY["nvidia"]`
  • `hermes_cli/providers.py`: `HERMES_OVERLAYS["nvidia"]` + aliases (nim, nvidia-nim, build-nvidia, nemotron)
  • `hermes_cli/models.py`: CANONICAL_PROVIDERS entry, `_PROVIDER_MODELS["nvidia"]`, alias map
  • `agent/model_metadata.py`: nvidia provider prefixes + URL mapping
  • `tests/hermes_cli/test_api_key_providers.py`: registry test + env-var test
  • Docs: providers page, quickstart, fallback table, README

Follow-up commit (39eb8b2) — parity gaps:

  • `hermes_cli/main.py`: add `nvidia` to `_model_flow_api_key_provider` dispatch tuple AND `hermes chat --provider` choices. Without these, picking NVIDIA NIM in `hermes model` fell through silently and `hermes chat --provider nvidia` crashed argparse (the PR's own documented test command).
  • `hermes_cli/config.py`: register `NVIDIA_API_KEY` / `NVIDIA_BASE_URL` in `OPTIONAL_ENV_VARS` (setup wizard + auto env-blocklist derivation).
  • `hermes_cli/doctor.py`: NVIDIA NIM row in `_apikey_providers` (probes /v1/models).
  • `hermes_cli/dump.py`: credential-masking entry.
  • `tests/tools/test_local_env_blocklist.py`: NVIDIA_API_KEY in registry_vars fixture.
  • `agent/model_metadata.py`: `"nemotron": 131072` context-length (all Nemotron variants get 128K via substring match).
  • `hermes_cli/models.py`: fix hallucinated `nvidia/nemotron-3-nano-8b-a4b` → `nvidia/nemotron-3-nano-30b-a3b` (verified against live catalog). Expand curated list to 9 agentic models mapping to OpenRouter defaults per provider-guide convention.
  • `cli-config.yaml.example`: document `nvidia` provider option.
  • `scripts/release.py`: AUTHOR_MAP entry for asurla@nvidia.com@anniesurla.

Validation

Check Before After
`hermes chat --provider nvidia ...` argparse "invalid choice" routes to NVIDIA endpoint (401 w/ bogus key)
`hermes model` → NVIDIA NIM picker silent fall-through, no setup `_model_flow_api_key_provider` runs
`hermes doctor` with NVIDIA_API_KEY not detected "✓ NVIDIA NIM" row, /v1/models probed
NVIDIA_API_KEY in subprocess blocklist yes (via PROVIDER_REGISTRY auto-derive) yes (now also asserted in test fixture)
Curated model IDs 1 of 5 hallucinated (`-8b-a4b`) 9 of 9 verified against live catalog
Nemotron context resolution falls to MINIMUM_CONTEXT_LENGTH (64K) 131072 (128K) via "nemotron" key

Targeted tests: `tests/hermes_cli/test_api_key_providers.py` + `tests/tools/test_local_env_blocklist.py` → 147 passed in 7.84s.

E2E: verified with `python -m hermes_cli.main chat --provider nvidia --model nvidia/nemotron-3-super-120b-a12b -q test` and `... doctor` — both take the correct code paths.

Attribution

Original author: @anniesurla (asurla@nvidia.com). Her commit is preserved with `git cherry-pick` + rebase-merge.

anniesurla and others added 2 commits April 17, 2026 13:00
Adds NVIDIA NIM as a first-class provider: ProviderConfig in
auth.py, HermesOverlay in providers.py, curated models
(Nemotron plus other open source models hosted on
build.nvidia.com), URL mapping in model_metadata.py, aliases
(nim, nvidia-nim, build-nvidia, nemotron), and env var tests.

Docs updated: providers page, quickstart table, fallback
providers table, and README provider list.
Follow-up on the native NVIDIA NIM provider salvage. The original PR wired
PROVIDER_REGISTRY + HERMES_OVERLAYS correctly but missed several touchpoints
required for full parity with other OpenAI-compatible providers (xai,
huggingface, deepseek, zai).

Gaps closed:

- hermes_cli/main.py:
  - Add 'nvidia' to the _model_flow_api_key_provider dispatch tuple so
    selecting 'NVIDIA NIM' in `hermes model` actually runs the api-key
    provider flow (previously fell through silently).
  - Add 'nvidia' to `hermes chat --provider` argparse choices so the
    documented test command (`hermes chat --provider nvidia --model ...`)
    parses successfully.

- hermes_cli/config.py: Register NVIDIA_API_KEY and NVIDIA_BASE_URL in
  OPTIONAL_ENV_VARS so setup wizard can prompt for them and they're
  auto-added to the subprocess env blocklist.

- hermes_cli/doctor.py: Add NVIDIA NIM row to `_apikey_providers` so
  `hermes doctor` probes https://integrate.api.nvidia.com/v1/models.

- hermes_cli/dump.py: Add NVIDIA_API_KEY → 'nvidia' mapping for
  `hermes dump` credential masking.

- tests/tools/test_local_env_blocklist.py: Extend registry_vars fixture
  with NVIDIA_API_KEY to verify it's blocked from leaking into subprocesses.

- agent/model_metadata.py: Add 'nemotron' → 131072 context-length entry
  so all Nemotron variants get 128K context via substring match (rather
  than falling back to MINIMUM_CONTEXT_LENGTH).

- hermes_cli/models.py: Fix hallucinated model ID
  'nvidia/nemotron-3-nano-8b-a4b' → 'nvidia/nemotron-3-nano-30b-a3b'
  (verified against live integrate.api.nvidia.com/v1/models catalog).
  Expand curated list from 5 to 9 agentic models mapping to OpenRouter
  defaults per provider-guide convention: add qwen3.5-397b-a17b,
  deepseek-v3.2, llama-3.3-nemotron-super-49b-v1.5, gpt-oss-120b.

- cli-config.yaml.example: Document 'nvidia' provider option.

- scripts/release.py: Map asurla@nvidia.com → anniesurla in AUTHOR_MAP
  for CI attribution.

E2E verified: `hermes chat --provider nvidia ...` now reaches NVIDIA's
endpoint (returns 401 with bogus key instead of argparse error);
`hermes doctor` detects NVIDIA NIM when NVIDIA_API_KEY is set.
@teknium1 teknium1 force-pushed the hermes/hermes-aa5963ae branch from 39eb8b2 to 113099c Compare April 17, 2026 20:44
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Dependency manifest files modified

Changes to dependency files can introduce new packages or change version pins. Verify all dependency changes are intentional and from trusted sources.

Files:

pyproject.toml

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1 teknium1 merged commit f362083 into main Apr 17, 2026
8 checks passed
@teknium1 teknium1 deleted the hermes/hermes-aa5963ae branch April 17, 2026 20:47
teknium1 added a commit that referenced this pull request Apr 18, 2026
Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (#11363) — optional-skills-catalog entry
- /gquota (#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
teknium1 added a commit that referenced this pull request Apr 18, 2026
Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (#11363) — optional-skills-catalog entry
- /gquota (#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
)

Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (NousResearch#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (NousResearch#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (NousResearch#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (NousResearch#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (NousResearch#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (NousResearch#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (NousResearch#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (NousResearch#11363) — optional-skills-catalog entry
- /gquota (NousResearch#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
)

Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (NousResearch#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (NousResearch#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (NousResearch#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (NousResearch#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (NousResearch#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (NousResearch#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (NousResearch#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (NousResearch#11363) — optional-skills-catalog entry
- /gquota (NousResearch#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
)

Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (NousResearch#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (NousResearch#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (NousResearch#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (NousResearch#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (NousResearch#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (NousResearch#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (NousResearch#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (NousResearch#11363) — optional-skills-catalog entry
- /gquota (NousResearch#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
)

Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (NousResearch#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (NousResearch#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (NousResearch#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (NousResearch#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (NousResearch#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (NousResearch#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (NousResearch#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (NousResearch#11363) — optional-skills-catalog entry
- /gquota (NousResearch#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
)

Fills documentation gaps that accumulated as features merged ahead of their
docs updates. All additions are verified against code and the originating PRs.

Providers:
- Ollama Cloud (NousResearch#10782) — new provider section, env vars, quickstart/fallback rows
- xAI Grok Responses API + TTS (NousResearch#10783) — provider note, TTS table + config
- Google Gemini CLI OAuth (NousResearch#11270) — quickstart/fallback/cli-commands entries
- NVIDIA NIM (NousResearch#11774) — NVIDIA_API_KEY / NVIDIA_BASE_URL in env-vars reference
- HERMES_INFERENCE_PROVIDER enum updated

Messaging:
- DISCORD_ALLOWED_ROLES (NousResearch#11608) — env-vars, discord.md access control section
- DingTalk QR device-flow (NousResearch#11574) — wizard path in Option A + openClaw disclosure
- Feishu document comment intelligent reply (NousResearch#11898) — full section + 3-tier access control + CLI

Skills / commands:
- concept-diagrams skill (NousResearch#11363) — optional-skills-catalog entry
- /gquota (NousResearch#11270) — slash-commands reference

Build: docusaurus build passes, ascii-guard lint 0 errors.
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.

[Feature]: Add NVIDIA NIMS gateway support

2 participants