Skip to content

Use --load-mode when llama-server supports it - #87

Merged
offbyonebit merged 2 commits into
mainfrom
fix/load-mode-flags
Oct 7, 2026
Merged

offbyonebit merged 2 commits into
mainfrom
fix/load-mode-flags

Conversation

@offbyonebit

Copy link
Copy Markdown
Owner

Fixes #86.

Current llama.cpp rejects --no-mmap, --mlock and --mmap (error: invalid argument) in favor of --load-mode {auto,none,mmap,mlock,mmap+mlock,dio}. LaunchRecipe.to_argv hardcoded the old flags, so any recipe with no_mmap or mlock set could not start against a current llama-server.

Change

  • server_caps: detect --load-mode in --help (supports_load_mode); assumed on a failed probe, like the other capabilities.
  • LaunchRecipe.to_argv(load_mode_flag=...): no_mmap -> --load-mode none, mlock -> --load-mode mmap+mlock, both -> --load-mode mlock, neither -> no flag. Binaries without --load-mode keep the legacy flags. extra_flags stay verbatim.
  • launcher.build_plan passes the probed capability.

Checked against real builds

build --load-mode in help flag emitted for no_mmap
b11476 (upstream master) yes --load-mode none
b10380 yes --load-mode none
b9174 no --no-mmap

The generated command line for a full recipe (-fa on --load-mode mlock ...) is accepted by the b11476 llama-server.

Tests

  • 11 new tests: all flag combinations in both styles, help-text detection (with and without -fa), the probe-failure default, and build_plan end to end.
  • Full suite: 1154 passed, 1 skipped. Ruff and mypy are clean.

Not in scope: --no-mmap/--mlock a user puts in extra_flags are still passed through unchanged and will still fail on current builds.

Current llama.cpp rejects --no-mmap, --mlock and --mmap with
"invalid argument"; they were replaced by --load-mode
{auto,none,mmap,mlock,mmap+mlock,dio}. LaunchRecipe.to_argv hardcoded the
old flags, so any recipe with no_mmap or mlock set could not start against
a current llama-server.

Probe --load-mode in `llama-server --help` (supports_load_mode, assumed on
a failed probe like the other capabilities) and translate no_mmap -> none,
mlock -> mmap+mlock, both -> mlock. Binaries without --load-mode keep the
legacy flags. extra_flags stay verbatim.

Checked against real builds: b11476 and b10380 get --load-mode none, b9174
gets --no-mmap.

Fixes #86
Hotfix release: launch with --load-mode on llama.cpp builds that removed --no-mmap/--mlock (#86).
@offbyonebit
offbyonebit merged commit 90d01c3 into main Oct 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launch fails on current llama.cpp: --no-mmap and --mlock are rejected (use --load-mode)

1 participant