LLAMA-CLI(1)
๐ฆ LLAMA-CLI(1) ๐ฆ
okay bestie, welcome to the User Commands section, this is the manual for llama-cli ๐
โจ NAME โจ
llama-cli โ literally llama-cli, that's it, that's the name ๐
๐ธ DESCRIPTION ๐ธ
okay so here's the whole vibe. this is the main character of command-line LLM stuff and there are a LOT of knobs you can turn. buckle up.
๐ ----- common params ----- ๐
-h,--help,--usageโ prints the usage and then dips out, exit stage left ๐ซถ--versionโ shows the version and build info, so you know exactly which flavor of iconic you're running ๐-cl,--cache-listโ shows the list of models hanging out in your cache ๐ง--completion-bashโ prints a source-able bash completion script forllama.cpp, so your tab key can be as smart as you ๐-t,--threads Nโ number of CPU threads to use during generation (default:<num_cpus>) (env:LLAMA_ARG_THREADS) ๐ฅ-tb,--threads-batch Nโ number of threads to use during batch and prompt processing (default: same as--threads) โจ-C,--cpu-mask Mโ CPU affinity mask: arbitrarily long hex. Complementscpu-range(default:"") ๐-Cr,--cpu-range lo-hiโ range of CPUs for affinity. Complements--cpu-mask๐--cpu-strict <0|1>โ use strict CPU placement (default:0) ๐ธ--prio Nโ set process/thread priority : low(-1), normal(0), medium(1), high(2), realtime(3) (default:0) ๐--poll <0...100>โ use polling level to wait for work (0- no polling, default:50) ๐ฆ-Cb,--cpu-mask-batch Mโ CPU affinity mask: arbitrarily long hex. Complementscpu-range-batch(default: same as--cpu-mask) ๐-Crb,--cpu-range-batch lo-hiโ ranges of CPUs for affinity. Complements--cpu-mask-batch๐--cpu-strict-batch <0|1>โ use strict CPU placement (default: same as--cpu-strict) โญ--prio-batch Nโ set process/thread priority :0-normal,1-medium,2-high,3-realtime (default:0) ๐--poll-batch <0|1>โ use polling to wait for work (default: same as--poll) ๐-c,--ctx-size Nโ size of the prompt context (default:0,0= loaded from model) (env:LLAMA_ARG_CTX_SIZE) ๐ง-n,--predict,--n-predict Nโ number of tokens to predict (default:-1,-1= infinity) (env:LLAMA_ARG_N_PREDICT) ๐ฅ-b,--batch-size Nโ logical maximum batch size (default:2048) (env:LLAMA_ARG_BATCH) โจ-ub,--ubatch-size Nโ physical maximum batch size (default:512) (env:LLAMA_ARG_UBATCH) ๐--keep Nโ number of tokens to keep from the initial prompt (default:0,-1= all) ๐--swa-fullโ use full-size SWA cache (default:false) [(more info)](https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055) (env:LLAMA_ARG_SWA_FULL) ๐ธ-fa,--flash-attn [on|off|auto]โ set Flash Attention use ('on','off', or'auto', default:'auto') (env:LLAMA_ARG_FLASH_ATTN) โก-p,--prompt PROMPTโ prompt to start generation with; for system message, use-sys๐ฌ--perf,--no-perfโ whether to enable internal libllama performance timings (default:false) (env:LLAMA_ARG_PERF) ๐-f,--file FNAMEโ a file containing the prompt (default: none) ๐-bf,--binary-file FNAMEโ binary file containing the prompt (default: none) ๐งฌ-e,--escape,--no-escapeโ whether to process escapes sequences (\n,\r,\t,\',\",\\) (default:true) ๐ช--rope-scaling {none,linear,yarn}โ RoPE frequency scaling method, defaults tolinearunless specified by the model (env:LLAMA_ARG_ROPE_SCALING_TYPE) ๐ชข--rope-scale Nโ RoPE context scaling factor, expands context by a factor ofN(env:LLAMA_ARG_ROPE_SCALE) ๐--rope-freq-base Nโ RoPE base frequency, used by NTK-aware scaling (default: loaded from model) (env:LLAMA_ARG_ROPE_FREQ_BASE) ๐๏ธ--rope-freq-scale Nโ RoPE frequency scaling factor, expands context by a factor of1/N(env:LLAMA_ARG_ROPE_FREQ_SCALE) ๐๏ธ--yarn-orig-ctx Nโ YaRN: original context size of model (default:0= model training context size) (env:LLAMA_ARG_YARN_ORIG_CTX) ๐งถ--yarn-ext-factor Nโ YaRN: extrapolation mix factor (default:-1.00,0.0= full interpolation) (env:LLAMA_ARG_YARN_EXT_FACTOR) ๐งต--yarn-attn-factor Nโ YaRN: scalesqrt(t)or attention magnitude (default:-1.00) (env:LLAMA_ARG_YARN_ATTN_FACTOR) ๐--yarn-beta-slow Nโ YaRN: high correction dim or alpha (default:-1.00) (env:LLAMA_ARG_YARN_BETA_SLOW) ๐ข--yarn-beta-fast Nโ YaRN: low correction dim or beta (default:-1.00) (env:LLAMA_ARG_YARN_BETA_FAST) ๐-kvo,--kv-offload,-nkvo,--no-kv-offloadโ whether to enable KV cache offloading (default: enabled) (env:LLAMA_ARG_KV_OFFLOAD) ๐ฆ--repack,-nr,--no-repackโ whether to enable weight repacking (default: enabled) (env:LLAMA_ARG_REPACK) ๐--no-hostโ bypass host buffer allowing extra buffers to be used (env:LLAMA_ARG_NO_HOST) ๐-ctk,--cache-type-k TYPEโ KV cache data type for K. allowed values:f32,f16,bf16,q8_0,q4_0,q4_1,iq4_nl,q5_0,q5_1(default:f16) (env:LLAMA_ARG_CACHE_TYPE_K) ๐-ctv,--cache-type-v TYPEโ KV cache data type for V. allowed values:f32,f16,bf16,q8_0,q4_0,q4_1,iq4_nl,q5_0,q5_1(default:f16) (env:LLAMA_ARG_CACHE_TYPE_V) ๐-dt,--defrag-thold Nโ KV cache defragmentation threshold (DEPRECATED) (env:LLAMA_ARG_DEFRAG_THOLD) ๐-np,--parallel Nโ number of parallel sequences to decode (default:1) (env:LLAMA_ARG_N_PARALLEL) ๐ง--mlockโ DEPRECATED in favor of--load-mode: force system to keep model in RAM rather than swapping or compressing (env:LLAMA_ARG_MLOCK) ๐ซ
ngl bestie if you're still using the deprecated ones, it's giving legacy behavior. swap to --load-mode, iykyk.
--mmap,--no-mmapโ DEPRECATED in favor of--load-mode: whether to memory-map model. (if mmap disabled, slower load but may reduce pageouts if not using mlock) (env:LLAMA_ARG_MMAP) โ ๏ธ-dio,--direct-io,-ndio,--no-direct-ioโ DEPRECATED in favor of--load-mode: use DirectIO if available (env:LLAMA_ARG_DIO) โ ๏ธ-lm,--load-mode MODEโ model loading mode (default:auto) (env:LLAMA_ARG_LOAD_MODE) ๐auto: mmap, unless a device does not support itnone: no special loading modemmap: memory-map model (if mmap disabled, slower load but may reduce pageouts if not using mlock)mlock: force system to keep model in RAM rather than swapping or compressingmmap+mlock: mmap + force system to keep model in RAM rather than swapping or compressingdio: use DirectIO if available
--numa TYPEโ attempt optimizations that help on some NUMA systemsdistribute: spread execution evenly over all nodesisolate: only spawn threads on CPUs on the node that execution started onnumactl: use the CPU map provided by numactl
if run without this previously, it is recommended to drop the system page cache before using this โ see https://github.com/ggml-org/llama.cpp/issues/1437 (env: LLAMA_ARG_NUMA) ๐บ๏ธ
-dev,--device <dev1,dev2,..>โ comma-separated list of devices to use for offloading (none= don't offload). use--list-devicesto see a list of available devices (env:LLAMA_ARG_DEVICE) ๐ฅ๏ธ--list-devicesโ print list of available devices and exit ๐-ot,--override-tensor <tensor name pattern>=<buffer type>,...โ override tensor buffer type (env:LLAMA_ARG_OVERRIDE_TENSOR) ๐งฉ-cmoe,--cpu-moeโ keep all Mixture of Experts (MoE) weights in the CPU (env:LLAMA_ARG_CPU_MOE) ๐ง-ncmoe,--n-cpu-moe Nโ keep the Mixture of Experts (MoE) weights of the firstNlayers in the CPU (env:LLAMA_ARG_N_CPU_MOE) ๐ง-ngl,--gpu-layers,--n-gpu-layers Nโ max. number of layers to store in VRAM, either an exact number,'auto', or'all'(default:auto) (env:LLAMA_ARG_N_GPU_LAYERS) ๐ฎ-sm,--split-mode {none,layer,row,tensor}โ how to split the model across multiple GPUs, one of: (env:LLAMA_ARG_SPLIT_MODE) ๐ฐnone: use one GPU onlylayer(default): split layers and KV across GPUs (pipelined)row: split weight across GPUs by rows (parallelized)tensor: split weights and KV across GPUs (parallelized, EXPERIMENTAL)
-ts,--tensor-split N0,N1,N2,...โ fraction of the model to offload to each GPU, comma-separated list of proportions, e.g.3,1(env:LLAMA_ARG_TENSOR_SPLIT) โ๏ธ-mg,--main-gpu INDEXโ the GPU to use for the model (withsplit-mode = none), or for intermediate results and KV (withsplit-mode = row) (default:0) (env:LLAMA_ARG_MAIN_GPU) ๐-fit,--fit [on|off]โ whether to adjust unset arguments to fit in device memory ('on'or'off', default:'on') (env:LLAMA_ARG_FIT) ๐-fitt,--fit-target MiB0,MiB1,MiB2,...โ target margin per device for--fit, comma-separated list of values, single value is broadcast across all devices, default:1024(env:LLAMA_ARG_FIT_TARGET) ๐ฏ-fitc,--fit-ctx Nโ minimum ctx size that can be set by--fitoption, default:4096(env:LLAMA_ARG_FIT_CTX) ๐--check-tensorsโ check model tensor data for invalid values (default:false) ๐--override-kv KEY=TYPE:VALUE,...โ advanced option to override model metadata by key. to specify multiple overrides, either use comma-separated values. types:int,float,bool,str. example:--override-kv tokenizer.ggml.add_bos_token=bool:false,tokenizer.ggml.add_eos_token=bool:false๐ ๏ธ--op-offload,--no-op-offloadโ whether to offload host tensor operations to device (default:true) ๐--lora FNAMEโ path to LoRA adapter (use comma-separated values to load multiple adapters) ๐--lora-scaled FNAME:SCALE,...โ path to LoRA adapter with user defined scaling (format:FNAME:SCALE,...) note: use comma-separated values ๐--control-vector FNAMEโ add a control vector. note: use comma-separated values to add multiple control vectors ๐๏ธ--control-vector-scaled FNAME:SCALE,...โ add a control vector with user defined scalingSCALE. note: use comma-separated values (format:FNAME:SCALE,...) ๐๏ธ--control-vector-layer-range START ENDโ layer range to apply the control vector(s) to, start and end inclusive ๐-m,--model FNAMEโ model path to load (env:LLAMA_ARG_MODEL) ๐๏ธ-mu,--model-url MODEL_URLโ model download url (default: unused) (env:LLAMA_ARG_MODEL_URL) ๐-dr,--docker-repo [<repo>/]<model>[:quant]โ ๐ณ- Docker Hub model repo โ okay so the Docker Hub model repository thing:
repois optional and defaults toai/.quantis optional too and defaults to:latest. example:gemma3. (default: unused) (env:LLAMA_ARG_DOCKER_REPO) ๐ณ -hf,-hfr,--hf-repo<user>/<model>[:quant]โ bestie this is THE move for grabbing stuff off Hugging Face. Thequantpart is optional, it's case-insensitive, and it defaults toQ4_K_Mโ or, ifQ4_K_Misn't a thing in that repo, it just falls back to the first file it finds.mmprojalso gets downloaded automatically if it's available (if you do NOT want that, add--no-mmproj). example:ggml-org/GLM-4.7-Flash-GGUF:Q4_K_M(default: unused) (env:LLAMA_ARG_HF_REPO) ๐-hff,--hf-file FILEโ a specific Hugging Face model file. If you set this, it overrides the quant you gave in--hf-repo. (default: unused) (env:LLAMA_ARG_HF_FILE) โจ-hft,--hf-token TOKENโ your Hugging Face access token. (default: the value from theHF_TOKENenvironment variable) (env:HF_TOKEN) ๐--log-disableโ Log disable. that's it, that's the whole vibe, no logs for you ๐--log-file FNAMEโ logs go to a file instead. (env:LLAMA_ARG_LOG_FILE) ๐--log-colors [on|off|auto]โ turn on the pretty colors in the logs ('on','off', or'auto', default:'auto').'auto'means colors show up when the output is a terminal. (env:LLAMA_ARG_LOG_COLORS) ๐-v,--verbose,--log-verboseโ cranks the verbosity level all the way to infinity, i.e. it logs literally every message. super useful for debugging. ๐--offlineโ offline mode, no cap: it forces use of the cache and blocks all network access. (env:LLAMA_ARG_OFFLINE) ๐ซ๐-lv,--verbosity,--log-verbosity Nโ sets the verbosity threshold. any message with a higher verbosity than your threshold gets ignored, periodt. values:0: generic output1: error2: warning3: info4: trace (more info)5: debug
(default: 1) (env: LLAMA_ARG_LOG_VERBOSITY) ๐
--log-prefix,--no-log-prefixโ enable a prefix in log messages. (env:LLAMA_ARG_LOG_PREFIX) ๐ท๏ธ--log-timestamps,--no-log-timestampsโ enable timestamps in log messages. (env:LLAMA_ARG_LOG_TIMESTAMPS) โฐ--spec-draft-type-k,-ctkd,--cache-type-k-draft TYPEโ KV cache data type for K, but for the draft model. allowed values:f32,f16,bf16,q8_0,q4_0,q4_1,iq4_nl,q5_0,q5_1(default:f16) (env:LLAMA_ARG_SPEC_DRAFT_CACHE_TYPE_K) ๐พ--spec-draft-type-v,-ctvd,--cache-type-v-draft TYPEโ KV cache data type for V, again for the draft model. allowed values:f32,f16,bf16,q8_0,q4_0,q4_1,iq4_nl,q5_0,q5_1(default:f16) (env:LLAMA_ARG_SPEC_DRAFT_CACHE_TYPE_V) ๐พ
๐ฒ ----- sampling params ----- ๐
this is where you decide how unhinged (or not) the model gets to be. main character territory fr.
--samplers SAMPLERSโ the samplers that will be used for generation, in order, separated by;(default:penalties;dry;top_n_sigma;top_k;typ_p;top_p;min_p;xtc;temperature) ๐ฐ-s,--seed SEEDโ RNG seed (default:-1, and-1means use a random seed) ๐ฒ--sampler-seq,--sampling-seq SEQUENCEโ a simplified sequence for the samplers that will be used (default:edskypmxt) ๐ค--ignore-eosโ ignore the end of stream token and just keep generating forever (implies--logit-bias EOS-inf). it will NOT stop, she does not know how to stop ๐ญ--temp,--temperature Nโ temperature (default:0.80) ๐ก๏ธ--top-k Nโ top-k sampling (default:40,0= disabled) (env:LLAMA_ARG_TOP_K) ๐ฏ--top-p Nโ top-p sampling (default:0.95,1.0= disabled) ๐ฏ--min-p Nโ min-p sampling (default:0.05,0.0= disabled) ๐ฏ--top-nsigma,--top-n-sigma Nโ top-n-sigma sampling (default:-1.00,-1.0= disabled) ๐ฏ--xtc-probability Nโ xtc probability (default:0.00,0.0= disabled) ๐ช๏ธ--xtc-threshold Nโ xtc threshold (default:0.10,1.0= disabled) ๐ช๏ธ--typical,--typical-p Nโ locally typical sampling, parameter p (default:1.00,1.0= disabled) โจ--repeat-last-n Nโ the last n tokens to consider for penalizing (default:64,0= disabled) ๐--repeat-penalty Nโ penalize repeat sequences of tokens (default:1.00,1.0= disabled) ๐--presence-penalty Nโ repeat alpha presence penalty (default:0.00,0.0= disabled) ๐--frequency-penalty Nโ repeat alpha frequency penalty (default:0.00,0.0= disabled) ๐--dry-multiplier Nโ sets the DRY sampling multiplier (default:0.00,0.0= disabled) ๐๏ธ--dry-base Nโ sets the DRY sampling base value (default:1.75) ๐๏ธ--dry-allowed-length Nโ sets the allowed length for DRY sampling (default:2) ๐๏ธ--dry-penalty-last-n Nโ sets the DRY penalty for the last n tokens (default:64,0= disable) ๐๏ธ--dry-sequence-breaker STRINGโ adds a sequence breaker for DRY sampling, and in the process it clears out the default breakers ('\n',':','"','*'); use"none"if you don't want any sequence breakers at all ๐ฅ--adaptive-target Nโ adaptive-p: selects tokens near this probability (valid range0.0to1.0; negative = disabled) (default:-1.00) (more info:https://github.com/ggml-org/llama.cpp/pull/17927) ๐ง--adaptive-decay Nโ adaptive-p: the decay rate for target adaptation over time. lower values are more reactive, higher values are more stable. (valid range0.0to0.99) (default:0.90) ๐ง--dynatemp-range Nโ dynamic temperature range (default:0.00,0.0= disabled) ๐ก๏ธ--dynatemp-exp Nโ dynamic temperature exponent (default:1.00) ๐ก๏ธ--mirostat Nโ uses Mirostat sampling. real talk: Top K, Nucleus and Locally Typical samplers get ignored if you use this. (default:0,0= disabled,1= Mirostat,2= Mirostat 2.0) ๐--mirostat-lr Nโ Mirostat learning rate, parameter eta (default:0.10) ๐--mirostat-ent Nโ Mirostat target entropy, parameter tau (default:5.00) ๐-l,--logit-bias TOKEN_ID(+/-)BIASโ modifies the likelihood of a token showing up in the completion, i.e.--logit-bias 15043+1to increase the likelihood of the token' Hello', or--logit-bias 15043-1to decrease the likelihood of the token' Hello'๐๏ธ--grammar GRAMMARโ a BNF-like grammar to constrain generations (peep the samples in thegrammars/dir) ๐--grammar-file FNAMEโ the file to read the grammar from ๐-j,--json-schema SCHEMAโ a JSON schema to constrain generations (https://json-schema.org/), e.g.{}for any JSON object. for schemas with external$refs, use--grammar+example/json_schema_to_grammar.pyinstead ๐งฉ-jf,--json-schema-file FILEโ a file containing a JSON schema to constrain generations (https://json-schema.org/), e.g.{}for any JSON object. for schemas with external$refs, use--grammar+example/json_schema_to_grammar.pyinstead ๐งฉ-bs,--backend-samplingโ enable backend sampling (experimental) (default: disabled) (env:LLAMA_ARG_BACKEND_SAMPLING) ๐งช
๐ฆ ----- speculative params ----- ๐ฅ
speculative decoding: the draft model & draft model's draft model. it's giving "get a little guy to guess ahead so the big guy looks fast". obsessed honestly.
--spec-draft-hf,-hfd,-hfrd,--hf-repo-draft<user>/<model>[:quant]โ same as--hf-repo, but for the draft model (default: unused) (env:LLAMA_ARG_SPEC_DRAFT_HF_REPO) ๐--spec-draft-threads,-td,--threads-draft Nโ number of threads to use during generation (default: same as--threads) ๐งต--spec-draft-threads-batch,-tbd,--threads-batch-draft Nโ number of threads to use during batch and prompt processing (default: same as--spec-draft-threads) ๐งต--spec-draft-cpu-mask,-Cd,--cpu-mask-draft Mโ draft model CPU affinity mask. complements cpu-range-draft (default: same as--cpu-mask) ๐ญ--spec-draft-cpu-range,-Crd,--cpu-range-draft lo-hiโ ranges of CPUs for affinity. complements--cpu-mask-draft๐ญ--spec-draft-cpu-strict,--cpu-strict-draft <0|1>โ use strict CPU placement for the draft model (default: same as--cpu-strict) ๐--spec-draft-prio,--prio-draft Nโ set the draft process/thread priority:0-normal,1-medium,2-high,3-realtime (default:0) โก--spec-draft-poll,--poll-draft <0|1>โ use polling to wait for draft model work (default: same as--poll) ๐--spec-draft-cpu-mask-batch,-Cbd,--cpu-mask-batch-draft Mโ draft model CPU affinity mask. complements cpu-range-draft (default: same as--cpu-mask) ๐ญ--spec-draft-cpu-strict-batch,--cpu-strict-batch-draft <0|1>โ use strict CPU placement for the draft model (default:--cpu-strict-draft) ๐--spec-draft-prio-batch,--prio-batch-draft Nโ set the draft process/thread priority:0-normal,1-medium,2-high,3-realtime (default:0) โก--spec-draft-poll-batch,--poll-batch-draft <0|1>โ use polling to wait for draft model work (default:--poll-draft) ๐--spec-draft-override-tensor,-otd,--override-tensor-draft<tensor name pattern>=<buffer type>,...โ override the tensor buffer type for the draft model ๐งฑ--spec-draft-cpu-moe,-cmoed,--cpu-moe-draftโ keep all Mixture of Experts (MoE) weights in the CPU for the draft model (env:LLAMA_ARG_SPEC_DRAFT_CPU_MOE) ๐ง--spec-draft-n-cpu-moe,--spec-draft-ncmoe,-ncmoed,--n-cpu-moe-draft Nโ keep the Mixture of Experts (MoE) weights of the first N layers in the CPU for the draft model (env:LLAMA_ARG_SPEC_DRAFT_N_CPU_MOE) ๐ง--spec-draft-n-max Nโ number of tokens to draft for speculative decoding (default:3) (env:LLAMA_ARG_SPEC_DRAFT_N_MAX) โ๏ธ--spec-draft-n-min Nโ minimum number of draft tokens to use for speculative decoding (default:0) (env:LLAMA_ARG_SPEC_DRAFT_N_MIN) โ๏ธ--spec-draft-p-split,--draft-p-split Pโ speculative decoding split probability (default:0.10) (env:LLAMA_ARG_SPEC_DRAFT_P_SPLIT) โ๏ธ--spec-draft-p-min,--draft-p-min Pโ minimum speculative decoding probability (greedy) (default:0.00) (env:LLAMA_ARG_SPEC_DRAFT_P_MIN) โ๏ธ--spec-draft-backend-sampling,--no-spec-draft-backend-samplingโ offload draft sampling to the backend (default: enabled) (env:LLAMA_ARG_SPEC_DRAFT_BACKEND_SAMPLING) ๐--spec-draft-device,-devd,--device-draft<dev1,dev2,..>โ comma-separated list of devices to use for offloading the draft model (none= don't offload). use--list-devicesto see a list of available devices ๐ฅ๏ธ--spec-draft-ngl,-ngld,--gpu-layers-draft,--n-gpu-layers-draft Nโ max. number of draft model layers to store in VRAM, either an exact number,'auto', or'all'(default:auto) (env:LLAMA_ARG_N_GPU_LAYERS_DRAFT) ๐ฎ--spec-draft-model,-md,--model-draft FNAMEโ draft model for speculative decoding (default: unused) (env:LLAMA_ARG_SPEC_DRAFT_MODEL) ๐--spec-typenone,draft-simple,draft-eagle3,draft-mtp,draft-dflash,draft-dspark,ngram-simple,ngram-map-k,ngram-map-k4v,ngram-mod,ngram-cacheโ comma-separated list of types of speculative decoding to use (default:none) (env:LLAMA_ARG_SPEC_TYPE) ๐
okay bestie we are DEEP in the options now, and this next little cluster is all speculative decoding for ngrams โ it's giving extremely specific, but stay with me because it slaps โจ
--spec-ngram-mod-n-min Nโ the minimum number of ngram tokens to use for ngram-based speculative decoding (default:48)--spec-ngram-mod-n-max Nโ the maximum number of ngram tokens to use for ngram-based speculative decoding (default:64)--spec-ngram-mod-n-match Nโ the ngram-mod lookup length (default:24)--spec-ngram-simple-size-n Nโ ngram size N for ngram-simple speculative decoding, aka the length of the lookup n-gram (default:12)--spec-ngram-simple-size-m Nโ ngram size M for ngram-simple speculative decoding, aka the length of the draft m-gram (default:48)--spec-ngram-simple-min-hits Nโ minimum hits for ngram-simple speculative decoding (default:1)--spec-ngram-map-k-size-n Nโ ngram size N for ngram-map-k speculative decoding, aka the length of the lookup n-gram (default:12)--spec-ngram-map-k-size-m Nโ ngram size M for ngram-map-k speculative decoding, aka the length of the draft m-gram (default:48)--spec-ngram-map-k-min-hits Nโ minimum hits for ngram-map-k speculative decoding (default:1)--spec-ngram-map-k4v-size-n Nโ ngram size N for ngram-map-k4v speculative decoding, aka the length of the lookup n-gram (default:12)--spec-ngram-map-k4v-size-m Nโ ngram size M for ngram-map-k4v speculative decoding, aka the length of the draft m-gram (default:48)--spec-ngram-map-k4v-min-hits Nโ minimum hits for ngram-map-k4v speculative decoding (default:1)--draft,--draft-n,--draft-max Nโ bestie this argument has been REMOVED ๐ use--spec-draft-n-maxor--spec-ngram-mod-n-maxinstead (env:LLAMA_ARG_DRAFT_MAX)--draft-min,--draft-n-min Nโ also removed, gone, deceased ๐ use--spec-draft-n-minor--spec-ngram-mod-n-mininstead (env:LLAMA_ARG_DRAFT_MIN)
----- ๐ธ example-specific params ----- ๐ธ
--server-base URLโ connect to this server instead of starting a whole new one, example:'http://localhost:8080'(default: none)--verbose-promptโ print a verbose prompt before generation (default:false)--display-prompt,--no-display-promptโ whether to print the prompt at generation time (default:true)-co,--color [on|off|auto]โ colorize the output so you can tell the prompt and your input apart from what the model generates. it's one of'on','off'or'auto'(default:'auto'), and'auto'switches on colors when output is going to a terminal ๐-ctxcp,--ctx-checkpoints,--swa-checkpoints Nโ max number of context checkpoints to create per slot (default:32) (more info:https://github.com/ggml-org/llama.cpp/pull/15293) (env:LLAMA_ARG_CTX_CHECKPOINTS)-cram,--cache-ram Nโ set the maximum cache size in MiB (default:8192,-1for no limit,0to disable) (more info:https://github.com/ggml-org/llama.cpp/pull/16391) (env:LLAMA_ARG_CACHE_RAM)--context-shift,--no-context-shiftโ whether to use context shift on infinite text generation (default: disabled) (env:LLAMA_ARG_CONTEXT_SHIFT)-sys,--system-prompt PROMPTโ the system prompt to use with the model (if applicable, depends on the chat template, iykyk)--show-timings,--no-show-timingsโ whether to show timing info after each response (default:true) (env:LLAMA_ARG_SHOW_TIMINGS)-sysf,--system-prompt-file FNAMEโ a file containing the system prompt (default: none)-r,--reverse-prompt PROMPTโ halt generation at PROMPT and hand control back to you in interactive mode-sp,--specialโ special tokens output enabled (default:false)-cnv,--conversation,-no-cnv,--no-conversationโ whether to run in conversation mode:- it does not print special tokens nor suffix/prefix
- interactive mode is also enabled
(default: auto enabled if a chat template is available)
-st,--single-turnโ run the conversation for a single turn only, then exit when done- it will not be interactive if the first turn is predefined with
--prompt
- it will not be interactive if the first turn is predefined with
(default: false)
-mli,--multiline-inputโ lets you write or paste multiple lines without having to end each one with'\'๐ซถ--warmup,--no-warmupโ whether to perform warmup with an empty run (default: enabled)-mm,--mmproj FILEโ path to a multimodal projector file, seetools/mtmd/README.md- note: if
-hfis used, this argument can be omitted
- note: if
(env: LLAMA_ARG_MMPROJ)
-mmu,--mmproj-url URLโ URL to a multimodal projector file, seetools/mtmd/README.md(env:LLAMA_ARG_MMPROJ_URL)--mmproj-auto,--no-mmproj,--no-mmproj-autoโ whether to use a multimodal projector file (if one's available), which is very handy when you're using-hf(default: enabled) (env:LLAMA_ARG_MMPROJ_AUTO)--mmproj-offload,--no-mmproj-offloadโ whether to enable GPU offloading for the multimodal projector (default: enabled) (env:LLAMA_ARG_MMPROJ_OFFLOAD)--image,--audio,--video FILEโ path to an image, audio or video file. use it with multimodal models, and comma-separated values if you've got multiple files ๐--image-min-tokens Nโ minimum number of tokens each image can take, only used by vision models with dynamic resolution (default: read from model) (env:LLAMA_ARG_IMAGE_MIN_TOKENS)--image-max-tokens Nโ maximum number of tokens each image can take, only used by vision models with dynamic resolution (default: read from model) (env:LLAMA_ARG_IMAGE_MAX_TOKENS)-o,--output,--output-file FNAMEโ output file (default:'')--chat-template-kwargs STRINGโ sets extra params for the json template parser, and it must be a valid json object string, e.g.'{"key1":"value1","key2":"value2"}'(env:LLAMA_ARG_CHAT_TEMPLATE_KWARGS)--jinja,--no-jinjaโ whether to use the jinja template engine for chat (default: enabled) (env:LLAMA_ARG_JINJA)--reasoning-format FORMATโ controls whether thought tags are allowed and/or extracted from the response, and in which format they get returned. pick one of:noneโ leaves thoughts unparsed inmessage.contentdeepseekโ puts thoughts inmessage.reasoning_contentdeepseek-legacyโ keepsthinkingtags inmessage.contentwhile also populatingmessage.reasoning_content
(default: auto) (env: LLAMA_ARG_THINK)
-rea,--reasoning [on|off|auto]โ use reasoning/thinking in the chat, one of'on','off'or'auto'(default:'auto', meaning detect it from the template) (env:LLAMA_ARG_REASONING)--reasoning-effort LEVELโ the reasoning effort level handed to the chat template:'default'to keep the template's own default, or a level like'minimal','low','medium','high','xhigh'or'max'(default:default) (env:LLAMA_ARG_REASONING_EFFORT)--reasoning-budget Nโ token budget for thinking:-1for unrestricted,0for an immediate end,N>0for a token budget (default:-1) (env:LLAMA_ARG_THINK_BUDGET)--reasoning-budget-message MESSAGEโ message injected before the end-of-thinking tag when the reasoning budget runs out (default: none) (env:LLAMA_ARG_THINK_BUDGET_MESSAGE)--reasoning-preserve,--no-reasoning-preserveโ preserve the reasoning trace in the full history, not just in the last assistant message (default: template default). compatible with certain templates that have the'supports_preserve_reasoning'capability. example:https://docs.z.ai/guides/capabilities/thinking-mode#preserved-thinking(env:LLAMA_ARG_REASONING_PRESERVE)--chat-template JINJA_TEMPLATEโ set a custom jinja chat template (default: the template taken from the model's metadata). if suffix/prefix are specified, the template gets disabled. only commonly used templates are accepted (unless--jinjais set before this flag) โ the built-in templates are:bailing,bailing-think,bailing2,chatglm3,chatglm4,chatml,command-r,deepseek,deepseek-ocr,deepseek2,deepseek3,exaone-moe,exaone3,exaone4,falcon3,gemma,gigachat,glmedge,gpt-oss,granite,granite-4.0,granite-4.1,grok-2,hunyuan-dense,hunyuan-moe,hunyuan-vl,kimi-k2,llama2,llama2-sys,llama2-sys-bos,llama2-sys-strip,llama3,llama4,megrez,minicpm,mistral-v1,mistral-v3,mistral-v3-tekken,mistral-v7,mistral-v7-tekken,monarch,openchat,orion,pangu-embedded,phi3,phi4,rwkv-world,seed_oss,smolvlm,solar-open,vicuna,vicuna-orca,yandex,zephyr(env:LLAMA_ARG_CHAT_TEMPLATE)--chat-template-file JINJA_TEMPLATE_FILEโ set a custom jinja chat template file (default: the template taken from the model's metadata). if suffix/prefix are specified, the template gets disabled. only commonly used templates are accepted (unless--jinjais set before this flag) โ the built-in templates are:bailing,bailing-think,bailing2,chatglm3,chatglm4,chatml,command-r,deepseek,deepseek-ocr,deepseek2,deepseek3,exaone-moe,exaone3,exaone4,falcon3,gemma,gigachat,glmedge,gpt-oss,granite,granite-4.0,granite-4.1,grok-2,hunyuan-dense,hunyuan-moe,hunyuan-vl,kimi-k2,llama2,llama2-sys,llama2-sys-bos,llama2-sys-strip,llama3,llama4,megrez,minicpm,mistral-v1,mistral-v3,mistral-v3-tekken,mistral-v7,mistral-v7-tekken,monarch,openchat,orion,pangu-embedded,phi3,phi4,rwkv-world,seed_oss,smolvlm,solar-open,vicuna,vicuna-orca,yandex,zephyr(env:LLAMA_ARG_CHAT_TEMPLATE_FILE)--skip-chat-parsing,--no-skip-chat-parsingโ force a pure content parser, even if a Jinja template is specified; the model will output everything in the content section, including any reasoning and/or tool calls (default: disabled) (env:LLAMA_ARG_SKIP_CHAT_PARSING)--simple-ioโ use basic IO for better compatibility in subprocesses and limited consoles ๐ง--log-prompts-dir PATHโ log prompts to a directory (auto-created if it's not there; only for debugging, default: disabled)--gpt-oss-20b-defaultโ use gpt-oss-20b (note: it can download weights from the internet)--gpt-oss-120b-defaultโ use gpt-oss-120b (note: it can download weights from the internet)--vision-gemma-4b-defaultโ use Gemma 3 4B QAT (note: it can download weights from the internet)--vision-gemma-12b-defaultโ use Gemma 3 12B QAT (note: it can download weights from the internet)--spec-defaultโ enable the default speculative decoding config โจ
and that's a wrap on the whole page bestie, you ate ๐
this one ships out of the debian build, dated September 2026, and it's the LLAMA-CLI(1) manual โ go forth and fr fr slay ๐ซถ๐
๐ฆ where this page comes from
- ubuntu stonking: llama.cpp-tools 10438+dfsg-1ubuntu1 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms