Paste a llama-server, llama-cli or llama-completion command, or just the error: invalid argument line. The checker reads every flag against llama.cpp's own argument table at release b12531 (266 flags for llama-server, 208 for llama-cli, 164 for llama-completion). It names each flag that will stop the program and rewrites the ones it can fix for sure.
for each word after the program name:
flag in b12531 table? no -> removed in an older release? -> the replacement
one dash vs two dashes? -> the right spelling
otherwise -> the 3 closest flags
yes -> does this program take it? no -> which program does
needs a value? -> is the next word a value
-fa, -lm, -lzm, -ctk, -ctv -> is the value allowed
not a flag and not a value -> "error: invalid argument: <word>" --no- form, whether it takes a value, and which programs accept it come from common/arg.cpp in ggml-org/llama.cpp at b12531 (commit e4b620af19), read 2026-11-18. The scope rule is llama.cpp's own: a flag tagged for no program works everywhere, and a flag tagged for some programs works only there (set_examples / set_excludes).error: invalid argument: <word>. In a --long-name, underscores count as dashes. There is no --flag=value form. A repeated flag keeps only its last value, with a warning.-h.| Command | What breaks | Fixed |
|---|---|---|
llama-server -m model.gguf --no-mmap --mlock -ngl 99 | --no-mmap, --mlock | llama-server -m model.gguf -lm mlock -ngl 99 |
llama-server -m model.gguf --ngl 99 --ctx-shift -fa | --ngl, --ctx-shift, -fa | llama-server -m model.gguf -ngl 99 --ctx-shift -fa (and give -fa a value: on, off or auto) |
llama-cli -m model.gguf -cnv -i | -cnv, -i | llama-cli -m model.gguf -cnv -i (then switch to llama-completion) |
| Old flag | Last seen | Gone by | Use instead |
|---|---|---|---|
--no-mmap | b10438 | b11057 | -lm none |
--mmap | b10438 | b11057 | -lm mmap |
--mlock | b10438 | b11057 | -lm mlock |
-dio, --direct-io | b10438 | b11057 | -lm dio |
-ndio, --no-direct-io | b10438 | b11057 | delete it |
-dt, --defrag-thold | b12095 | b12531 | delete it |
-cd, --ctx-size-draft | b8638 | b9839 | delete it |
-cpent, --checkpoint-every-n-tokens | b8638 | b9839 | delete it |
--spec-replace | b8638 | b9839 | delete it |
--license | b8638 | b9839 | delete it |
-hfv, -hfrv, --hf-repo-v, -hffv, --hf-file-v, -mv, --model-vocoder | b9839 | b10438 | delete it |
--tts-oute-default | b9839 | b10438 | delete it |
--tts-use-guide-tokens | b9839 | b10438 | delete it |
--embd-bge-small-en-default, --embd-e5-small-en-default, --embd-gte-small-default | b6365 | b7497 | delete it |
Some removed flags are still in the table on purpose, so llama.cpp can tell you what replaced them: --draft, --draft-n, --draft-max, --draft-min and --draft-n-min stop with "the argument has been removed. use --spec-draft-n-max" (or -min). The checker reports those too.
Your llama.cpp build no longer has the --no-mmap flag. llama.cpp replaced --mmap, --no-mmap, --mlock and --direct-io with one flag, -lm (--load-mode). Release b10438 still accepted --no-mmap with a deprecation warning; by b11057 it was gone. Use -lm none to load without memory-mapping, or -lm mlock to keep the model locked in RAM.
In b12531, -cnv (--conversation) and -i (--interactive) belong only to llama-completion. llama-cli and llama-server reject them. llama-cli is the new chat program; the old prompt-and-exit tool is now llama-completion.
Short names take one dash: -ngl, -ctk, -ctv, -ub, -fa. Long names take two: --n-gpu-layers (or --gpu-layers), --cache-type-k, --ubatch-size, --flash-attn. --ngl, --ctk and --ubatch do not exist, so llama.cpp stops with "error: invalid argument".
It is --context-shift, and --no-context-shift turns it off. --ctx-shift is not a flag. In the source tag it works in llama-server, llama-cli, llama-completion, llama-imatrix and llama-perplexity.
A bare value with no flag in front of it. It happens when the flag before it takes no value (for example --context-shift 1, or --jinja true), or when a line break or quote split a value. llama.cpp also does not read --flag=value; put a space between the flag and the value.