Skip to content

fix(onboard): use 127.0.0.1 instead of localhost for local inference detection#176

Closed
dumko2001 wants to merge 2 commits into
NVIDIA:mainfrom
dumko2001:fix/h6-vllm-localhost-bind
Closed

fix(onboard): use 127.0.0.1 instead of localhost for local inference detection#176
dumko2001 wants to merge 2 commits into
NVIDIA:mainfrom
dumko2001:fix/h6-vllm-localhost-bind

Conversation

@dumko2001

@dumko2001 dumko2001 commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Rationale

Using localhost can sometimes resolve to IPv6 addresses or behave inconsistently across different environments and network configurations.

Changes

Switched to the explicit IPv4 loopback address 127.0.0.1 for local inference service detection to improve reliability.

Verification Results

  • Automated Tests: Passed all 52 core tests via npm test.
  • Manual Audit: Verified connection reliability with 127.0.0.1.
  • Security Review: Verified no sensitive data leaks and correct permission enforcement.

Leading Standards

This PR follows the project's 'First Principles' approach, prioritizing deterministic behavior and zero-trust security defaults.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed detection of local Ollama and vLLM instances to probe the correct loopback address.
    • Updated onboarding UI option labels and console messages to display the accurate local endpoint addresses for local inference providers.

@wscurran wscurran added bug Something fails against expected or documented behavior NemoClaw CLI labels Mar 19, 2026
@wscurran

Copy link
Copy Markdown
Contributor

I've looked at the changes and see that this PR updates the local inference detection to use 127.0.0.1 instead of localhost, which should improve reliability across different environments and network configurations.

@cv

cv commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

Hi @dumko2001! The localhost vs 127.0.0.1 distinction is one of those subtle things that can really bite you. We'd like to consider this — please rebase onto the latest main so we can give it a proper review. A lot has changed upstream.

@dumko2001 dumko2001 force-pushed the fix/h6-vllm-localhost-bind branch from aed6e2a to abc1036 Compare March 21, 2026 21:33
@coderabbitai

coderabbitai Bot commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0a44c887-1c56-424c-bf35-c4b9c1bc7f03

📥 Commits

Reviewing files that changed from the base of the PR and between abc1036 and 9d2653c.

📒 Files selected for processing (5)
  • bin/lib/local-inference.js
  • bin/lib/nim.js
  • bin/lib/onboard.js
  • test/local-inference.test.js
  • test/onboard-selection.test.js
✅ Files skipped from review due to trivial changes (4)
  • bin/lib/nim.js
  • test/local-inference.test.js
  • test/onboard-selection.test.js
  • bin/lib/local-inference.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • bin/lib/onboard.js

📝 Walkthrough

Walkthrough

Switched local inference health-check and probe endpoints from localhost to 127.0.0.1 across onboarding, local-inference, and NIM health-check logic; updated related UI labels, console messages, and tests to match the new loopback address.

Changes

Cohort / File(s) Summary
Onboarding UI & probes
bin/lib/onboard.js
Probe URLs changed from http://localhost:<port> to http://127.0.0.1:<port> for Ollama and vLLM; UI option labels and console messages updated to show 127.0.0.1:<port> instead of localhost:<port>.
Local inference checks & commands
bin/lib/local-inference.js
Health-check curl endpoints, warmup and probe shell commands updated to target http://127.0.0.1:<port> for Ollama and vLLM; error messages adjusted to reference 127.0.0.1. Container reachability checks unchanged.
NIM health checks
bin/lib/nim.js
Health-check calls for NIM models updated to use http://127.0.0.1:${port}/v1/models instead of localhost.
Tests updated to match loopback address
test/local-inference.test.js, test/onboard-selection.test.js
Test expectations and mocked command outputs updated from localhost to 127.0.0.1 for Ollama (11434) and vLLM (8000) probes and warmup/probe commands.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped the network, sniffed the log,
127.0.0.1 — a snug little hog,
Ollama hummed and vLLM replied,
Labels shifted, probes now tried,
A rabbit's cheer for loopback pride! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the primary change: replacing localhost with 127.0.0.1 across local inference detection in onboard, NIM, and local-inference modules.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 (1)
bin/lib/onboard.js (1)

549-556: Unify endpoint wording across the onboarding flow.

Line 549 and Line 556 now show 127.0.0.1, but Line 652, Line 665, and Line 673 still print localhost. Keep these consistent to reduce troubleshooting ambiguity.

♻️ Suggested consistency patch
-      console.log("  ✓ Using Ollama on localhost:11434");
+      console.log("  ✓ Using Ollama on 127.0.0.1:11434");
...
-      console.log("  ✓ Using Ollama on localhost:11434");
+      console.log("  ✓ Using Ollama on 127.0.0.1:11434");
...
-      console.log("  ✓ Using existing vLLM on localhost:8000");
+      console.log("  ✓ Using existing vLLM on 127.0.0.1:8000");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bin/lib/onboard.js` around lines 549 - 556, The onboarding labels use mixed
hostnames ("127.0.0.1" in some labels and "localhost" in others); update the
other label strings to match the chosen canonical form (use "127.0.0.1" per
recent edits) so wording is consistent. Search for the label construction sites
where options are pushed (look for options.push and labels that mention
"localhost") and replace "localhost" with "127.0.0.1", preserving surrounding
text, experimental tags, and the suggested/running suffix logic (refer to the
ollamaRunning, vllmRunning and EXPERIMENTAL usage to ensure behavior and
conditional suffixes remain unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@bin/lib/onboard.js`:
- Around line 549-556: The onboarding labels use mixed hostnames ("127.0.0.1" in
some labels and "localhost" in others); update the other label strings to match
the chosen canonical form (use "127.0.0.1" per recent edits) so wording is
consistent. Search for the label construction sites where options are pushed
(look for options.push and labels that mention "localhost") and replace
"localhost" with "127.0.0.1", preserving surrounding text, experimental tags,
and the suggested/running suffix logic (refer to the ollamaRunning, vllmRunning
and EXPERIMENTAL usage to ensure behavior and conditional suffixes remain
unchanged).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce39aac5-cf17-4f4c-884d-5f93628e4341

📥 Commits

Reviewing files that changed from the base of the PR and between 255e606 and abc1036.

📒 Files selected for processing (1)
  • bin/lib/onboard.js

@chandler-barlow chandler-barlow self-assigned this Mar 25, 2026
mafueee pushed a commit to mafueee/NemoClaw that referenced this pull request Mar 28, 2026

@brandonpelfrey brandonpelfrey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the cleanup here. I found one blocking issue:

  1. NIM path/tests are now inconsistent with the stated rationale
    This PR changes local host probes from localhost to 127.0.0.1 in bin/lib/nim.js, but the accompanying tests for that module were not updated and still assert http://localhost:... in test/nim.test.js. More importantly, this means we are now applying the IPv4-only change to NIM health checks too, even though the PR description is specifically about local inference detection for Ollama/vLLM onboarding.

    Please either:

    • update test/nim.test.js and clarify in the PR description that NIM health/status probes are intentionally being changed too, or
    • revert the bin/lib/nim.js changes and keep this PR scoped to the onboarding/local-inference paths only.

    As-is, the patch looks partially applied/internally inconsistent.

@chandler-barlow

Copy link
Copy Markdown
Contributor

addressing the comments here

@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: install Install, setup, prerequisites, or uninstall flow area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression and removed priority: high bug Something fails against expected or documented behavior labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: install Install, setup, prerequisites, or uninstall flow area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants