Skip to content

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

Closed
prekshivyas wants to merge 7 commits into
mainfrom
fix/996-vllm-hf-model-and-token
Closed

prekshivyas wants to merge 7 commits into
mainfrom
fix/996-vllm-hf-model-and-token

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Apr 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

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

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • CLI reference updated: onboard --from <Dockerfile> documented and deprecated aliases for legacy commands clarified.
  • New Features

    • Deployment now accepts Hugging Face auth tokens.
    • Optional local vLLM inference setup and updated default model target.
  • Bug Fixes

    • Improved WebSocket proxy handling and added seccomp guard to prevent Node runtime crashes.
    • Entrypoint now captures startup logs for easier diagnostics.
  • Tests

    • New and expanded tests covering deployment credentials, startup guards, vLLM setup, and related stability fixes.

Ubuntu and others added 6 commits April 24, 2026 20:59
…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]>
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]>
@copy-pr-bot

copy-pr-bot Bot commented Apr 24, 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 24, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Updates enable local vLLM inference by correcting the Hugging Face model id, passing HF tokens into deployed VMs, starting vLLM with --trust-remote-code, and improve runtime reliability and diagnostics (seccomp guard, ws-proxy preload, start log capture). Several tests and docs were added/updated.

Changes

Cohort / File(s) Summary
Model configuration & test payloads
nemoclaw-blueprint/blueprint.yaml, scripts/test-inference-local.sh
Replace vLLM model id with HF repo nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8; add clarifying comment about HF repo id and --trust-remote-code; update local test script model field.
Installer: local vLLM setup
scripts/install.sh, nemoclaw-blueprint/...
Add vLLM install/start path: install vllm when provider=vllm and GPU present, resolve model from blueprint (or env fallback), start vLLM OpenAI-compatible server with --trust-remote-code, and wait for readiness.
Deploy credential plumbing
src/lib/deploy.ts, src/lib/deploy.test.ts
Add optional HF_TOKEN and HUGGING_FACE_HUB_TOKEN to DeployCredentials; fetch and include them when building remote VM env. Unit test added to verify passthrough.
Sandbox startup & runtime guards
scripts/nemoclaw-start.sh, scripts/ws-proxy-fix.js (emitted and repo copy), Dockerfile
Capture stdout/stderr to /tmp/nemoclaw-start.log via tee; add seccomp guard preload that patches os.networkInterfaces() to avoid Node v22 crashes; change ws-proxy preload path to /usr/local/lib/nemoclaw/ws-proxy-fix.js, emit to /tmp for sandbox; copy preload into image and set permissions; add hadolint ignores.
Tests: seccomp, e2e, and strictness fixes
test/seccomp-guard.test.ts, test/e2e/test-messaging-providers.sh, test/onboard.test.ts, test/policies.test.ts, test/local-inference-setup.test.ts, vitest.config.ts
Add new Vitest suite validating seccomp guard, ws-proxy sourcing, Dockerfile copy, and start-log behavior; enhance e2e to print start log on failures; add tests validating install.sh vLLM logic and blueprint model; tighten TypeScript tests (non-null assertions, explicit types); set CLI test timeout to 15000ms.
CLI docs
.agents/skills/nemoclaw-user-reference/references/commands.md
Document nemoclaw onboard --from <Dockerfile> behavior; add deprecated alias docs for nemoclaw start/stop and nemoclaw setup forwarding with warnings and examples.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer / CLI
    participant Installer as install.sh
    participant VM as Deployed VM
    participant vLLM as vLLM Server
    participant HF as Hugging Face

    Dev->>Installer: run install / deploy (provider=vllm)
    Installer->>VM: provision VM, write .env (includes HF_TOKEN/HUGGING_FACE_HUB_TOKEN)
    Installer->>VM: start vLLM api_server --trust-remote-code
    VM->>vLLM: vLLM process starts and loads model
    vLLM->>HF: download repo `nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8` (auth via tokens)
    vLLM->>VM: serve OpenAI-compatible API on :8000 (health OK)
    VM->>Installer: report readiness
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A rabbit hops in code so spry,
HF tokens tucked away nearby.
vLLM wakes with trusted code in tow,
Seccomp guards whisper "no crash, no woe."
Logs in /tmp sing — deploys ready to fly. 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Multiple changes beyond the three stated fixes: documentation updates (commands.md), unrelated Dockerfile/seccomp guard changes, ws-proxy-fix.js updates, entrypoint logging (nemoclaw-start.sh), test infrastructure updates (vitest.config.ts), and TypeScript type annotation changes that are not required by issue #996. Clarify whether all included changes are necessary for the vLLM fix or separate refactoring; consider breaking large unrelated changes into separate PRs for clearer scope and easier review.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% 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 title accurately summarizes the main changes: correcting the vLLM Hugging Face model ID and passing HF tokens to the VM, which are the core fixes for issue #996.
Linked Issues check ✅ Passed All three coding requirements from issue #996 are met: correct HF model ID updated in blueprint and scripts, HF_TOKEN credentials added to DeployCredentials, and --trust-remote-code documented/implemented in vLLM setup.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/996-vllm-hf-model-and-token
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/996-vllm-hf-model-and-token

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

