Skip to content

Feature request: "autoload" model in router mode #18035

Description

@elfarolab

Name and Version

Build version 7389

built on Jetson AGX Orin dev kit

Tegra release:

R36 (release), REVISION: 4.7, GCID: 42132812, BOARD: generic, EABI: aarch64, DATE: Thu Sep 18 22:54:44 UTC 2025

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"

Operating systems

Linux

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

llama-server

Command line

/opt/llama.cpp/bin/llama-server --models-dir /opt/llama-models --models-autoload --models-max 0 --models-preset /opt/llama.cpp/etc/models.ini --host 127.0.0.1 --port 8087 --threads-http 4 --parallel 2 --no-webui --flash-attn on

Problem description & steps to reproduce

I am trying to run llama-server with router feature enabled but the models are not autoloaded by default.
Using the integrated webui, if selecting the model to load, the model indeed get loaded, it is working fine.
I am not using the integrated webui, instead, I am developing a custom client.

Despite using configuration options of server:
--models-dir /opt/llama-models
--models-autoload
--models-max 0
--models-preset /opt/llama.cpp/etc/models.ini

models are not autoloaded.
Documentation says they should be autoloaded by default.

My models.ini is like this:

"""
version = 1

[Qwen3VL-8B-Instruct-Q8_0]
c = 65536
threads = 8
jinja = true
n-gpu-layers = 99
flash-attn = on
temp = 0.7
top-p = 0.8
top-k = 20
min-p = 0.0
presence-penalty = 1.5
batch-size = 2048
ubatch-size = 2048

[bartowski_nvidia_NVIDIA-Nemotron-Nano-12B-v2-GGUF_nvidia_NVIDIA-Nemotron-Nano-12B-v2-Q6_K]
temp = 0.7
top-p = 0.8
top-k = 20
min-p = 0.0
presence-penalty = 1.5
batch-size = 2048
ubatch-size = 2048
"""

In server.cpp at LOC 189 there is:
"""
//
// Start the server
//

std::function<void()> clean_up;

if (is_router_server) {
    LOG_INF("%s: starting router server, no model will be loaded in this process\n", __func__);

"""

it looks like the behaviour of not automatically loading the available models is hardcoded into the source.
So, do I am missing anything or maybe I've got it totally wrong?
Is this option: --models-autoload supposed to auload (by default) the models?

Thank you so much to everybody, great work!

First Bad Commit

No response

Relevant log output

Dec 14 17:02:54 xyz llama-server[2487]: Full command:
Dec 14 17:02:54 xyz llama-server[2487]: /opt/llama.cpp/bin/llama-server --models-dir /opt/llama-models --models-autoload --models-max 0 --models-preset /opt/llama.cpp/etc/models.ini --host 127.0.0.1 --port 8087 --threads-http 4 --parallel 2 --no-webui --flash-attn on
Dec 14 17:02:54 xyz llama-server[2487]: ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
Dec 14 17:02:54 xyz llama-server[2487]: ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: yes
Dec 14 17:02:54 xyz llama-server[2487]: ggml_cuda_init: found 1 CUDA devices:
Dec 14 17:02:54 xyz llama-server[2487]:   Device 0: Orin, compute capability 8.7, VMM: yes
Dec 14 17:02:54 xyz llama-server[2487]: build: 7389 (c00ff929d) with GNU 11.4.0 for Linux aarch64
Dec 14 17:02:54 xyz llama-server[2487]: system info: n_threads = 12, n_threads_batch = 12, total_threads = 12
Dec 14 17:02:54 xyz llama-server[2487]: system_info: n_threads = 12 (n_threads_batch = 12) / 12 | CUDA : ARCHS = 870 | FORCE_CUBLAS = 1 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | FA_ALL_QUANTS = 1 | CPU : NEON = 1 | ARM_FMA = 1 | FP16_VA = 1 | DOTPROD = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
Dec 14 17:02:54 xyz llama-server[2487]: init: using 4 threads for HTTP server
Dec 14 17:02:54 xyz llama-server[2487]: Web UI is disabled
Dec 14 17:02:54 xyz llama-server[2487]: srv  server_prese: Loaded 3 presets from /opt/llama.cpp/etc/models.ini
Dec 14 17:02:54 xyz llama-server[2487]: srv   load_models: Available models (2) (*: custom preset)
Dec 14 17:02:54 xyz llama-server[2487]: srv   load_models:   * Qwen3VL-8B-Instruct-Q8_0
Dec 14 17:02:54 xyz llama-server[2487]: srv   load_models:   * bartowski_nvidia_NVIDIA-Nemotron-Nano-12B-v2-GGUF_nvidia_NVIDIA-Nemotron-Nano-12B-v2-Q6_K
Dec 14 17:02:54 xyz llama-server[2487]: main: starting router server, no model will be loaded in this process
Dec 14 17:02:54 xyz llama-server[2487]: start: binding port with default address family
Dec 14 17:02:54 xyz llama-server[2487]: main: router server is listening on http://127.0.0.1:8087
Dec 14 17:02:54 xyz llama-server[2487]: main: NOTE: router mode is experimental
Dec 14 17:02:54 xyz llama-server[2487]: main:       it is not recommended to use this mode in untrusted environments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions