llama.cpp Command Checker

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.

How the check works

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>"

Worked examples

CommandWhat breaksFixed
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)

Flags removed from llama.cpp

Old flagLast seenGone byUse instead
--no-mmapb10438b11057-lm none
--mmapb10438b11057-lm mmap
--mlockb10438b11057-lm mlock
-dio, --direct-iob10438b11057-lm dio
-ndio, --no-direct-iob10438b11057delete it
-dt, --defrag-tholdb12095b12531delete it
-cd, --ctx-size-draftb8638b9839delete it
-cpent, --checkpoint-every-n-tokensb8638b9839delete it
--spec-replaceb8638b9839delete it
--licenseb8638b9839delete it
-hfv, -hfrv, --hf-repo-v, -hffv, --hf-file-v, -mv, --model-vocoderb9839b10438delete it
--tts-oute-defaultb9839b10438delete it
--tts-use-guide-tokensb9839b10438delete it
--embd-bge-small-en-default, --embd-e5-small-en-default, --embd-gte-small-defaultb6365b7497delete 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.

Questions

What does "error: invalid argument: --no-mmap" mean?

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.

Why does llama-cli say "error: invalid argument: -cnv" or "-i"?

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.

Is it --ngl or -ngl?

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".

What is the llama.cpp flag for context shift?

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.

Why does llama.cpp say "error: invalid argument: 1"?

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.

Related