Skip to content

fix(deploy): correct vLLM HF model id and pass HF_TOKEN to VM - #2729

Merged
ericksoa merged 21 commits into
mainfrom
fix/996-vllm-hf-model-and-token-v2
Apr 30, 2026
Merged

ericksoa merged 21 commits into
mainfrom
fix/996-vllm-hf-model-and-token-v2

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Apr 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Supersedes #2459 (rebased with signed-off commits; original branch had force-push protection).

Fixes three issues from #996 that prevented vLLM from starting on Brev deploy:

  • Wrong HF model id: The vLLM blueprint profile used the NIM catalog name (nvidia/nemotron-3-nano-30b-a3b) which returns 404 on Hugging Face. Replaced with the correct HF repo id (nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8).
  • No HF_TOKEN on VM: Added HF_TOKEN and HUGGING_FACE_HUB_TOKEN to DeployCredentials so Brev deploy passes them to the VM — without these, gated HF models return 401.
  • Missing --trust-remote-code: Documented in the blueprint profile comment that vLLM must be started with --trust-remote-code for models with custom code. NemoClaw doesn't launch vLLM itself, so this is a documentation fix.

Also updated scripts/test-inference-local.sh to use the correct HF model id.

Note: nim-images.json and index.ts NIM model entries are not changed — those use the NIM catalog name which is correct for the NIM API provider.

Closes #996

Test plan

  • New test: HF_TOKEN and HUGGING_FACE_HUB_TOKEN are passed through in buildDeployEnvLines
  • Existing deploy tests pass (10/10)
  • NIM tests unchanged and passing (27/27)
  • All pre-commit and pre-push hooks pass
  • All commits signed off (DCO)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Local vLLM inference support with automatic model resolution and server lifecycle checks
    • Hugging Face token support for deployments
  • Bug Fixes

    • WebSocket proxy tunnel fix for sandboxed environments
    • Seccomp guard to prevent network-interface related crashes
  • Improvements

    • Early startup logging to /tmp for diagnostics
    • Model reference updated to a Hugging Face repo ID
    • Entrypoint/startup robustness and permission handling
  • Tests

    • New tests covering local inference setup and seccomp guard behavior

Ubuntu and others added 10 commits April 30, 2026 01:46
…0.0.36

Two bugs caused the gateway to crash on OpenShell ≥0.0.36:

1. Landlock blocks /opt/nemoclaw-blueprint/ from non-root users. The
   ws-proxy-fix.js preload was the only NODE_OPTIONS --require script
   read directly from that path. The entrypoint hit "Permission denied"
   on the shell redirect and set -euo pipefail killed it before
   touch /tmp/gateway.log — leaving no log to diagnose.

   Fix: copy ws-proxy-fix.js to /usr/local/lib/nemoclaw/ at build time
   (Dockerfile), then to /tmp/ at runtime via emit_sandbox_sourced_file
   (same pattern as every other preload).

2. Seccomp blocks getifaddrs (os.networkInterfaces()). The mDNS library
   (@homebridge/ciao) calls it without error handling, producing an
   unhandled promise rejection. OpenClaw's own rejection handler calls
   process.exit(1) for unrecognised errors, killing the gateway ~200ms
   after it logs "listening".

   Fix: monkey-patch os.networkInterfaces() in a new always-installed
   preload (seccomp-guard.js) to return {} when the syscall throws
   uv_interface_addresses. mDNS discovery is not needed in a sandbox.

Also:
- Add early exec > >(tee) capture to /tmp/nemoclaw-start.log so crashes
  before gateway.log are diagnosable.
- Dump /tmp/nemoclaw-start.log in e2e Phase 7 on S1 failure.
- Add 13 unit tests covering the seccomp guard, ws-proxy-fix Landlock
  mitigation, and early stderr capture.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: prekshivyas <[email protected]>
