Answers for LLM inference engineers

"error: invalid argument" in llama.cpp: which build removed each llama-server and llama-cli option

error: invalid argument: --name means that the binary you ran has no such option in that build: it was removed, renamed, or it belongs to another llama.cpp tool. As of b12981 (2026-12-04), 50 option names that llama.cpp accepted at some point since b3716 are gone, 8 more only answer "the argument has been removed", and 22 still exist but llama-cli no longer takes them. Common cases: --mlock, --mmap, --no-mmap and --direct-io were removed in b10875 (2026-09-09) in favor of --load-mode; --defrag-thold was removed in b12347 (2026-11-12) and needs no replacement; -cnv and -no-cnv left llama-cli in b10584 (2026-08-22) and live on in llama-completion.

Published 2026-11-17 · Data as of 2026-12-04 · llama.cpp b3716 to b12981, every one of the 397 commits that changed the option table · read from source, nothing was run

Corrected on 2026-12-05: this page said llama-completion accepts 264 names; it accepts 251 in b12981. Options that common/arg.cpp registers with .set_examples(mmproj_examples), a list defined by name at the top of the file, were read as registered for every binary. They are only for the binaries in that list: llama-completion never accepted --mmproj, -mm, --mmproj-url, --mmproj-offload, --mmproj-device, --image-min-tokens, --video-fps and the others of that group, --no-mmproj or --mmproj-auto (the page had said it did until b9802); llama-cli accepted --mmproj, --mmproj-url, --no-mmproj and --no-mmproj-offload only from b7348; llama-server only from b5331. Checked with the official release binaries: llama-server b5330 rejects --mmproj and b5331 accepts it; in b12997 llama-completion rejects it and llama-cli accepts it.

Which build removed my option?

Paste the command line, or the error. Each option is checked against the newest build for the binary in the text. Add your build number, or your Ollama release, to see whether your own build has it.

llama-server --version prints the build number: version: 10091 (commit) on older builds, version: ... (build 12465, commit ...) on current ones. The lookup runs in your browser on the data of this page; an Ollama release is translated to its bundled build with the table of the GGUF lookup. A name written with underscores after two dashes (--ctx_size) is read as --ctx-size, as llama.cpp itself does.

Which options were removed, and what replaces them?

50 names in 19 builds, newest first. From the build in the first column on, the name ends with error: invalid argument. The third column is the commit that deleted it. Where llama.cpp printed a deprecation warning before the removal, its text is quoted, because it names the replacement.