@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 (2)
.agents/skills/nemoclaw-user-reference/references/commands.md (1)

177-184: Consolidate duplicated command docs in the source docs (not generated skills output).

This adds duplicate coverage for onboard --from and setup that already exists elsewhere in the same document, which can drift over time. Please keep one canonical section in the generating docs source and regenerate this file.

Based on learnings: markdown under .agents/skills/ is autogenerated from docs/ and review feedback should target the source docs content.

Also applies to: 598-607

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/nemoclaw-user-reference/references/commands.md around lines
177 - 184, The command docs for "nemoclaw onboard --from" and the "setup"
section are duplicated in the generated skills markdown; remove the duplicate by
editing the canonical source docs (the docs/ source that generates skills
output) to keep a single canonical section for these commands, then regenerate
the autogenerated skills docs so the generated markdown no longer contains the
duplicate entries for "nemoclaw onboard --from" and "setup".
test/e2e/test-messaging-providers.sh (1)

1186-1190: Prefer tailing inside the sandbox to keep failure diagnostics bounded.

Fetching the whole file and tailing locally can move unnecessary data in noisy failures. Tail remotely instead.

♻️ Suggested refactor
-  start_log=$(openshell sandbox exec --name "$SANDBOX_NAME" -- cat /tmp/nemoclaw-start.log 2>/dev/null || true)
+  start_log=$(openshell sandbox exec --name "$SANDBOX_NAME" -- tail -40 /tmp/nemoclaw-start.log 2>/dev/null || true)
   if [ -n "$start_log" ]; then
     info "Entrypoint log (last 40 lines of /tmp/nemoclaw-start.log):"