The early stderr capture via exec > >(tee) created the log with default
umask permissions. The script later prints tokenized dashboard URLs
(#token=...) to stderr, leaking the gateway token to any user who can
read /tmp/nemoclaw-start.log.

Pre-create the file with chmod 600 (root:root in root mode) before the
exec redirect so only the owning user can read it.

Also fix unused variable lint (origNI → _origNI) in seccomp-guard test.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: prekshivyas <[email protected]>
Add non-null assertions for Array.pop() returns and explicit parameter
types for .some()/.find() callbacks that lost type inference after the
errno/JSON type consolidation in #2447.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: prekshivyas <[email protected]>
## Summary

`scripts/brev-launchable-ci-cpu.sh` is the community install path for
Brev users — it bootstraps a VM with Docker, Node.js, OpenShell, and
NemoClaw. **That script already exists in the repo but has zero CI
coverage.** This PR adds a nightly E2E smoke test that validates the
script works end-to-end.

This is the long-living safety net for the community install flow. If
any regression breaks the launchable script (e.g., the Apr 20–25 Brev
outage from #2472/#2482, or the container reachability fallback from
#2425), this test catches it before community users are affected.

## Related Issue

Closes #2599
Related: #2425 (the `isProxyHealthy()` fallback in PR #2453 — if that
regresses, onboard will abort on Brev and this smoke test catches it)

## Changes

### New: `test/e2e/test-launchable-smoke.sh`

| Phase | What it validates |
|-------|-------------------|
| 0 | Pre-cleanup + pre-seed clone directory from checkout |
| 1 | Prerequisites (Docker, NVIDIA_API_KEY, network, env vars) |
| 2 | Run `brev-launchable-ci-cpu.sh` — the existing community bootstrap
script |
| 3 | Verify artifacts (nemoclaw, openshell, Node.js, Docker, sentinel
file, built outputs) |
| 4 | `nemoclaw onboard --non-interactive` with cloud provider |
| 5 | Sandbox health (list, status, inference config, gateway) |
| 6 | Live inference (direct API, routing via inference.local, openclaw
agent 6×7=42) |
| 7 | Destroy + cleanup |

Key design decisions:
- **No BREV_API_TOKEN needed** — the launchable script is a generic
Ubuntu bootstrap with zero Brev dependencies, so it runs on standard
GitHub-hosted `ubuntu-latest` runners
- **Tests current code, not main** — pre-seeds the clone directory from
the CI checkout so regressions are caught before reaching community
users
- **Follows existing E2E conventions** — pass/fail/section helpers,
e2e-timeout.sh self-wrap, sandbox-teardown.sh EXIT trap,
parse_chat_content() for reasoning models

### Modified: `.github/workflows/nightly-e2e.yaml`

- Added `launchable-smoke-e2e` job: `ubuntu-latest`, 30min timeout,
`NVIDIA_API_KEY` secret
- Uploads install/onboard/test logs as artifacts on failure
- Added to `notify-on-failure` needs list

## Validation

Triggered via fork dispatch (`jyaunches/NemoClaw` → `sparky-dispatch` →
`launchable-smoke`):
- **Run:**
https://github.com/jyaunches/NemoClaw/actions/runs/25075715342
- **Result:** ✅ 24 passed, 0 failed, 1 skipped (Node.js version — GH
runner pre-installs Node 20)
- **Runtime:** ~12 minutes

## Type of Change
- [x] Code change (feature, bug fix, or refactor)

## Checklist
- [x] Follows project coding conventions
- [x] Tests pass locally or in CI
- [x] No secrets/credentials committed

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added an end-to-end smoke test and CI job that validates the community
launchable CPU install path (install, onboarding, runtime readiness, and
a simple inference check). CI now uploads install/onboard/test logs on
failures.

* **Chores**
* Renamed the branch-validation workflow and corresponding test-suite
identifiers for clarity.
* Updated E2E test documentation and project configuration names to
match the new labeling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: prekshivyas <[email protected]>
Add hadolint ignore comments for pre-existing DL3006 (untagged FROM with
build arg) and SC2015 (A && B || C pattern) warnings in Dockerfile.

Increase global CLI test timeout from 5s to 15s — several integration
tests spawn child processes with 10s exec timeouts, causing intermittent
Vitest timeout failures.

Include hook-generated updates to ws-proxy-fix.js comment and agent
skills docs.

Signed-off-by: prekshivyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: prekshivyas <[email protected]>
The vLLM blueprint profile used the NIM catalog name
(nvidia/nemotron-3-nano-30b-a3b) which does not exist on Hugging Face,
causing a 404 when vLLM tries to download the model. Replace with the
correct HF repo id (nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8).

Also add HF_TOKEN and HUGGING_FACE_HUB_TOKEN to DeployCredentials so
Brev deploy passes them to the VM — without these, gated HF models
return 401.

Closes #996

Signed-off-by: prekshivyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: prekshivyas <[email protected]>
PR #1470 removed brev-setup.sh, which was the only path that installed
and started vLLM on Brev GPU deploys. Ollama setup in install.sh has also
been commented out since commit 91982ef ("for now"). The result: users
setting NEMOCLAW_PROVIDER=vllm or =ollama fall through onboarding with
nothing to talk to on localhost:8000 or :11434 (NVQA #996).

Restore both, gated on NEMOCLAW_PROVIDER so the default cloud path is
unchanged:

- `install_or_upgrade_ollama` — re-enabled behind NEMOCLAW_PROVIDER=ollama
  (was previously GPU-gated only; now opt-in to avoid pulling Nemotron
  models on hosts that don't need them).
- `install_or_start_vllm` — new function. Pip-installs vllm when missing,
  starts it with --trust-remote-code against the HF model id declared in
  nemoclaw-blueprint/blueprint.yaml, and polls /v1/models for readiness.
  Bails with a warn on timeout or early exit.

Test coverage: 4 unit tests verify the no-op gating path, the ollama
conditional in main(), that the vLLM default model id stays in sync with
the blueprint, and that --trust-remote-code is on the command line.
Real end-to-end vLLM on a GPU host remains a manual check for now.

Signed-off-by: Prekshi Vyas <[email protected]>
Signed-off-by: prekshivyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

Signed-off-by: Prekshi Vyas <[email protected]>
Remove unused TIMEOUT_CMD variable in test-launchable-smoke.sh (SC2034)
and add hadolint DL3006 ignore for ARG-based FROM in hermes Dockerfile.

Signed-off-by: Prekshi Vyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Apr 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Corrects the vLLM Hugging Face model id, enables HF token passthrough and starts vLLM with --trust-remote-code when appropriate; adds runtime preloads (ws-proxy fix, seccomp guard), redirects early entrypoint logs, extends deploy credentials/tests, and adjusts Dockerfile preload copy/permissions.

Changes

Cohort / File(s) Summary
Dockerfiles & preload copy
agents/hermes/Dockerfile, Dockerfile
Add hadolint DL3006 suppression for runtime FROM; copy ws-proxy-fix.js into /usr/local/lib/nemoclaw/ and set its permissions to readable (644) while keeping entrypoint scripts executable.
Blueprint & local test payload
nemoclaw-blueprint/blueprint.yaml, scripts/test-inference-local.sh
Update vLLM model to HF repo id nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8 and add inline note about HF repo id / --trust-remote-code; update test script model string accordingly.
Local vLLM install/start flow
scripts/install.sh, test/local-inference-setup.test.ts
Add provider- and GPU-gated vLLM path: resolve model from blueprint, best-effort ensure vllm is installed, start OpenAI-compatible vLLM API with --trust-remote-code bound to 127.0.0.1, poll /v1/models for exact model id and abort on mismatch or timeout; add Vitest suite validating behavior and blueprint consistency.
Entrypoint, preloads & logging
scripts/nemoclaw-start.sh, test/seccomp-guard.test.ts
Lock PATH, tee early stdout/stderr to /tmp/nemoclaw-start.log with safe permissions, copy ws-proxy-fix to /tmp for sandbox access and inject via NODE_OPTIONS; add seccomp guard preload to patch os.networkInterfaces() on uv_interface_addresses errors; update tmp-permission validation and add tests.
Credentials & deploy plumbing
src/lib/credentials.ts, src/lib/deploy.ts, src/lib/deploy.test.ts
Allowlist HF_TOKEN and HUGGING_FACE_HUB_TOKEN; extend DeployCredentials with optional HF token fields, populate them during deploy, and add unit test ensuring HF tokens appear in VM env with shell quoting.
E2E & misc tests/cleanup
test/e2e/test-launchable-smoke.sh, test/e2e/test-messaging-providers.sh, test/policies.test.ts
Remove unused external timeout probing; add diagnostic dump of /tmp/nemoclaw-start.log when gateway not listening; add explicit typing in a preset-mapping test.
New tests
test/seccomp-guard.test.ts, test/local-inference-setup.test.ts
Add tests for seccomp guard heredoc behavior, ws-proxy-fix sourcing/permissions, early log redirection, and install/start vLLM behavior and blueprint/model consistency.

Sequence Diagram(s)

sequenceDiagram
  participant Installer as Install Script
  participant Blueprint as Blueprint (blueprint.yaml)
  participant Host as Host/VM
  participant vLLM as vLLM API Server

  Installer->>Blueprint: read vllm.model (HF repo id)
  Installer->>Host: detect GPU
  Installer->>Host: ensure pip3 && pip3 install vllm (best-effort)
  Installer->>Host: GET http://127.0.0.1:${VLLM_PORT}/v1/models
  alt not reachable or model mismatch
    Installer->>vLLM: start OpenAI-compatible API (--trust-remote-code, --host 127.0.0.1)
    vLLM-->>Installer: process started (pid)
    loop poll readiness until timeout
      Installer->>vLLM: GET /v1/models
      vLLM-->>Installer: model list (or not ready)
    end
  else reachable and correct model
    Installer-->>Installer: skip start
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped the model id to Hugging Face's gate,
tucked tokens in pockets and trusted remote fate,
a seccomp guard hums, turning errors to {};
ws-fix burrowed to /tmp, logs tee'd nice and straight,
carrots deployed — vLLM wakes up elate! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR contains some changes outside the core #996 objectives: seccomp guard preload in nemoclaw-start.sh, ws-proxy-fix.js Landlock mitigation in Dockerfile, early stderr logging to /tmp/nemoclaw-start.log, and related test additions. While these enhance robustness, they extend beyond the stated requirements. Consider separating infrastructure/robustness improvements (seccomp guard, ws-proxy-fix, early logging) into a distinct PR to maintain focused scope alignment with #996, or update PR description/objectives to justify their inclusion.
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title concisely summarizes the main changes: correcting the vLLM Hugging Face model ID and passing HF_TOKEN to the VM, which directly addresses the linked issue #996.
Linked Issues check ✅ Passed The PR successfully addresses all three coding objectives from #996: (1) replaced incorrect NIM model id with correct HF repo id in blueprint.yaml and test script; (2) added HF_TOKEN/HUGGING_FACE_HUB_TOKEN to DeployCredentials for VM deployment; (3) documented --trust-remote-code requirement in blueprint comments. All changes are implemented with supporting tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/996-vllm-hf-model-and-token-v2

Comment @coderabbitai help to get the list of available commands and usage tips.

Combine validate_tmp_permissions args from both branches (add
_SLACK_REWRITER_SCRIPT alongside _WS_FIX_SCRIPT and _SECCOMP_GUARD_SCRIPT).
Keep TIMEOUT_CMD removal in test-launchable-smoke.sh (unused variable).

Signed-off-by: Prekshi Vyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@prekshivyas prekshivyas self-assigned this Apr 30, 2026
@prekshivyas
prekshivyas requested a review from cv April 30, 2026 02:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Around line 889-892: The current pre-check treats any 200 from curl to
"http://localhost:${VLLM_PORT}/v1/models" as the configured vLLM instance;
change this to fetch and inspect the response body and only short-circuit if the
returned model list includes the expected model variable ($model). In the block
that currently uses curl -fsS ... >/dev/null, capture the JSON output (curl -s),
parse it (e.g., with jq or grep) to verify the model id is present in the list,
and only run info "vLLM already running on :${VLLM_PORT}" and return 0 when the
check for $model succeeds; otherwise proceed to start/restart the vLLM process
so the corrected HF repo id will be applied.

In `@scripts/nemoclaw-start.sh`:
- Around line 35-52: Harden PATH before the logging bootstrap by ensuring the
PATH lockdown occurs before any commands in this block run: either move the PATH
export/lock (the earlier PATH hardening logic that comes before the script's
later PATH locking) to above the block that sets and opens _START_LOG and the
exec > >(tee ...) redirection, or replace calls to id, chown, chmod and tee in
this block with absolute paths (e.g., /usr/bin/id, /bin/chown, /bin/chmod,
/usr/bin/tee) so the tee redirection and the operations on _START_LOG cannot be
resolved from an attacker-controlled PATH; update the exec redirection line
(exec > >(tee -a "$_START_LOG") 2> >(tee -a "$_START_LOG" >&2)) accordingly if
you switch to absolute tee paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6b3fcf63-ac67-448f-8777-cabe18f4f880

📥 Commits

Reviewing files that changed from the base of the PR and between 9c7b78b and d8caee6.

📒 Files selected for processing (13)
  • Dockerfile
  • agents/hermes/Dockerfile
  • nemoclaw-blueprint/blueprint.yaml
  • scripts/install.sh
  • scripts/nemoclaw-start.sh
  • scripts/test-inference-local.sh
  • src/lib/deploy.test.ts
  • src/lib/deploy.ts
  • test/e2e/test-launchable-smoke.sh
  • test/e2e/test-messaging-providers.sh
  • test/local-inference-setup.test.ts
  • test/policies.test.ts
  • test/seccomp-guard.test.ts
💤 Files with no reviewable changes (1)
  • test/e2e/test-launchable-smoke.sh

Comment thread scripts/install.sh Resolved
Comment thread scripts/nemoclaw-start.sh Resolved
prekshivyas and others added 2 commits April 30, 2026 02:26
- Add HF_TOKEN and HUGGING_FACE_HUB_TOKEN to KNOWN_CREDENTIAL_ENV_KEYS
  so they are tracked, loaded from legacy files, and passed through to
  deploy. Without this the deploy.ts plumbing was dead code for vLLM
  users with gated HF models.

- Verify vLLM is importable after pip install; bail early with a clear
  message instead of trying to start a binary that was never installed.

- Wrap install_or_start_vllm in main() with || warn so a vLLM failure
  does not abort the entire install (errexit would kill CLI setup).

Signed-off-by: Prekshi Vyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ing vLLM model

- Move PATH lockdown above the _START_LOG bootstrap in nemoclaw-start.sh
  so id/chown/chmod/tee cannot be resolved from an injected PATH.

- Check the running vLLM model id before reusing an existing instance.
  A stale vLLM serving a different model (e.g., the old NIM catalog
  name) must not be short-circuited — otherwise the corrected HF repo
  id from this PR never gets applied on redeploy.

Signed-off-by: Prekshi Vyas <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Around line 899-903: The vLLM server is being bound to all interfaces via the
CLI flag in the nohup invocation of vllm.entrypoints.openai.api_server; change
the --host value from 0.0.0.0 to the loopback address (e.g., 127.0.0.1 or
localhost) in that nohup python3 -m vllm.entrypoints.openai.api_server command
so the service is only reachable locally (no other code changes needed, just
update the --host argument).
- Around line 1453-1456: The installer currently swallows install_or_start_vllm
failures unconditionally; update the invocation so that when NEMOCLAW_PROVIDER
== "vllm" the script exits on a non-zero return (fail fast) and only
warn/continue when the provider is not explicitly vllm. Concretely, replace the
lone line calling install_or_start_vllm with a conditional: if [[
"${NEMOCLAW_PROVIDER:-}" == "vllm" ]]; then run install_or_start_vllm and on
failure call an error/exit (e.g., echo/processLogger + exit 1); else run
install_or_start_vllm || warn "vLLM setup failed — continuing without local
inference." This references the install_or_start_vllm function and the
NEMOCLAW_PROVIDER env var.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 98805741-721b-4ef4-97f5-fa4108ee2d53

📥 Commits

Reviewing files that changed from the base of the PR and between d8caee6 and 3287ae5.

📒 Files selected for processing (2)
  • scripts/install.sh
  • src/lib/credentials.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/credentials.ts

Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
scripts/install.sh (1)

888-900: 💤 Low value

Consider using --user flag for pip install.

Using pip3 install --break-system-packages vllm with fallback to pip3 install vllm can modify system Python packages. For a user-space installer, consider using pip3 install --user vllm to avoid modifying system packages and potential permission issues.

♻️ Suggested change
-    pip3 install --break-system-packages vllm 2>/dev/null || pip3 install vllm
+    pip3 install --user vllm 2>/dev/null || pip3 install --break-system-packages vllm 2>/dev/null || pip3 install vllm
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install.sh` around lines 888 - 900, The pip install call for vLLM
currently uses "pip3 install --break-system-packages vllm" (with a fallback to
"pip3 install vllm"), which can alter system Python packages; change the
installation to prefer a user-local install by using the "--user" flag for pip
(e.g., "pip3 install --user vllm") unless the script is running as root.
Specifically, update the install logic around the python3 -c "import vllm" check
and the pip3 install lines so that non-root installs use "--user" (and retain
the existing fallback behavior and error checks), while root runs can continue
using system-wide install flags.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/install.sh`:
- Around line 888-900: The pip install call for vLLM currently uses "pip3
install --break-system-packages vllm" (with a fallback to "pip3 install vllm"),
which can alter system Python packages; change the installation to prefer a
user-local install by using the "--user" flag for pip (e.g., "pip3 install
--user vllm") unless the script is running as root. Specifically, update the
install logic around the python3 -c "import vllm" check and the pip3 install
lines so that non-root installs use "--user" (and retain the existing fallback
behavior and error checks), while root runs can continue using system-wide
install flags.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 96aecbdf-6bc4-485d-8fd0-e0d226e4fa00

📥 Commits

Reviewing files that changed from the base of the PR and between 8455816 and d8a56cc.

📒 Files selected for processing (4)
  • Dockerfile
  • agents/hermes/Dockerfile
  • scripts/install.sh
  • scripts/nemoclaw-start.sh
✅ Files skipped from review due to trivial changes (1)
  • agents/hermes/Dockerfile

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I’m holding approval on this PR because the current vLLM install path can still finish successfully without serving the requested local model.

Findings:

  • scripts/install.sh:923: after the pre-check detects that an existing listener on port 8000 is not serving $model, the startup readiness loop still treats any 200 from http://localhost:${VLLM_PORT}/v1/models as success. If the old/stale vLLM process is still bound to port 8000, the newly spawned process cannot bind, but this loop can read the stale listener first, log vLLM ready, and return 0 while the corrected HF model was never applied. The readiness check needs to validate that the responding /v1/models payload includes the expected model, or otherwise stop/restart the stale process before declaring success.

  • scripts/install.sh:916: the vLLM API server is started with --host 0.0.0.0 even though the blueprint and health checks use localhost. That exposes the local inference server to the VM network unnecessarily. This should bind to 127.0.0.1 unless there is a documented remote-access requirement.

  • scripts/install.sh:1470: install_or_start_vllm failures are still swallowed even when the user explicitly selected NEMOCLAW_PROVIDER=vllm. That lets the installer continue into onboarding with localhost:8000 unavailable or serving the wrong model, which is exactly the failure mode this PR is trying to fix. For an explicit vLLM provider, this should fail the install rather than warn and continue.

cv and others added 3 commits April 29, 2026 20:12
…ilures

Address review on #2729:
- readiness loop now grep-checks the /v1/models payload for $model so a
  stale listener on :8000 can't masquerade as the new process
- pre-check + readiness use grep -Fq to match $model as a literal string,
  avoiding superstring false positives
- bind vLLM API server to 127.0.0.1 (blueprint and health checks are
  localhost-only; no remote-access requirement)
- kill orphan vLLM process on readiness timeout so a re-run isn't blocked
  by a python still bound to :8000
- when NEMOCLAW_PROVIDER=vllm, abort the install on setup failure instead
  of warn-and-continue into broken onboarding

Add static-grep tests for loopback bind, readiness model validation, and
main() fail-fast behavior.

Signed-off-by: Prekshi Vyas <[email protected]>

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Around line 906-913: The current check uses grep -Fq "$model" against the raw
$running_models JSON which can match substrings (e.g., "${model}-quantized") and
also fails on empty/invalid payloads; replace that substring check by parsing
the /v1/models JSON and testing exact equality against model IDs. Specifically,
stop using grep -Fq "$model" and instead parse $running_models with a JSON
parser (jq) to extract the list of model ids (e.g., from .models[].model or the
appropriate key returned by the server), handle an empty or non-JSON response
robustly, and then test for an exact match (==) against $model before deciding
vLLM is already running on ${VLLM_PORT}; reference the variables/functions
running_models, model and the current grep check to locate the replacement
point.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c4387af3-cf9e-4ba9-89bb-c9d4b2e09cac

📥 Commits

Reviewing files that changed from the base of the PR and between d8a56cc and 92098c9.

📒 Files selected for processing (2)
  • scripts/install.sh
  • test/local-inference-setup.test.ts
✅ Files skipped from review due to trivial changes (1)
  • test/local-inference-setup.test.ts

Comment thread scripts/install.sh Resolved
Resolve scripts/nemoclaw-start.sh conflict in write_runtime_shell_env:
adopt main's function wrapper, gateway-token export, and configure-guard
heredoc; preserve this PR's seccomp-guard echo line by inserting it
between the Nemotron and ciao-network entries.

Signed-off-by: Prekshi Vyas <[email protected]>

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
grep -Fq "$model" matched the raw model string anywhere in the
/v1/models payload, so a stale listener serving a superstring (e.g.
"${model}-quantized") would falsely register as the expected instance.
Wrap the pattern in the JSON id field — grep -Fq "\"id\":\"$model\"" —
so the match requires the model id to appear as a quoted JSON value.

Update the readiness-loop regression test accordingly.

Signed-off-by: Prekshi Vyas <[email protected]>

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@prekshivyas
prekshivyas requested a review from ericksoa April 30, 2026 06:33
@cv cv added v0.0.32 and removed v0.0.31 labels Apr 30, 2026

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for addressing the earlier vLLM findings. The stale-listener readiness path, loopback bind, and explicit-provider fail-fast wrapper are much better now. I still see two things that need to be fixed before this can merge.

First, the explicit NEMOCLAW_PROVIDER=vllm path can still fail open when no GPU is detected. install_or_start_vllm() currently logs NEMOCLAW_PROVIDER=vllm but no GPU detected -- skipping vLLM setup. and returns 0. Because main() now relies on install_or_start_vllm || error ..., that success return means the installer keeps going even though no local vLLM server was started and onboarding is still pointed at localhost:8000. I verified this by sourcing scripts/install.sh, stubbing detect_gpu to fail, and calling NEMOCLAW_PROVIDER=vllm install_or_start_vllm; it returns rc=0. For an explicitly requested vLLM provider, this should return non-zero or otherwise abort so the fail-fast behavior actually applies. Please add a regression test for that path as well.

Second, the branch currently conflicts with current main in scripts/install.sh. The conflict is around the step-2 install section: current main has the branded step 2 "${_CLI_DISPLAY} CLI" line, while this branch adds the local inference setup before fix_npm_permissions. The resolution should keep the branded step label and the new Ollama/vLLM setup logic. GitHub reports the PR as DIRTY/conflicting, and I reproduced the conflict locally with git merge --no-commit origin/main.

I am keeping this as changes requested for now rather than approving over the remaining explicit-vLLM no-GPU fail-open path plus the merge conflict.

…-and-token-v2

Signed-off-by: Prekshi Vyas <[email protected]>

# Conflicts:
#	scripts/install.sh
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

Both addressed in 6b3f7bc2:

  1. Explicit NEMOCLAW_PROVIDER=vllm + no GPU now fails. install_or_start_vllm returns 1 (not 0) on the no-GPU branch, so main()'s || error wrapper trips and the install aborts before onboarding. Added regression test (test/local-inference-setup.test.ts) that sources install.sh, stubs detect_gpu to fail, and asserts rc=1 plus the warning message.

  2. Merge conflict resolved. Kept main's branded step 2 "${_CLI_DISPLAY} CLI" label and this branch's Ollama/vLLM setup logic.

prek run --all-files and CLI tests pass locally.

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the updates. The remaining blocker is addressed now: explicit NEMOCLAW_PROVIDER=vllm fails when GPU detection fails, and main() aborts instead of continuing into onboarding with localhost:8000 unavailable. I also checked the current head after the main merge locally: npm run build:cli, npm run typecheck:cli, npx vitest run test/local-inference-setup.test.ts src/lib/deploy.test.ts test/seccomp-guard.test.ts --testTimeout 60000, and bash -n scripts/install.sh scripts/nemoclaw-start.sh all pass.

@ericksoa
ericksoa merged commit 8dd8437 into main Apr 30, 2026
10 checks passed
@prekshivyas
prekshivyas deleted the fix/996-vllm-hf-model-and-token-v2 branch April 30, 2026 17:14
ericksoa added a commit that referenced this pull request Apr 30, 2026
## Summary
- Emergency fix for nightly-e2e failure on main run
https://github.com/NVIDIA/NemoClaw/actions/runs/25179860786.
- Stage `nemoclaw-blueprint/scripts/` in the optimized sandbox build
context so `Dockerfile` can copy
`nemoclaw-blueprint/scripts/ws-proxy-fix.js`.
- Add regression coverage for `ws-proxy-fix.js` presence in the staged
context.

## Root Cause
PR #2729 / commit `8dd84372` added a `Dockerfile` `COPY` for
`ws-proxy-fix.js`, but the optimized build context only staged
`blueprint.yaml` and `policies/` from `nemoclaw-blueprint`. Docker
received a temp context without `nemoclaw-blueprint/scripts/` and failed
before e2e bodies ran.

## Validation
- `npm run build:cli`
- `npm test -- test/sandbox-build-context.test.ts`

Note: local pre-commit and pre-push broad CLI coverage hooks were
stopped after they expanded into unrelated sandbox/connect/rebuild
paths; the targeted validation above passed.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Build staging process now properly includes blueprint-level scripts
during optimization.

* **Tests**
* Updated test suite to verify scripts are correctly included in the
staging process.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Aaron Erickson <[email protected]>
@miyoungc miyoungc mentioned this pull request Apr 30, 2026
5 of 13 tasks
cv pushed a commit that referenced this pull request Apr 30, 2026
## Summary
Updates NemoClaw documentation for the v0.0.32 release candidate,
covering user-facing changes that landed since v0.0.31 and promoting the
docs version switcher to 0.0.32.

## Changes
- Document Windows-host Ollama support from WSL, including HTTP model
pulls and avoiding duplicate Ollama instances on port 11434. Matches dev
PR #2768.
- Add Ollama GPU memory cleanup behavior for provider switches, service
stops, and sandbox destroy. Matches dev PR #2651.
- Document Hugging Face token forwarding for remote deploy workflows
that pull gated model repositories. Matches dev PR #2729.
- Add runtime sandbox and policy context injection to the architecture
reference. Matches dev PR #2751.
- Bump `docs/versions1.json` and regenerated `docs/project.json` to
0.0.32 for release prep. No separate dev PR.

## Type of Change
- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Verification
- [ ] `npx prek run --all-files` passes
- [ ] `npm test` passes
- [ ] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [ ] `make docs` builds without warnings (doc changes only)
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

## AI Disclosure
- [x] AI-assisted — tool: Cursor

---
Signed-off-by: Miyoung Choi <[email protected]>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
  * Added guidance for deploying with Hugging Face gated models
  * Improved Windows/WSL Ollama configuration instructions
  * Documented GPU memory cleanup behavior during model transitions
  * Enhanced architecture and command reference documentation
  * Version bumped to 0.0.32

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
@wscurran wscurran added the NV QA Bugs found by the NVIDIA QA Team label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression NV QA Bugs found by the NVIDIA QA Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Linux] Brev deploy: vLLM exits - wrong HF model id, no HF_TOKEN, missing --trust-remote-code

5 participants