Skip to content

Conversation

@aldehir
Copy link
Collaborator

@aldehir aldehir commented Dec 9, 2025

When passing in --host 0.0.0.0, the child runs on host 0.0.0.0 and the router tries to access it at 0.0.0.0. I can't think of why the child should not always run on 127.0.0.1.

get_free_port() binds to INADDR_ANY, which should select a port that is available across all interfaces. This can be changed to INADDR_LOOPBACK if we ensure the child will only ever bind to 127.0.0.1. If not, then INADDR_ANY is a safe choice.

fixes #17862

}

// set model args
add_or_replace_arg(child_args, "--host", inst.meta.hostname);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we know the host is always 127.0.0.1, I think it's easier to just hard code it here:

Suggested change
add_or_replace_arg(child_args, "--host", inst.meta.hostname);
add_or_replace_arg(child_args, "--host", "127.0.0.1");

So that the change will be migrated easier on #17859

@ngxson
Copy link
Collaborator

ngxson commented Dec 9, 2025

I re-implement this change on #17859 via this commit 78565ed , so probably we don't need this fix anymore - I'll close this PR if the other can be merged today or tmr

Comment on lines -574 to +578
base_params.hostname,
meta->hostname,
Copy link
Collaborator Author

@aldehir aldehir Dec 9, 2025

Choose a reason for hiding this comment

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

@ngxson I believe this is still an issue. The router tries to proxy to 0.0.0.0:{child-port} and does not work, at least on windows.

I haven't had the time to update the PR to hardcode it, but I can later or you can apply it in the other PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah right, I pushed another fix in bf2d94c

@aldehir aldehir closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: Starting llama-server.exe with --host 0.0.0.0 results in server not working, ok if only running over 127.0.0.1, for --models-dir feature.

3 participants