Removed inNamesCommitInstead
b12347 (2026-11-12)--defrag-thold -dtllama : prune (#30565)DEPRECATED: --defrag-thold is deprecated and no longer necessary to specify
b10875 (2026-09-09)-dio --direct-io --mlock --mmap -ndio --no-direct-io --no-mmapargs: officially deprecate --mmap|mlock|dio (#28334)Use --load-mode (-lm): mlock, mmap, mmap+mlock, none or dio. DEPRECATED: --direct-io and --no-direct-io are deprecated. use --load-mode dio instead DEPRECATED: --mlock is deprecated. use --load-mode mlock instead DEPRECATED: --mmap and --no-mmap are deprecated. use --load-mode mmap instead
b10700 (2026-08-30)--tensor-read-lazycommon: rename --tensor-read-lazy to --lazy-mode, add -lzm shorthand (#27969)Use --lazy-mode (-lzm).
b10270 (2026-08-04)--hf-file-v --hf-repo-v -hffv -hfrv -hfv --model-vocoder -mv --tts-oute-default --tts-use-guide-tokensmtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254)
b9405 (2026-05-29)--licenseapp : move licences to llama-app (#23824)
b9310 (2026-05-25)--checkpoint-every-n-tokens -cpentserver: fix checkpoints creation (#22929)
b9109 (2026-05-11)-cd --ctx-size-draft --spec-draft-ctx-size --spec-draft-replace --spec-replacespec : parallel drafting support (#22838)
b8989 (2026-04-30)--spec--draft-p-splitspec: fix argument typo (#22552)
b8852 (2026-04-20)--clear-idle --no-clear-idleserver: rename --clear-idle to --cache-idle-slots (#21741)Use --cache-idle-slots.
b7981 (2026-02-09)--spec-ngram-check-ratespec : remove check rate (#19377)
b6741 (2025-10-12)--embd-bge-small-en-default --embd-e5-small-en-default --embd-gte-small-defaultcommon : update presets (#16504)
b5435 (2025-05-20)-dkvc --dump-kv-cachellama : remove llama_kv_cache_view API + remove deprecated (#13653)
b5311 (2025-05-08)--all-logits --perplexitycontext : remove logits_all flag (#13284)
b4337 (2024-12-16)--penalize-nlsampling : refactor + optimize penalties sampler (#10803)
b4160 (2024-11-25)--p-split -psspeculative : refactor and add a simpler example (#10362)
b4103 (2024-11-16)-ld --logdirllama/ex: remove --logdir argument (#10339)
b3988 (2024-10-29)--tfsllama : remove Tail-Free sampling (#10071)
b3911 (2024-10-12)-spfserver : remove legacy system_prompt feature (#9857)
b3761 (2024-09-15)--log-append --log-enable --log-format --log-new --log-testcommon : reimplement logging (#9418)

Still accepted but spelled wrong is the other common case: --ngl is not an option; the names are -ngl, --gpu-layers and --n-gpu-layers. The lookup suggests the closest current names.

Which options answer "the argument has been removed"?

8 names are still registered since b8955 (2026-04-28) only to stop with a message that names the replacement. The error reads error while handling argument "--draft-max": the argument has been removed. use ....

NamesStub sinceMessage
--draft --draft-max --draft-nb8955 (2026-04-28)the argument has been removed. use --spec-draft-n-max or --spec-ngram-mod-n-max
--draft-min --draft-n-minb8955 (2026-04-28)the argument has been removed. use --spec-draft-n-min or --spec-ngram-mod-n-min
--spec-ngram-min-hitsb8955 (2026-04-28)the argument has been removed. use the respective --spec-ngram-*-min-hits
--spec-ngram-size-mb8955 (2026-04-28)the argument has been removed. use the respective --spec-ngram-*-size-m
--spec-ngram-size-nb8955 (2026-04-28)the argument has been removed. use the respective --spec-ngram-*-size-n or --spec-ngram-mod-n-match

Which options exist, but not for my binary?

Every option is registered for a set of tools, and a tool rejects the others with the same invalid argument error. In b12981, 553 names exist; llama-server takes 417 of them, llama-cli 344 and llama-completion 251. The largest change was b7348 (2025-12-10): llama-cli became a new chat program (commit "cli: new CLI experience", #17824) and the program it replaced continues as llama-completion. 16 names left llama-cli in that build, and all of them still work in llama-completion.

No longer accepted by llama-cli (22 names that still exist)

Namesllama-cli stopped taking it inAccepted in b12981 by
-cnv --conversation -no-cnv --no-conversationb10584 (2026-08-22)llama-completion
--kv-unified -kvub7433 (2025-12-16)llama-server
-gan -gaw --grp-attn-n --grp-attn-w -i -if --in-prefix --in-prefix-bos --in-suffix --interactive --interactive-first --print-token-count --prompt-cache --prompt-cache-all --prompt-cache-ro -ptcb7348 (2025-12-10)llama-completion

No longer accepted by llama-server (12 names that still exist)

Namesllama-server stopped taking it inAccepted in b12981 by
--verbose-promptb8555 (2026-03-27)llama-cli, llama-completion
-bf --binary-file -f --file -p --promptb4443 (2025-01-08)llama-cli, llama-completion
--system-prompt-fileb3911 (2024-10-12)llama-cli, llama-completion
-gan -gaw --grp-attn-n --grp-attn-wb3911 (2024-10-12)llama-completion

The reverse also happens: --embd-normalize existed for the embedding example long before llama-server accepted it in b9193 (2026-05-17).

What happens to removed LLAMA_ARG_ environment variables?

Nothing, and that is the trap: llama.cpp reads only the variables of options it still has, so a removed variable is ignored without an error or a warning. 38 variables stopped being read this way. Two are different: LLAMA_ARG_DRAFT_MAX and LLAMA_ARG_DRAFT_MIN still belong to stub options, so since b8955 (2026-04-28) setting them stops startup with error while handling environment variable. From b7376 (2025-12-12), an option that has a negated form also reads LLAMA_ARG_NO_... next to its LLAMA_ARG_... variable.

VariableBelonged toIgnored fromCommit
LLAMA_ARG_DEFRAG_THOLD--defrag-tholdb12347 (2026-11-12)llama : prune (#30565)
LLAMA_ARG_DIO--direct-iob10875 (2026-09-09)args: officially deprecate --mmap|mlock|dio (#28334)
LLAMA_ARG_MLOCK--mlockb10875 (2026-09-09)args: officially deprecate --mmap|mlock|dio (#28334)
LLAMA_ARG_MMAP--mmapb10875 (2026-09-09)args: officially deprecate --mmap|mlock|dio (#28334)
LLAMA_ARG_NO_DIO--direct-iob10875 (2026-09-09)args: officially deprecate --mmap|mlock|dio (#28334)
LLAMA_ARG_NO_MMAP--mmapb10875 (2026-09-09)args: officially deprecate --mmap|mlock|dio (#28334)
LLAMA_ARG_TENSOR_READ_LAZY--tensor-read-lazyb10700 (2026-08-30)common: rename --tensor-read-lazy to --lazy-mode, add -lzm shorthand (#27969)
LLAMA_ARG_HF_FILE_V--hf-file-vb10270 (2026-08-04)mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254)
LLAMA_ARG_HF_REPO_V--hf-repo-vb10270 (2026-08-04)mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254)
LLAMA_ARG_NO_WEBUI--webuib9726 (2026-06-19)server: add --agent arg, remove redundant webui naming compat (#24801)
LLAMA_ARG_NO_WEBUI_MCP_PROXY--webui-mcp-proxyb9726 (2026-06-19)server: add --agent arg, remove redundant webui naming compat (#24801)
LLAMA_ARG_WEBUI--webuib9726 (2026-06-19)server: add --agent arg, remove redundant webui naming compat (#24801)
LLAMA_ARG_WEBUI_CONFIG--webui-configb9726 (2026-06-19)server: add --agent arg, remove redundant webui naming compat (#24801)
LLAMA_ARG_WEBUI_CONFIG_FILE--webui-config-fileb9726 (2026-06-19)server: add --agent arg, remove redundant webui naming compat (#24801)
LLAMA_ARG_WEBUI_MCP_PROXY--webui-mcp-proxyb9726 (2026-06-19)server: add --agent arg, remove redundant webui naming compat (#24801)
LLAMA_CHAT_TEMPLATE_KWARGS--chat-template-kwargsb9360 (2026-05-27)common : fix env names to all have LLAMA_ARG_ prefix (#23778)
LLAMA_LOG_COLORS--log-colorsb9360 (2026-05-27)common : fix env names to all have LLAMA_ARG_ prefix (#23778)
LLAMA_LOG_FILE--log-fileb9360 (2026-05-27)common : fix env names to all have LLAMA_ARG_ prefix (#23778)
LLAMA_LOG_VERBOSITY--log-verbosityb9360 (2026-05-27)common : fix env names to all have LLAMA_ARG_ prefix (#23778)
LLAMA_OFFLINE--offlineb9360 (2026-05-27)common : fix env names to all have LLAMA_ARG_ prefix (#23778)
LLAMA_ARG_CHECKPOINT_EVERY_NT--checkpoint-every-n-tokensb9310 (2026-05-25)server: fix checkpoints creation (#22929)
LLAMA_LOG_PREFIX--log-prefixb9151 (2026-05-14)logs : reduce (#23021)
LLAMA_LOG_TIMESTAMPS--log-timestampsb9151 (2026-05-14)logs : reduce (#23021)
LLAMA_ARG_SPEC_DRAFT_CTX_SIZE--ctx-size-draftb9109 (2026-05-11)spec : parallel drafting support (#22838)
LLAMA_ARG_CACHE_TYPE_K_DRAFT--cache-type-k-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_CACHE_TYPE_V_DRAFT--cache-type-v-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_CPU_MOE_DRAFT--cpu-moe-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_CTX_SIZE_DRAFT--ctx-size-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_DRAFT_P_MIN--draft-p-minb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_DRAFT_P_SPLIT--draft-p-splitb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_HFD_REPO--hf-repo-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_MODEL_DRAFT--model-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_N_CPU_MOE_DRAFT--n-cpu-moe-draftb8955 (2026-04-28)spec : refactor params (#22397)
LLAMA_ARG_CLEAR_IDLE--clear-idleb8852 (2026-04-20)server: rename --clear-idle to --cache-idle-slots (#21741)
LLAMA_ARG_NO_CLEAR_IDLE--clear-idleb8852 (2026-04-20)server: rename --clear-idle to --cache-idle-slots (#21741)
LLAMA_ARG_NO_MMPROJ--no-mmprojb7376 (2025-12-12)common: support negated args (#17919)
LLAMA_ARG_KV_SPLIT-kvub7204 (2025-11-30)common: update env var name (#17588)
LLAMA_ARG_SWA_CHECKPOINTS--swa-checkpointsb6685 (2025-10-03)server : context checkpointing for hybrid and recurrent models (#16382)

Before b3716: "error: unknown argument"

Builds before b3716 (2024-09-09) parsed options by hand and said error: unknown argument: NAME; the option table and the wording invalid argument start with that build. For the older period this page read the parser at one build in about every 250, from b1046 on, so the ranges are coarse: a name was still there in the first build of the row and gone by the second. 24 names from that period did not make it into the table.

NamesLast seen inGone by
--cfg-negative-prompt --cfg-negative-prompt-file --cfg-scale --infillb3500 (2024-08-01)b3716 (2024-09-09)
--lora-baseb3250 (2024-06-27)b3500 (2024-08-01)
--chatml -cml --ctx_size -ins --instruct --interactive-specials --no-special --random-prompt --slots-endpoint-disableb3001 (2024-05-26)b3250 (2024-06-27)
--no-penalize-nlb2501 (2024-03-22)b2750 (2024-04-27)
--no-mul-mat-q -nommq --p-accept -pab2251 (2024-02-23)b2501 (2024-03-22)
--memory-f32 --memory_f32b1500 (2023-11-09)b1750 (2024-01-02)
--export --low-vramb1250 (2023-09-16)b1500 (2023-11-09)
--mtestb1046 (2023-08-24)b1250 (2023-09-16)

Ollama: "llama-server process has terminated ... invalid argument"

Ollama starts a bundled llama-server with options it chooses, so this error means the server binary and the Ollama program are from different releases. Up to v0.32.5, Ollama's llm/llama_server.go passes --no-mmap and the release bundles llama.cpp b10091. From v0.32.6 it passes --load-mode and bundles b10242; --load-mode exists from b10105 (2026-07-23). invalid argument: --load-mode therefore comes from a llama-server older than b10105 started by an Ollama of v0.32.6 or newer. Reinstall so that both come from one release. The build inside every Ollama release is listed in the GGUF lookup.

How was this built?

What this page does not cover

The same data as JSON: data.json, licensed CC BY 4.0.

Questions

What does "error: invalid argument: --mlock" mean in llama.cpp?
The llama-server or llama-cli you ran does not have that option. --mlock, --mmap, --no-mmap and --direct-io were removed in build b10875 (2026-09-09). Use --load-mode instead: --load-mode mlock, mmap, mmap+mlock, none or dio. --load-mode exists from b10105 (2026-07-23).
Why does llama-cli say invalid argument for -cnv or -no-cnv?
llama-cli was replaced by a new chat program in build b7348 (2025-12-10), and -cnv / -no-cnv left it in b10584 (2026-08-22). The previous program is still built as llama-completion, which accepts both.
Is --defrag-thold still needed?
No. Its last warning said it is "deprecated and no longer necessary to specify", and build b12347 (2026-11-12) removed it. Delete it from the command line.
What happens to a removed LLAMA_ARG_ environment variable?
Nothing: llama.cpp reads only the variables of options it still has, so a removed one is ignored without an error or a warning. The exceptions are LLAMA_ARG_DRAFT_MAX and LLAMA_ARG_DRAFT_MIN, which stop startup since b8955 (2026-04-28) with "the argument has been removed".
Why does Ollama say "llama-server process has terminated ... invalid argument: --load-mode"?
The llama-server that Ollama started is older than b10105, the first build with --load-mode. Ollama passes --load-mode from v0.32.6, which bundles llama.cpp b10242; v0.32.5 passes --no-mmap and bundles b10091. The program and the bundled server are from different installs: reinstall Ollama so that both come from one release.
What is the difference between "invalid argument" and "unknown argument"?
The wording. Builds before b3716 (2024-09-09) parsed options by hand and printed "error: unknown argument: NAME"; from that build the options live in one table (common/arg.cpp) and the message is "error: invalid argument: NAME".

Related: "unknown model architecture": the llama.cpp build and Ollama release each GGUF needs · vLLM and SGLang: removed arguments and settings that silently stop working · Why a model does not stop generating: stop tokens by engine.

Sources