LLAMA-CLI(1)

๐Ÿ“ฆ
version 10438 ยท 2 versions
, in ubuntu stonking

๐Ÿฆ‹ 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 for llama.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. Complements cpu-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. Complements cpu-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 to linear unless specified by the model (env: LLAMA_ARG_ROPE_SCALING_TYPE) ๐Ÿชข
  • --rope-scale N โ€” RoPE context scaling factor, expands context by a factor of N (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 of 1/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: scale sqrt(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 it
    • none: no special loading mode
    • mmap: 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 compressing
    • mmap+mlock: mmap + force system to keep model in RAM rather than swapping or compressing
    • dio: use DirectIO if available
  • --numa TYPE โ€” attempt optimizations that help on some NUMA systems
    • distribute: spread execution evenly over all nodes
    • isolate: only spawn threads on CPUs on the node that execution started on
    • numactl: 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-devices to 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 first N layers 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 only
    • layer (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 (with split-mode = none), or for intermediate results and KV (with split-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 --fit option, 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 scaling SCALE. 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: repo is optional and defaults to ai/. quant is 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. The quant part is optional, it's case-insensitive, and it defaults to Q4_K_M โ€” or, if Q4_K_M isn't a thing in that repo, it just falls back to the first file it finds. mmproj also 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 the HF_TOKEN environment 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 output
    • 1: error
    • 2: warning
    • 3: info
    • 4: 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 -1 means 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 range 0.0 to 1.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 range 0.0 to 0.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+1 to increase the likelihood of the token ' Hello', or --logit-bias 15043-1 to decrease the likelihood of the token ' Hello' ๐ŸŽš๏ธ
  • --grammar GRAMMAR โ€” a BNF-like grammar to constrain generations (peep the samples in the grammars/ 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.py instead ๐Ÿงฉ
  • -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.py instead ๐Ÿงฉ
  • -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-devices to 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-type none,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-max or --spec-ngram-mod-n-max instead (env: LLAMA_ARG_DRAFT_MAX)
  • --draft-min, --draft-n-min N โ€” also removed, gone, deceased ๐Ÿ™ˆ use --spec-draft-n-min or --spec-ngram-mod-n-min instead (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, -1 for no limit, 0 to 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

(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, see tools/mtmd/README.md
    • note: if -hf is used, this argument can be omitted

(env: LLAMA_ARG_MMPROJ)

  • -mmu, --mmproj-url URL โ€” URL to a multimodal projector file, see tools/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 in message.content
    • deepseek โ€” puts thoughts in message.reasoning_content
    • deepseek-legacy โ€” keeps thinking tags in message.content while also populating message.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: -1 for unrestricted, 0 for an immediate end, N>0 for 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 --jinja is 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 --jinja is 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