-    echo "$start_log" | tail -40 | while IFS= read -r line; do
+    echo "$start_log" | while IFS= read -r line; do
       info "  $line"
     done
   fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/test-messaging-providers.sh` around lines 1186 - 1190, The test
currently cats the entire /tmp/nemoclaw-start.log out of the sandbox into
start_log then tails locally; instead run tail inside the sandbox to limit
transferred data: replace the openshell call that sets start_log (using
openshell sandbox exec --name "$SANDBOX_NAME" -- cat /tmp/nemoclaw-start.log
...) with an openshell sandbox exec that runs tail -n 40 /tmp/nemoclaw-start.log
(still redirecting stderr to /dev/null and preserving the || true fallback),
keep the subsequent info and loop over start_log unchanged so you still log each
line; reference the existing variables/commands start_log, openshell sandbox
exec, SANDBOX_NAME, and info to locate and update the code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.agents/skills/nemoclaw-user-reference/references/commands.md:
- Around line 177-184: The command docs for "nemoclaw onboard --from" and the
"setup" section are duplicated in the generated skills markdown; remove the
duplicate by editing the canonical source docs (the docs/ source that generates
skills output) to keep a single canonical section for these commands, then
regenerate the autogenerated skills docs so the generated markdown no longer
contains the duplicate entries for "nemoclaw onboard --from" and "setup".

In `@test/e2e/test-messaging-providers.sh`:
- Around line 1186-1190: The test currently cats the entire
/tmp/nemoclaw-start.log out of the sandbox into start_log then tails locally;
instead run tail inside the sandbox to limit transferred data: replace the
openshell call that sets start_log (using openshell sandbox exec --name
"$SANDBOX_NAME" -- cat /tmp/nemoclaw-start.log ...) with an openshell sandbox
exec that runs tail -n 40 /tmp/nemoclaw-start.log (still redirecting stderr to
/dev/null and preserving the || true fallback), keep the subsequent info and
loop over start_log unchanged so you still log each line; reference the existing
variables/commands start_log, openshell sandbox exec, SANDBOX_NAME, and info to
locate and update the code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e3ce51c1-cad0-44cc-95ef-e45e9c84c3db

📥 Commits

Reviewing files that changed from the base of the PR and between 260b237 and 29ecb68.

📒 Files selected for processing (13)
  • .agents/skills/nemoclaw-user-reference/references/commands.md
  • Dockerfile
  • nemoclaw-blueprint/blueprint.yaml
  • nemoclaw-blueprint/scripts/ws-proxy-fix.js
  • scripts/nemoclaw-start.sh
  • scripts/test-inference-local.sh
  • src/lib/deploy.test.ts
  • src/lib/deploy.ts
  • test/e2e/test-messaging-providers.sh
  • test/onboard.test.ts
  • test/policies.test.ts
  • test/seccomp-guard.test.ts
  • vitest.config.ts

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]>

@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

🧹 Nitpick comments (1)
test/local-inference-setup.test.ts (1)

41-52: Exercise resolve_vllm_model() instead of re-parsing install.sh in JS.

This only compares two regex-extracted strings. The shell parser can break and this still passes, because the test never calls resolve_vllm_model(). Prefer asserting the sourced function returns the blueprint model.

Suggested refactor
   it("vLLM default model id matches the blueprint", () => {
-    const content = fs.readFileSync(INSTALL_SH, "utf-8");
-    const installMatch = content.match(/VLLM_DEFAULT_MODEL="([^"]+)"/);
-    expect(installMatch).not.toBeNull();
-    const installModel = installMatch![1];
-
     const blueprintContent = fs.readFileSync(BLUEPRINT, "utf-8");
     const blueprintMatch = blueprintContent.match(/vllm:[\s\S]*?model:\s*"([^"]+)"/);
     expect(blueprintMatch).not.toBeNull();
     const blueprintModel = blueprintMatch![1];
 
-    expect(installModel).toBe(blueprintModel);
+    const result = sourceAndRun('printf "%s" "$(resolve_vllm_model)"');
+    expect(result.status).toBe(0);
+    expect(result.stdout.trim()).toBe(blueprintModel);
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/local-inference-setup.test.ts` around lines 41 - 52, The test currently
re-parses INSTALL_SH with regex instead of invoking resolve_vllm_model(), so
replace the regex-based install.sh parsing in the "vLLM default model id matches
the blueprint" test with a call to resolve_vllm_model() to get the resolved
model id and then assert that equals the blueprintModel (which you still extract
from BLUEPRINT); specifically, import or source the module exposing
resolve_vllm_model(), call resolve_vllm_model() to obtain installModel, and keep
the existing blueprint parsing (blueprintMatch/blueprintModel) and the
expect(installModel).toBe(blueprintModel) assertion.
🤖 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 856-860: The awk in resolve_vllm_model() only matches a vllm: with
exactly six leading spaces so it misses root-level or differently-indented keys;
update the pattern that sets f to match vllm: with optional leading whitespace
(e.g. /^[[:space:]]*vllm:/) so the block is entered regardless of indentation,
keep the subsequent match for model: and the gsub extraction logic (refer to
resolve_vllm_model and the awk invocation) so the extracted model comes from the
blueprint when present instead of falling back to VLLM_DEFAULT_MODEL.
- Around line 877-883: The installer currently attempts to bootstrap pip3 with
apt-get but proceeds to call pip3 regardless, which can cause a cryptic "pip3:
command not found" error; update the vLLM install branch (the block that checks
python3 -c "import vllm" and calls command_exists pip3) to re-check for pip3
after the apt-get attempt (using the same command_exists pip3) and if pip3 is
still missing call info/error and exit non‑zero with a clear message; reference
the existing symbols/steps: the python3 import check, command_exists, the
apt-get install line, and the pip3 install commands so the check and explicit
failure are added between the apt-get bootstrap and the pip3 install invocation.

