Skip to content

Misc. bug: WebUI load of any model fails on >= b7352 if local host's ip is specified by external interface #17962

Closed

Description

@wbtek

Name and Version

llama-server from tag b7352 and later fail.
llama-server from tag b7351 and earlier work.

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

llama-server

Command line

llama-server --models-dir ~/llama.cpp/models/ --models-max 1 -t 5 -c 0 --jinja --host 192.168.7.246 --port 8032

  or

llama-server --models-preset ~/llama.cpp/models/presets.ini --models-max 1 -t 5 -c 0 --jinja --host 192.168.7.246 --port 8032

  with appropriate presets.ini

Problem description & steps to reproduce

Select any model to load from WebUI.

Works if ip is changed to 127.0.0.1, but I'd like to access it both locally and from other computers.

All models fail including:
(tiny) gemma-3-270m-it-UD-Q8_K_XL.gguf
(huge) Qwen3-Next-80B-A3B-Instruct-Q8_0.gguf

But they all work with 127.0.0.1...

First Bad Commit

b7352

Relevant log output

Both good and bad log:
srv  setup_child_: notifying router server (port=8032) that model foo is ready

b7351 (and before) works, logging:
srv  log_server_r: request: POST /models/status 192.168.7.246

b7352 (and after) fails while trying for 127.0.0.1 instead, logging:
srv  setup_child_: failed to notify router server: Could not establish connection

Those messages come from setup_child_server() in tools/server/server-models.cpp:

    SRV_INF("notifying router server (port=%d) that model %s is ready\n", router_port, name.c_str());
    auto result = cli.send(std::move(req));
    if (result.error() != httplib::Error::Success) {
        auto err_str = httplib::to_string(result.error());
        SRV_ERR("failed to notify router server: %s\n", err_str.c_str());
        exit(1); // force exit
    }

It could be related to this line added near the top of the file:

  #define CHILD_ADDR "127.0.0.1"

which is only used two places:

  1) It seems to overwrite the ip from the commandline (which would do it)
  2) Used in place of base_params.hostname (maybe?)

This is the first time I've looked at the code tho.

Activity

  1. rtpt-erikgeiser commented on Dec 12, 2025

    @rtpt-erikgeiser

    I have encountered the same issue when TLS is enabled (--ssl-key-file key.pem --ssl-cert-file cert.crt --port 443). The startup log indicates that the router server still thinks it is HTTP instead of HTTPS:

    main: router server is listening on http://127.0.0.1:443
    
  2. aldehir commented on Dec 15, 2025

    @aldehir
    Contributor

    @wbtek, should work if you do --host 0.0.0.0. But I understand the desire to specify an external IP.

    The issue here is that the child cannot rely on accessing the router via the external IP. If it's 0.0.0.0, then it can assume the router is reachable at 127.0.0.1. The same cannot be said for 192.168.7.246, since the socket will not bind to 127.0.0.1. A quick fix may be to only change to 127.0.0.1 on --host 0.0.0.0, otherwise use the provided IP. The issue there is that we are now subject to how the OS applies firewall rules. A better fix is likely to open two sockets, one intended for local child-only traffic. Perhaps even better is a named socket (Linux) or named pipe (Windows).

    @rtpt-erikgeiser these are two distinct problems, although they can overlap if you also define an external IP.

    Even if http:// is corrected to https://, there may be an issue with cert validation unless you pass in your CA cert (for locally signed certs). So I think the solution may be the same as above, open a child-only socket with http and only TLS terminate at the edge. Disregard, you could validate against the provided cert.

    @ngxson will have a better understanding of what needs to be done here.

  3. added
    bug
    and removed on Dec 15, 2025
  4. wbtek commented on Dec 15, 2025

    @wbtek
    ContributorAuthor

    Submitted PR to fix external facing ip addr.

  5. self-assigned this
    on Jan 12, 2026
  6. allozaur commented on Feb 23, 2026

    @allozaur
    Contributor

    Fixed with #18110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugserver

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions