Skip to content

Conversation

@ngxson
Copy link
Collaborator

@ngxson ngxson commented Dec 16, 2025

In case the router listen on a specific address other than 127.0.0.1, the child process will fail to report its status back to the router

This change complete replace this reporting mechanism to using pipe (stdout) instead.

@aldehir
Copy link
Collaborator

aldehir commented Dec 17, 2025

I can confirm this works for Windows as well.

@wbtek
Copy link

wbtek commented Dec 17, 2025

I tested this PR with the following conditions:
Tool: llama-server
Local system: Gentoo Linux on Intel, CPU only
Model: gemma-3-270m-it-UD-Q8_K_XL.gguf (very tiny)
Interface: WebUI

Tested different values of --host for these results:

  1. WebUI loads
  2. Model loads
  3. Model responds to query

Tested those abilities by attempting to connect on:

  1. 127.0.0.1
  2. 192.168.xx.yy locally
  3. 192.168.xx.yy externally

Results:
--host 0.0.0.0
Passed all tests on all interfaces

--host 127.0.0.1
Passed all tests on 127.0.0.1 only (as expected)

--host 192.168.xx.yy
Passed all tests on 192.168.xx.yy only, both internally and externally (as expected)

Thanks @ngxson for all your great work! :)

Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

This mechanism using stdout to communicate is a bit strange - not sure if it has any drawbacks.

I saw there were some issues with the old approach. Didn't get in the details. But assuming this fixes the problem, lets give it a try.

}

std::thread server_models::setup_child_server(const common_params & base_params, int router_port, const std::string & name, std::function<void(int)> & shutdown_handler) {
std::thread server_models::setup_child_server(std::function<void(int)> & shutdown_handler) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
std::thread server_models::setup_child_server(std::function<void(int)> & shutdown_handler) {
std::thread server_models::setup_child_server(const std::function<void(int)> & shutdown_handler) {

#include <chrono>
#include <queue>
#include <filesystem>
#include <string.h>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#include <string.h>
#include <cstring>

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.

4 participants