---

Nitpick comments:
In `@test/local-inference-setup.test.ts`:
- Around line 41-52: The test currently re-parses INSTALL_SH with regex instead
of invoking resolve_vllm_model(), so replace the regex-based install.sh parsing
in the "vLLM default model id matches the blueprint" test with a call to
resolve_vllm_model() to get the resolved model id and then assert that equals
the blueprintModel (which you still extract from BLUEPRINT); specifically,
import or source the module exposing resolve_vllm_model(), call
resolve_vllm_model() to obtain installModel, and keep the existing blueprint
parsing (blueprintMatch/blueprintModel) and the
expect(installModel).toBe(blueprintModel) assertion.
🪄 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: 0c02a5fc-88e5-472e-98c2-c54cfe45d79b

📥 Commits

Reviewing files that changed from the base of the PR and between 29ecb68 and b27c097.

📒 Files selected for processing (2)
  • scripts/install.sh
  • test/local-inference-setup.test.ts

Comment thread scripts/install.sh
Comment on lines +856 to +860
resolve_vllm_model() {
local blueprint="${SCRIPT_DIR}/../nemoclaw-blueprint/blueprint.yaml"
if [ -r "$blueprint" ]; then
awk '/^ vllm:/{f=1; next} f && /model:/{ gsub(/.*model: *"|".*/, ""); print; exit }' \
"$blueprint" 2>/dev/null

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.

⚠️ Potential issue | 🟡 Minor

Relax the vllm: match in resolve_vllm_model().

nemoclaw-blueprint/blueprint.yaml currently exposes vllm: as a root-level key, so this awk never enters the block and silently falls back to VLLM_DEFAULT_MODEL. That means the runtime parser here will ignore the blueprint if the two ever drift.

Suggested fix
 resolve_vllm_model() {
   local blueprint="${SCRIPT_DIR}/../nemoclaw-blueprint/blueprint.yaml"
   if [ -r "$blueprint" ]; then
-    awk '/^      vllm:/{f=1; next} f && /model:/{ gsub(/.*model: *"|".*/, ""); print; exit }' \
+    awk '
+      /^[[:space:]]*vllm:[[:space:]]*$/ { in_vllm=1; next }
+      in_vllm && /^[^[:space:]]/ { exit }
+      in_vllm && match($0, /model:[[:space:]]*"([^"]+)"/, m) { print m[1]; exit }
+    ' \
       "$blueprint" 2>/dev/null
   fi
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
resolve_vllm_model() {
local blueprint="${SCRIPT_DIR}/../nemoclaw-blueprint/blueprint.yaml"
if [ -r "$blueprint" ]; then
awk '/^ vllm:/{f=1; next} f && /model:/{ gsub(/.*model: *"|".*/, ""); print; exit }' \
"$blueprint" 2>/dev/null
resolve_vllm_model() {
local blueprint="${SCRIPT_DIR}/../nemoclaw-blueprint/blueprint.yaml"
if [ -r "$blueprint" ]; then
awk '
/^[[:space:]]*vllm:[[:space:]]*$/ { in_vllm=1; next }
in_vllm && /^[^[:space:]]/ { exit }
in_vllm && match($0, /model:[[:space:]]*"([^"]+)"/, m) { print m[1]; exit }
' \
"$blueprint" 2>/dev/null
fi
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install.sh` around lines 856 - 860, The awk in resolve_vllm_model()
only matches a vllm: with exactly six leading spaces so it misses root-level or
differently-indented keys; update the pattern that sets f to match vllm: with
optional leading whitespace (e.g. /^[[:space:]]*vllm:/) so the block is entered
regardless of indentation, keep the subsequent match for model: and the gsub
extraction logic (refer to resolve_vllm_model and the awk invocation) so the
extracted model comes from the blueprint when present instead of falling back to
VLLM_DEFAULT_MODEL.

Comment thread scripts/install.sh
Comment on lines +877 to +883
if ! python3 -c "import vllm" 2>/dev/null; then
info "Installing vLLM…"
if ! command_exists pip3; then
sudo apt-get install -y -qq python3-pip >/dev/null 2>&1 || true
fi
pip3 install --break-system-packages vllm 2>/dev/null || pip3 install vllm
else

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.

⚠️ Potential issue | 🟡 Minor

Don't swallow a failed python3-pip bootstrap.

If pip3 is missing and the apt-get attempt fails, the next pip3 install ... exits the installer with pip3: command not found. Re-check after the bootstrap attempt and fail with a clear message.

Suggested fix
   if ! python3 -c "import vllm" 2>/dev/null; then
     info "Installing vLLM…"
     if ! command_exists pip3; then
       sudo apt-get install -y -qq python3-pip >/dev/null 2>&1 || true
     fi
+    command_exists pip3 || error "python3-pip is required to install vLLM automatically."
     pip3 install --break-system-packages vllm 2>/dev/null || pip3 install vllm
   else
     info "vLLM already installed"
   fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install.sh` around lines 877 - 883, The installer currently attempts
to bootstrap pip3 with apt-get but proceeds to call pip3 regardless, which can
cause a cryptic "pip3: command not found" error; update the vLLM install branch
(the block that checks python3 -c "import vllm" and calls command_exists pip3)
to re-check for pip3 after the apt-get attempt (using the same command_exists
pip3) and if pip3 is still missing call info/error and exit non‑zero with a
clear message; reference the existing symbols/steps: the python3 import check,
command_exists, the apt-get install line, and the pip3 install commands so the
check and explicit failure are added between the apt-get bootstrap and the pip3
install invocation.

@wscurran wscurran added bug platform: brev Affects Brev hosted development environments dependencies Pull requests that update a dependency file labels Apr 27, 2026
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

Superseded by #2729 — rebased with all commits signed off. Original branch had force-push protection so couldn't update history in place.

@prekshivyas
prekshivyas deleted the fix/996-vllm-hf-model-and-token branch April 30, 2026 02:09
ericksoa pushed a commit that referenced this pull request Apr 30, 2026
## 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

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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: prekshivyas <[email protected]>
Signed-off-by: Prekshi Vyas <[email protected]>
Co-authored-by: Ubuntu <ubuntu@nemoclaw-f6a691-inst-3cs11f3ytmmzubymi5nzdncnwia.us-west1-a.c.brevdevprod.internal>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: J. Yaunches <[email protected]>
Co-authored-by: Carlos Villela <[email protected]>
@wscurran wscurran added area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression chore Build, CI, dependency, or tooling maintenance and removed Provider: HuggingFace chore Build, CI, dependency, or tooling maintenance labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression dependencies Pull requests that update a dependency file platform: brev Affects Brev hosted development environments

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

2 participants