"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.
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 in | Names | Commit | Instead |
|---|---|---|---|
| b12347 (2026-11-12) | --defrag-thold -dt | llama : 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-mmap | args: 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-lazy | common: 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-tokens | mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254) | |
| b9405 (2026-05-29) | --license | app : move licences to llama-app (#23824) | |
| b9310 (2026-05-25) | --checkpoint-every-n-tokens -cpent | server: fix checkpoints creation (#22929) | |
| b9109 (2026-05-11) | -cd --ctx-size-draft --spec-draft-ctx-size --spec-draft-replace --spec-replace | spec : parallel drafting support (#22838) | |
| b8989 (2026-04-30) | --spec--draft-p-split | spec: fix argument typo (#22552) | |
| b8852 (2026-04-20) | --clear-idle --no-clear-idle | server: rename --clear-idle to --cache-idle-slots (#21741) | Use --cache-idle-slots. |
| b7981 (2026-02-09) | --spec-ngram-check-rate | spec : remove check rate (#19377) | |
| b6741 (2025-10-12) | --embd-bge-small-en-default --embd-e5-small-en-default --embd-gte-small-default | common : update presets (#16504) | |
| b5435 (2025-05-20) | -dkvc --dump-kv-cache | llama : remove llama_kv_cache_view API + remove deprecated (#13653) | |
| b5311 (2025-05-08) | --all-logits --perplexity | context : remove logits_all flag (#13284) | |
| b4337 (2024-12-16) | --penalize-nl | sampling : refactor + optimize penalties sampler (#10803) | |
| b4160 (2024-11-25) | --p-split -ps | speculative : refactor and add a simpler example (#10362) | |
| b4103 (2024-11-16) | -ld --logdir | llama/ex: remove --logdir argument (#10339) | |
| b3988 (2024-10-29) | --tfs | llama : remove Tail-Free sampling (#10071) | |
| b3911 (2024-10-12) | -spf | server : remove legacy system_prompt feature (#9857) | |
| b3761 (2024-09-15) | --log-append --log-enable --log-format --log-new --log-test | common : 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 ....
| Names | Stub since | Message |
|---|---|---|
--draft --draft-max --draft-n | b8955 (2026-04-28) | the argument has been removed. use --spec-draft-n-max or --spec-ngram-mod-n-max |
--draft-min --draft-n-min | b8955 (2026-04-28) | the argument has been removed. use --spec-draft-n-min or --spec-ngram-mod-n-min |
--spec-ngram-min-hits | b8955 (2026-04-28) | the argument has been removed. use the respective --spec-ngram-*-min-hits |
--spec-ngram-size-m | b8955 (2026-04-28) | the argument has been removed. use the respective --spec-ngram-*-size-m |
--spec-ngram-size-n | b8955 (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)
| Names | llama-cli stopped taking it in | Accepted in b12981 by |
|---|---|---|
-cnv --conversation -no-cnv --no-conversation | b10584 (2026-08-22) | llama-completion |
--kv-unified -kvu | b7433 (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 -ptc | b7348 (2025-12-10) | llama-completion |
No longer accepted by llama-server (12 names that still exist)
| Names | llama-server stopped taking it in | Accepted in b12981 by |
|---|---|---|
--verbose-prompt | b8555 (2026-03-27) | llama-cli, llama-completion |
-bf --binary-file -f --file -p --prompt | b4443 (2025-01-08) | llama-cli, llama-completion |
--system-prompt-file | b3911 (2024-10-12) | llama-cli, llama-completion |
-gan -gaw --grp-attn-n --grp-attn-w | b3911 (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.
| Variable | Belonged to | Ignored from | Commit |
|---|---|---|---|
LLAMA_ARG_DEFRAG_THOLD | --defrag-thold | b12347 (2026-11-12) | llama : prune (#30565) |
LLAMA_ARG_DIO | --direct-io | b10875 (2026-09-09) | args: officially deprecate --mmap|mlock|dio (#28334) |
LLAMA_ARG_MLOCK | --mlock | b10875 (2026-09-09) | args: officially deprecate --mmap|mlock|dio (#28334) |
LLAMA_ARG_MMAP | --mmap | b10875 (2026-09-09) | args: officially deprecate --mmap|mlock|dio (#28334) |
LLAMA_ARG_NO_DIO | --direct-io | b10875 (2026-09-09) | args: officially deprecate --mmap|mlock|dio (#28334) |
LLAMA_ARG_NO_MMAP | --mmap | b10875 (2026-09-09) | args: officially deprecate --mmap|mlock|dio (#28334) |
LLAMA_ARG_TENSOR_READ_LAZY | --tensor-read-lazy | b10700 (2026-08-30) | common: rename --tensor-read-lazy to --lazy-mode, add -lzm shorthand (#27969) |
LLAMA_ARG_HF_FILE_V | --hf-file-v | b10270 (2026-08-04) | mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254) |
LLAMA_ARG_HF_REPO_V | --hf-repo-v | b10270 (2026-08-04) | mtmd: support Qwen3-TTS (note: breaking change to llama-tts binary) (#26254) |
LLAMA_ARG_NO_WEBUI | --webui | b9726 (2026-06-19) | server: add --agent arg, remove redundant webui naming compat (#24801) |
LLAMA_ARG_NO_WEBUI_MCP_PROXY | --webui-mcp-proxy | b9726 (2026-06-19) | server: add --agent arg, remove redundant webui naming compat (#24801) |
LLAMA_ARG_WEBUI | --webui | b9726 (2026-06-19) | server: add --agent arg, remove redundant webui naming compat (#24801) |
LLAMA_ARG_WEBUI_CONFIG | --webui-config | b9726 (2026-06-19) | server: add --agent arg, remove redundant webui naming compat (#24801) |
LLAMA_ARG_WEBUI_CONFIG_FILE | --webui-config-file | b9726 (2026-06-19) | server: add --agent arg, remove redundant webui naming compat (#24801) |
LLAMA_ARG_WEBUI_MCP_PROXY | --webui-mcp-proxy | b9726 (2026-06-19) | server: add --agent arg, remove redundant webui naming compat (#24801) |
LLAMA_CHAT_TEMPLATE_KWARGS | --chat-template-kwargs | b9360 (2026-05-27) | common : fix env names to all have LLAMA_ARG_ prefix (#23778) |
LLAMA_LOG_COLORS | --log-colors | b9360 (2026-05-27) | common : fix env names to all have LLAMA_ARG_ prefix (#23778) |
LLAMA_LOG_FILE | --log-file | b9360 (2026-05-27) | common : fix env names to all have LLAMA_ARG_ prefix (#23778) |
LLAMA_LOG_VERBOSITY | --log-verbosity | b9360 (2026-05-27) | common : fix env names to all have LLAMA_ARG_ prefix (#23778) |
LLAMA_OFFLINE | --offline | b9360 (2026-05-27) | common : fix env names to all have LLAMA_ARG_ prefix (#23778) |
LLAMA_ARG_CHECKPOINT_EVERY_NT | --checkpoint-every-n-tokens | b9310 (2026-05-25) | server: fix checkpoints creation (#22929) |
LLAMA_LOG_PREFIX | --log-prefix | b9151 (2026-05-14) | logs : reduce (#23021) |
LLAMA_LOG_TIMESTAMPS | --log-timestamps | b9151 (2026-05-14) | logs : reduce (#23021) |
LLAMA_ARG_SPEC_DRAFT_CTX_SIZE | --ctx-size-draft | b9109 (2026-05-11) | spec : parallel drafting support (#22838) |
LLAMA_ARG_CACHE_TYPE_K_DRAFT | --cache-type-k-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_CACHE_TYPE_V_DRAFT | --cache-type-v-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_CPU_MOE_DRAFT | --cpu-moe-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_CTX_SIZE_DRAFT | --ctx-size-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_DRAFT_P_MIN | --draft-p-min | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_DRAFT_P_SPLIT | --draft-p-split | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_HFD_REPO | --hf-repo-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_MODEL_DRAFT | --model-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_N_CPU_MOE_DRAFT | --n-cpu-moe-draft | b8955 (2026-04-28) | spec : refactor params (#22397) |
LLAMA_ARG_CLEAR_IDLE | --clear-idle | b8852 (2026-04-20) | server: rename --clear-idle to --cache-idle-slots (#21741) |
LLAMA_ARG_NO_CLEAR_IDLE | --clear-idle | b8852 (2026-04-20) | server: rename --clear-idle to --cache-idle-slots (#21741) |
LLAMA_ARG_NO_MMPROJ | --no-mmproj | b7376 (2025-12-12) | common: support negated args (#17919) |
LLAMA_ARG_KV_SPLIT | -kvu | b7204 (2025-11-30) | common: update env var name (#17588) |
LLAMA_ARG_SWA_CHECKPOINTS | --swa-checkpoints | b6685 (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.
| Names | Last seen in | Gone by |
|---|---|---|
--cfg-negative-prompt --cfg-negative-prompt-file --cfg-scale --infill | b3500 (2024-08-01) | b3716 (2024-09-09) |
--lora-base | b3250 (2024-06-27) | b3500 (2024-08-01) |
--chatml -cml --ctx_size -ins --instruct --interactive-specials --no-special --random-prompt --slots-endpoint-disable | b3001 (2024-05-26) | b3250 (2024-06-27) |
--no-penalize-nl | b2501 (2024-03-22) | b2750 (2024-04-27) |
--no-mul-mat-q -nommq --p-accept -pa | b2251 (2024-02-23) | b2501 (2024-03-22) |
--memory-f32 --memory_f32 | b1500 (2023-11-09) | b1750 (2024-01-02) |
--export --low-vram | b1250 (2023-09-16) | b1500 (2023-11-09) |
--mtest | b1046 (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?
- Options:
common/arg.cppat each of the 397 commits that changed it, from the commit that created it (b3716 (2024-09-09)) to b12981 (2026-12-04). Everyadd_opt(common_arg(...))gives the names, the negated names,set_examples/set_excludes(which tools register it) andset_env. - Builds: each commit is mapped to the first
bNNNNtag that contains it (8,229 tags). Dates are UTC dates of the tagged commit. - Binaries: llama-server parses with
LLAMA_EXAMPLE_SERVER; llama-cli withLLAMA_EXAMPLE_MAINbefore b7348 andLLAMA_EXAMPLE_CLIfrom it; llama-completion withLLAMA_EXAMPLE_COMPLETION. An option withoutset_examples, or taggedLLAMA_EXAMPLE_COMMON, belongs to all three. - Check: a second script searched the file at the build tags themselves for each quoted name, at the build where the data says it appeared or disappeared and at the build before: all 50 removals, the stubs, the removed variables and 60 additions agree.
- Ollama:
llm/llama_server.goat the tags v0.32.5 and v0.32.6, and the bundled build of each release from the GGUF lookup's data.
What this page does not cover
- Nothing was compiled or run. The page says which names the parser registers, not whether an option still has an effect.
- Options that changed meaning or default without changing name are not listed.
- The lookup answers for llama-server, llama-cli and llama-completion. For the other tools that use the same table, the data file lists which tools each option is registered for. llama-bench parses its options itself and is not covered.
- Before b3716 the ranges are coarse, and options that came and went between two of the builds read are missing.
- Forks and wrappers (llama-cpp-python, LM Studio, koboldcpp) have their own option names.
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
- llama.cpp: history of common/arg.cpp; build tags; removal commits linked in the tables
- llama.cpp before the option table:
common/common.cppandexamples/server/server.cppat the builds named above - Ollama: llm/llama_server.go at v0.32.6 and at v0.32.5
- A report of the Ollama error: LangChain forum thread 4320