llama-server router subprocess build option (subprocess is not enabled on this b
Parent: Mac local LLMs: llama.cpp internals · Published reference · snapshot 2026-10-05
↓ Facts as markdownall context files
`server_models_routes::init_routes()` throws `std::runtime_error("subprocess is not enabled on this build")` when `common_subproc::is_supported()` is false.
These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Facts
- `server_models_routes::init_routes()` throws `std::runtime_error("subprocess is not enabled on this build")` when `common_subproc::is_supported()` is false. [source]
- `common_subproc::is_supported()` returns true only when `LLAMA_SUBPROCESS` was defined at compile time. [source]
- `common/subproc.h` includes `<sheredom/subprocess.h>` only under `LLAMA_SUBPROCESS`; otherwise it defines dummy values "to allow compilation when subprocess is disabled". [source]
- The header comment states that `create()` always fails when `LLAMA_SUBPROCESS` was not enabled at build time. [source]
- The top-level CMake option reads `option(LLAMA_SUBPROCESS "llama-common: use subprocess, required by server tools and server router mode" ${LLAMA_SUBPROCESS_DEFAULT})`. [source]
- `LLAMA_SUBPROCESS_DEFAULT` is OFF for iOS, Android and Emscripten and ON otherwise, with the comment that subprocess spawning is not sandbox-friendly on mobile OSes or in WASM. [source]
- `common/CMakeLists.txt` adds `target_compile_definitions(${TARGET} PUBLIC LLAMA_SUBPROCESS)` when the option is on. [source]
- Ollama's `llama/server/CMakeLists.txt` contains `set(LLAMA_SUBPROCESS OFF CACHE BOOL "" FORCE)`. [source]
- The same Ollama file also forces `LLAMA_CURL`, `LLAMA_OPENSSL`, `LLAMA_BUILD_APP`, `LLAMA_BUILD_HTML` and `LLAMA_BUILD_UI` to OFF and `LLAMA_BUILD_SERVER` to ON. [source]
- The upstream `release.yml` macOS jobs call `cmake -B build` with no `LLAMA_SUBPROCESS` argument, so prebuilt upstream macOS binaries inherit the default ON. [source]
- PR 26102 ("common: add `subproc.h` wrapper, disabled on android/ios") says subprocess is disabled on Android and iOS because a sandboxed environment blocks `spawn()`, and also on wasm. [source]
- PR 26102 notes that disabling subprocess also disables `MTMD_VIDEO`, because video needs to spawn ffmpeg. [source]
- PR 26102 was opened on 2026-07-24 and merged as commit d2a8182. [source]
- Issue 26451 reports that since commit d2a8182 the default Linux build fails on glibc older than 2.29 (no `posix_spawn_file_actions_addchdir_np`) and was closed as not planned on 2026-09-19. [source]
- PR 26463 ("cmake : check for LLAMA_SUBPROCESS") was closed on 2026-08-02 and PR 26494 ("cmake: auto-disable LLAMA_SUBPROCESS when posix_spawn_file_actions_ad…") was closed on 2026-08-03; neither is merged. [source]
- PR 27520 ("mtmd: support webp via ffmpeg") reuses the existing `mtmd_helper_video` ffmpeg path, which depends on subprocess support. [source]
- Router child spawn code in `server-models.cpp` uses `subprocess_option_no_window | subprocess_option_combined_stdout_stderr`. [source]
- Ollama's choice to force the option off means its runner can never start router mode regardless of flags. [source]
- To use `--models-max` or `--models-dir` on a Mac, run an upstream or Homebrew `llama-server`, not the binary under Ollama's runner directory. [source]
Children
- No children recorded.