<!-- llms-explorer concept facts · https://llms-explorer.com/tree/llama-server-router-subprocess-build-option-subp/ · pack 2026-10-05 · ~1164 tokens -->

# llama-server router subprocess build option (subprocess is not enabled on this b

> `server_models_routes::init_routes()` throws `std::runtime_error("subprocess is not enabled on this build")` when `common_subproc::is_supported()` is false.

Parent: [Mac local LLMs: llama.cpp internals](https://llms-explorer.com/tree/mac-local-llms-llama-cpp-internals/) · 1 facets · 19 facts · page: https://llms-explorer.com/tree/llama-server-router-subprocess-build-option-subp/

## 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](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/tools/server/server-models.cpp)
- `common_subproc::is_supported()` returns true only when `LLAMA_SUBPROCESS` was defined at compile time. — [source](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/common/subproc.cpp)
- `common/subproc.h` includes `<sheredom/subprocess.h>` only under `LLAMA_SUBPROCESS`; otherwise it defines dummy values "to allow compilation when subprocess is disabled". — [source](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/common/subproc.h)
- The header comment states that `create()` always fails when `LLAMA_SUBPROCESS` was not enabled at build time. — [source](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/common/subproc.h)
- 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](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/CMakeLists.txt)
- `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](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/CMakeLists.txt)
- `common/CMakeLists.txt` adds `target_compile_definitions(${TARGET} PUBLIC LLAMA_SUBPROCESS)` when the option is on. — [source](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/common/CMakeLists.txt)
- Ollama's `llama/server/CMakeLists.txt` contains `set(LLAMA_SUBPROCESS OFF CACHE BOOL "" FORCE)`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/llama/server/CMakeLists.txt)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/llama/server/CMakeLists.txt)
- 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](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/.github/workflows/release.yml)
- 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](https://github.com/ggml-org/llama.cpp/pull/26102)
- PR 26102 notes that disabling subprocess also disables `MTMD_VIDEO`, because video needs to spawn ffmpeg. — [source](https://github.com/ggml-org/llama.cpp/pull/26102)
- PR 26102 was opened on 2026-07-24 and merged as commit d2a8182. — [source](https://github.com/ggml-org/llama.cpp/pull/26102)
- 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](https://github.com/ggml-org/llama.cpp/issues/26451)
- 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](https://github.com/ggml-org/llama.cpp/pulls?q=is%3Apr+LLAMA_SUBPROCESS)
- PR 27520 ("mtmd: support webp via ffmpeg") reuses the existing `mtmd_helper_video` ffmpeg path, which depends on subprocess support. — [source](https://github.com/ggml-org/llama.cpp/pull/27520)
- Router child spawn code in `server-models.cpp` uses `subprocess_option_no_window | subprocess_option_combined_stdout_stderr`. — [source](https://raw.githubusercontent.com/ggml-org/llama.cpp/master/tools/server/server-models.cpp)
- Ollama's choice to force the option off means its runner can never start router mode regardless of flags. — source: `asserted`
- 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: `asserted`
