Text Generation
Safetensors
NemotronH_Nano_Omni_Reasoning_V3
nvidia
unsloth
nemotron-3
multimodal
conversational
custom_code

思考时有问题

#1
by kkioikk - opened

当输入长上下文时,如10000 + tokens
思考会一直重复输出 "<tool_call>" 不会停止。
llama-server 加载模型当作API,使用codex /hermes agent 调用模型时,如果看到llama-server 日志中看到一直在生成 而不停止时,达到几万tokens 基本上是思考一直在重复输出。

复现方法:llama-server 运行模型,
set "LLAMA_SERVER=E:\download\llama-b9663-bin-win-cuda-13.3-x64\llama-server.exe"
set "MODEL_DIR=G:\models\lmstudio-community\MODELS"
"%LLAMA_SERVER%" --models_dir "%MODEL_DIR%" ^
-ngl all -c 131072 -t 10 --reasoning auto -fa on ^
--batch-size 2048 --ubatch-size 2048 ^
--temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00

输入:
"在长上下文时如128K 显存16G 模型27B 3BIT量化时 怎么设置参数提升PP处理速度 ?"
[
{
"type": "TEXT",
"name": "Pasted",
"content": "E:\download\llama-b9555-bin-win-cuda-13.3-x64>llama-server.exe --help\r\n----- common params -----\r\n\r\n-h, --help, --usage print usage and exit\r\n--version show version and build info\r\n-cl, --cache-list show list of models in cache\r\n--completion-bash print source-able bash completion script for llama.cpp\r\n-t, --threads N number of CPU threads to use during generation (default: -1)\r\n (env: LLAMA_ARG_THREADS)\r\n-tb, --threads-batch N number of threads to use during batch and prompt processing (default:\r\n same as --threads)\r\n-C, --cpu-mask M CPU affinity mask: arbitrarily long hex. Complements cpu-range\r\n (default: "")\r\n-Cr, --cpu-range lo-hi range of CPUs for affinity. Complements --cpu-mask\r\n--cpu-strict <0|1> use strict CPU placement (default: 0)\r\n--prio N set process/thread priority : low(-1), normal(0), medium(1), high(2),\r\n realtime(3) (default: 0)\r\n--poll <0...100> use polling level to wait for work (0 - no polling, default: 50)\r\n-Cb, --cpu-mask-batch M CPU affinity mask: arbitrarily long hex. Complements cpu-range-batch\r\n (default: same as --cpu-mask)\r\n-Crb, --cpu-range-batch lo-hi ranges of CPUs for affinity. Complements --cpu-mask-batch\r\n--cpu-strict-batch <0|1> use strict CPU placement (default: same as --cpu-strict)\r\n--prio-batch N set process/thread priority : 0-normal, 1-medium, 2-high, 3-realtime\r\n (default: 0)\r\n--poll-batch <0|1> use polling to wait for work (default: same as --poll)\r\n-c, --ctx-size N size of the prompt context (default: 0, 0 = loaded from model)\r\n (env: LLAMA_ARG_CTX_SIZE)\r\n-n, --predict, --n-predict N number of tokens to predict (default: -1, -1 = infinity)\r\n (env: LLAMA_ARG_N_PREDICT)\r\n-b, --batch-size N logical maximum batch size (default: 2048)\r\n (env: LLAMA_ARG_BATCH)\r\n-ub, --ubatch-size N physical maximum batch size (default: 512)\r\n (env: LLAMA_ARG_UBATCH)\r\n--keep N number of tokens to keep from the initial prompt (default: 0, -1 =\r\n all)\r\n--swa-full use full-size SWA cache (default: false)\r\n (more\r\n info)\r\n (env: LLAMA_ARG_SWA_FULL)\r\n-fa, --flash-attn [on|off|auto] set Flash Attention use ('on', 'off', or 'auto', default: 'auto')\r\n (env: LLAMA_ARG_FLASH_ATTN)\r\n--perf, --no-perf whether to enable internal libllama performance timings (default:\r\n false)\r\n (env: LLAMA_ARG_PERF)\r\n-e, --escape, --no-escape whether to process escapes sequences (\n, \r, \t, \', \", \\)\r\n (default: true)\r\n--rope-scaling {none,linear,yarn} RoPE frequency scaling method, defaults to linear unless specified by\r\n the model\r\n (env: LLAMA_ARG_ROPE_SCALING_TYPE)\r\n--rope-scale N RoPE context scaling factor, expands context by a factor of N\r\n (env: LLAMA_ARG_ROPE_SCALE)\r\n--rope-freq-base N RoPE base frequency, used by NTK-aware scaling (default: loaded from\r\n model)\r\n (env: LLAMA_ARG_ROPE_FREQ_BASE)\r\n--rope-freq-scale N RoPE frequency scaling factor, expands context by a factor of 1/N\r\n (env: LLAMA_ARG_ROPE_FREQ_SCALE)\r\n--yarn-orig-ctx N YaRN: original context size of model (default: 0 = model training\r\n context size)\r\n (env: LLAMA_ARG_YARN_ORIG_CTX)\r\n--yarn-ext-factor N YaRN: extrapolation mix factor (default: -1.00, 0.0 = full\r\n interpolation)\r\n (env: LLAMA_ARG_YARN_EXT_FACTOR)\r\n--yarn-attn-factor N YaRN: scale sqrt(t) or attention magnitude (default: -1.00)\r\n (env: LLAMA_ARG_YARN_ATTN_FACTOR)\r\n--yarn-beta-slow N YaRN: high correction dim or alpha (default: -1.00)\r\n (env: LLAMA_ARG_YARN_BETA_SLOW)\r\n--yarn-beta-fast N YaRN: low correction dim or beta (default: -1.00)\r\n (env: LLAMA_ARG_YARN_BETA_FAST)\r\n-kvo, --kv-offload, -nkvo, --no-kv-offload\r\n whether to enable KV cache offloading (default: enabled)\r\n (env: LLAMA_ARG_KV_OFFLOAD)\r\n--repack, -nr, --no-repack whether to enable weight repacking (default: enabled)\r\n (env: LLAMA_ARG_REPACK)\r\n--no-host bypass host buffer allowing extra buffers to be used\r\n (env: LLAMA_ARG_NO_HOST)\r\n-ctk, --cache-type-k TYPE KV cache data type for K\r\n allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1\r\n (default: f16)\r\n (env: LLAMA_ARG_CACHE_TYPE_K)\r\n-ctv, --cache-type-v TYPE KV cache data type for V\r\n allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1\r\n (default: f16)\r\n (env: LLAMA_ARG_CACHE_TYPE_V)\r\n-dt, --defrag-thold N KV cache defragmentation threshold (DEPRECATED)\r\n (env: LLAMA_ARG_DEFRAG_THOLD)\r\n--rpc SERVERS comma-separated list of RPC servers (host:port)\r\n (env: LLAMA_ARG_RPC)\r\n--mlock force system to keep model in RAM rather than swapping or compressing\r\n (env: LLAMA_ARG_MLOCK)\r\n--mmap, --no-mmap whether to memory-map model. (if mmap disabled, slower load but may\r\n reduce pageouts if not using mlock) (default: enabled)\r\n (env: LLAMA_ARG_MMAP)\r\n-dio, --direct-io, -ndio, --no-direct-io\r\n use DirectIO if available. (default: disabled)\r\n (env: LLAMA_ARG_DIO)\r\n--numa TYPE attempt optimizations that help on some NUMA systems\r\n - distribute: spread execution evenly over all nodes\r\n - isolate: only spawn threads on CPUs on the node that execution\r\n started on\r\n - numactl: use the CPU map provided by numactl\r\n if run without this previously, it is recommended to drop the system\r\n page cache before using this\r\n see https://github.com/ggml-org/llama.cpp/issues/1437\r\n (env: LLAMA_ARG_NUMA)\r\n-dev, --device <dev1,dev2,..> comma-separated list of devices to use for offloading (none = don't\r\n offload)\r\n use --list-devices to see a list of available devices\r\n (env: LLAMA_ARG_DEVICE)\r\n--list-devices print list of available devices and exit\r\n-ot, --override-tensor =,...\r\n override tensor buffer type\r\n (env: LLAMA_ARG_OVERRIDE_TENSOR)\r\n-cmoe, --cpu-moe keep all Mixture of Experts (MoE) weights in the CPU\r\n (env: LLAMA_ARG_CPU_MOE)\r\n-ncmoe, --n-cpu-moe N keep the Mixture of Experts (MoE) weights of the first N layers in the\r\n CPU\r\n (env: LLAMA_ARG_N_CPU_MOE)\r\n-ngl, --gpu-layers, --n-gpu-layers N max. number of layers to store in VRAM, either an exact number,\r\n 'auto', or 'all' (default: auto)\r\n (env: LLAMA_ARG_N_GPU_LAYERS)\r\n-sm, --split-mode {none,layer,row,tensor}\r\n how to split the model across multiple GPUs, one of:\r\n - none: use one GPU only\r\n - layer (default): split layers and KV across GPUs (pipelined)\r\n - row: split weight across GPUs by rows (parallelized)\r\n - tensor: split weights and KV across GPUs (parallelized,\r\n EXPERIMENTAL)\r\n (env: LLAMA_ARG_SPLIT_MODE)\r\n-ts, --tensor-split N0,N1,N2,... fraction of the model to offload to each GPU, comma-separated list of\r\n proportions, e.g. 3,1\r\n (env: LLAMA_ARG_TENSOR_SPLIT)\r\n-mg, --main-gpu INDEX the GPU to use for the model (with split-mode = none), or for\r\n intermediate results and KV (with split-mode = row) (default: 0)\r\n (env: LLAMA_ARG_MAIN_GPU)\r\n-fit, --fit [on|off] whether to adjust unset arguments to fit in device memory ('on' or\r\n 'off', default: 'on')\r\n (env: LLAMA_ARG_FIT)\r\n-fitt, --fit-target MiB0,MiB1,MiB2,...\r\n target margin per device for --fit, comma-separated list of values,\r\n single value is broadcast across all devices, default: 1024\r\n (env: LLAMA_ARG_FIT_TARGET)\r\n-fitc, --fit-ctx N minimum ctx size that can be set by --fit option, default: 4096\r\n (env: LLAMA_ARG_FIT_CTX)\r\n--check-tensors check model tensor data for invalid values (default: false)\r\n--override-kv KEY=TYPE:VALUE,... advanced option to override model metadata by key. to specify multiple\r\n overrides, either use comma-separated values.\r\n types: int, float, bool, str. example: --override-kv\r\n tokenizer.ggml.add_bos_token=bool:false,tokenizer.ggml.add_eos_token=bool:false\r\n--op-offload, --no-op-offload whether to offload host tensor operations to device (default: true)\r\n--lora FNAME path to LoRA adapter (use comma-separated values to load multiple\r\n adapters)\r\n--lora-scaled FNAME:SCALE,... path to LoRA adapter with user defined scaling (format:\r\n FNAME:SCALE,...)\r\n note: use comma-separated values\r\n--control-vector FNAME add a control vector\r\n note: use comma-separated values to add multiple control vectors\r\n--control-vector-scaled FNAME:SCALE,...\r\n add a control vector with user defined scaling SCALE\r\n note: use comma-separated values (format: FNAME:SCALE,...)\r\n--control-vector-layer-range START END\r\n layer range to apply the control vector(s) to, start and end inclusive\r\n-m, --model FNAME model path to load\r\n (env: LLAMA_ARG_MODEL)\r\n-mu, --model-url MODEL_URL model download url (default: unused)\r\n (env: LLAMA_ARG_MODEL_URL)\r\n-dr, --docker-repo [/][:quant]\r\n Docker Hub model repository. repo is optional, default to ai/. quant\r\n is optional, default to :latest.\r\n example: gemma3\r\n (default: unused)\r\n (env: LLAMA_ARG_DOCKER_REPO)\r\n-hf, -hfr, --hf-repo /[:quant]\r\n Hugging Face model repository; quant is optional, case-insensitive,\r\n default to Q4_K_M, or falls back to the first file in the repo if\r\n Q4_K_M doesn't exist.\r\n mmproj is also downloaded automatically if available. to disable, add\r\n --no-mmproj\r\n example: ggml-org/GLM-4.7-Flash-GGUF:Q4_K_M\r\n (default: unused)\r\n (env: LLAMA_ARG_HF_REPO)\r\n-hff, --hf-file FILE Hugging Face model file. If specified, it will override the quant in\r\n --hf-repo (default: unused)\r\n (env: LLAMA_ARG_HF_FILE)\r\n-hfv, -hfrv, --hf-repo-v /[:quant]\r\n Hugging Face model repository for the vocoder model (default: unused)\r\n (env: LLAMA_ARG_HF_REPO_V)\r\n-hffv, --hf-file-v FILE Hugging Face model file for the vocoder model (default: unused)\r\n (env: LLAMA_ARG_HF_FILE_V)\r\n-hft, --hf-token TOKEN Hugging Face access token (default: value from HF_TOKEN environment\r\n variable)\r\n (env: HF_TOKEN)\r\n--log-disable Log disable\r\n--log-file FNAME Log to file\r\n (env: LLAMA_ARG_LOG_FILE)\r\n--log-colors [on|off|auto] Set colored logging ('on', 'off', or 'auto', default: 'auto')\r\n 'auto' enables colors when output is to a terminal\r\n (env: LLAMA_ARG_LOG_COLORS)\r\n-v, --verbose, --log-verbose Set verbosity level to infinity (i.e. log all messages, useful for\r\n debugging)\r\n--offline Offline mode: forces use of cache, prevents network access\r\n (env: LLAMA_ARG_OFFLINE)\r\n-lv, --verbosity, --log-verbosity N Set the verbosity threshold. Messages with a higher verbosity will be\r\n ignored. Values:\r\n - 0: generic output\r\n - 1: error\r\n - 2: warning\r\n - 3: info\r\n - 4: trace (more info)\r\n - 5: debug\r\n (default: 3)\r\n\r\n (env: LLAMA_ARG_LOG_VERBOSITY)\r\n--log-prefix, --no-log-prefix Enable prefix in log messages\r\n (env: LLAMA_ARG_LOG_PREFIX)\r\n--log-timestamps, --no-log-timestamps Enable timestamps in log messages\r\n (env: LLAMA_ARG_LOG_TIMESTAMPS)\r\n--spec-draft-type-k, -ctkd, --cache-type-k-draft TYPE\r\n KV cache data type for K for the draft model\r\n allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1\r\n (default: f16)\r\n (env: LLAMA_ARG_SPEC_DRAFT_CACHE_TYPE_K)\r\n--spec-draft-type-v, -ctvd, --cache-type-v-draft TYPE\r\n KV cache data type for V for the draft model\r\n allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1\r\n (default: f16)\r\n (env: LLAMA_ARG_SPEC_DRAFT_CACHE_TYPE_V)\r\n\r\n\r\n----- sampling params -----\r\n\r\n--samplers SAMPLERS samplers that will be used for generation in the order, separated by\r\n ';'\r\n (default:\r\n penalties;dry;top_n_sigma;top_k;typ_p;top_p;min_p;xtc;temperature)\r\n-s, --seed SEED RNG seed (default: -1, use random seed for -1)\r\n--sampler-seq, --sampling-seq SEQUENCE\r\n simplified sequence for samplers that will be used (default:\r\n edskypmxt)\r\n--ignore-eos ignore end of stream token and continue generating (implies\r\n --logit-bias EOS-inf)\r\n--temp, --temperature N temperature (default: 0.80)\r\n--top-k N top-k sampling (default: 40, 0 = disabled)\r\n (env: LLAMA_ARG_TOP_K)\r\n--top-p N top-p sampling (default: 0.95, 1.0 = disabled)\r\n--min-p N min-p sampling (default: 0.05, 0.0 = disabled)\r\n--top-nsigma, --top-n-sigma N top-n-sigma sampling (default: -1.00, -1.0 = disabled)\r\n--xtc-probability N xtc probability (default: 0.00, 0.0 = disabled)\r\n--xtc-threshold N xtc threshold (default: 0.10, 1.0 = disabled)\r\n--typical, --typical-p N locally typical sampling, parameter p (default: 1.00, 1.0 = disabled)\r\n--repeat-last-n N last n tokens to consider for penalize (default: 64, 0 = disabled, -1\r\n = ctx_size)\r\n--repeat-penalty N penalize repeat sequence of tokens (default: 1.00, 1.0 = disabled)\r\n--presence-penalty N repeat alpha presence penalty (default: 0.00, 0.0 = disabled)\r\n--frequency-penalty N repeat alpha frequency penalty (default: 0.00, 0.0 = disabled)\r\n--dry-multiplier N set DRY sampling multiplier (default: 0.00, 0.0 = disabled)\r\n--dry-base N set DRY sampling base value (default: 1.75)\r\n--dry-allowed-length N set allowed length for DRY sampling (default: 2)\r\n--dry-penalty-last-n N set DRY penalty for the last n tokens (default: -1, 0 = disable, -1 =\r\n context size)\r\n--dry-sequence-breaker STRING add sequence breaker for DRY sampling, clearing out default breakers\r\n ('\n', ':', '"', '') in the process; use "none" to not use any\r\n sequence breakers\r\n--adaptive-target N adaptive-p: select tokens near this probability (valid range 0.0 to\r\n 1.0; negative = disabled) (default: -1.00)\r\n (more info)\r\n--adaptive-decay N adaptive-p: decay rate for target adaptation over time. lower values\r\n are more reactive, higher values are more stable.\r\n (valid range 0.0 to 0.99) (default: 0.90)\r\n--dynatemp-range N dynamic temperature range (default: 0.00, 0.0 = disabled)\r\n--dynatemp-exp N dynamic temperature exponent (default: 1.00)\r\n--mirostat N use Mirostat sampling.\r\n Top K, Nucleus and Locally Typical samplers are ignored if used.\r\n (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0)\r\n--mirostat-lr N Mirostat learning rate, parameter eta (default: 0.10)\r\n--mirostat-ent N Mirostat target entropy, parameter tau (default: 5.00)\r\n-l, --logit-bias TOKEN_ID(+/-)BIAS modifies the likelihood of token appearing in the completion,\r\n i.e. --logit-bias 15043+1 to increase likelihood of token ' Hello',\r\n or --logit-bias 15043-1 to decrease likelihood of token ' Hello'\r\n--grammar GRAMMAR BNF-like grammar to constrain generations (see samples in grammars/\r\n dir)\r\n--grammar-file FNAME file to read grammar from\r\n-j, --json-schema SCHEMA JSON schema to constrain generations (https://json-schema.org/), e.g.\r\n {} for any JSON object\r\n For schemas w/ external $refs, use --grammar +\r\n example/json_schema_to_grammar.py instead\r\n-jf, --json-schema-file FILE File containing a JSON schema to constrain generations\r\n (https://json-schema.org/), e.g. {} for any JSON object\r\n For schemas w/ external $refs, use --grammar +\r\n example/json_schema_to_grammar.py instead\r\n-bs, --backend-sampling enable backend sampling (experimental) (default: disabled)\r\n (env: LLAMA_ARG_BACKEND_SAMPLING)\r\n\r\n\r\n----- speculative params -----\r\n\r\n--spec-draft-hf, -hfd, -hfrd, --hf-repo-draft /[:quant]\r\n Same as --hf-repo, but for the draft model (default: unused)\r\n (env: LLAMA_ARG_SPEC_DRAFT_HF_REPO)\r\n--spec-draft-threads, -td, --threads-draft N\r\n number of threads to use during generation (default: same as\r\n --threads)\r\n--spec-draft-threads-batch, -tbd, --threads-batch-draft N\r\n number of threads to use during batch and prompt processing (default:\r\n same as --threads-draft)\r\n--spec-draft-cpu-mask, -Cd, --cpu-mask-draft M\r\n Draft model CPU affinity mask. Complements cpu-range-draft (default:\r\n same as --cpu-mask)\r\n--spec-draft-cpu-range, -Crd, --cpu-range-draft lo-hi\r\n Ranges of CPUs for affinity. Complements --cpu-mask-draft\r\n--spec-draft-cpu-strict, --cpu-strict-draft <0|1>\r\n Use strict CPU placement for draft model (default: same as\r\n --cpu-strict)\r\n--spec-draft-prio, --prio-draft N set draft process/thread priority : 0-normal, 1-medium, 2-high,\r\n 3-realtime (default: 0)\r\n--spec-draft-poll, --poll-draft <0|1> Use polling to wait for draft model work (default: same as --poll)\r\n--spec-draft-cpu-mask-batch, -Cbd, --cpu-mask-batch-draft M\r\n Draft model CPU affinity mask. Complements cpu-range-draft (default:\r\n same as --cpu-mask)\r\n--spec-draft-cpu-strict-batch, --cpu-strict-batch-draft <0|1>\r\n Use strict CPU placement for draft model (default: --cpu-strict-draft)\r\n--spec-draft-prio-batch, --prio-batch-draft N\r\n set draft process/thread priority : 0-normal, 1-medium, 2-high,\r\n 3-realtime (default: 0)\r\n--spec-draft-poll-batch, --poll-batch-draft <0|1>\r\n Use polling to wait for draft model work (default: --poll-draft)\r\n--spec-draft-override-tensor, -otd, --override-tensor-draft =,...\r\n override tensor buffer type for draft model\r\n--spec-draft-cpu-moe, -cmoed, --cpu-moe-draft\r\n keep all Mixture of Experts (MoE) weights in the CPU for the draft\r\n model\r\n (env: LLAMA_ARG_SPEC_DRAFT_CPU_MOE)\r\n--spec-draft-n-cpu-moe, --spec-draft-ncmoe, -ncmoed, --n-cpu-moe-draft N\r\n keep the Mixture of Experts (MoE) weights of the first N layers in the\r\n CPU for the draft model\r\n (env: LLAMA_ARG_SPEC_DRAFT_N_CPU_MOE)\r\n--spec-draft-n-max N number of tokens to draft for speculative decoding (default: 3)\r\n (env: LLAMA_ARG_SPEC_DRAFT_N_MAX)\r\n--spec-draft-n-min N minimum number of draft tokens to use for speculative decoding\r\n (default: 0)\r\n (env: LLAMA_ARG_SPEC_DRAFT_N_MIN)\r\n--spec-draft-p-split, --draft-p-split P\r\n speculative decoding split probability (default: 0.10)\r\n (env: LLAMA_ARG_SPEC_DRAFT_P_SPLIT)\r\n--spec-draft-p-min, --draft-p-min P minimum speculative decoding probability (greedy) (default: 0.00)\r\n (env: LLAMA_ARG_SPEC_DRAFT_P_MIN)\r\n--spec-draft-backend-sampling, --no-spec-draft-backend-sampling\r\n offload draft sampling to the backend (default: enabled)\r\n (env: LLAMA_ARG_SPEC_DRAFT_BACKEND_SAMPLING)\r\n--spec-draft-device, -devd, --device-draft <dev1,dev2,..>\r\n comma-separated list of devices to use for offloading the draft model\r\n (none = don't offload)\r\n use --list-devices to see a list of available devices\r\n--spec-draft-ngl, -ngld, --gpu-layers-draft, --n-gpu-layers-draft N\r\n max. number of draft model layers to store in VRAM, either an exact\r\n number, 'auto', or 'all' (default: auto)\r\n (env: LLAMA_ARG_N_GPU_LAYERS_DRAFT)\r\n--spec-draft-model, -md, --model-draft FNAME\r\n draft model for speculative decoding (default: unused)\r\n (env: LLAMA_ARG_SPEC_DRAFT_MODEL)\r\n--spec-type none,draft-simple,draft-eagle3,draft-mtp,ngram-simple,ngram-map-k,ngram-map-k4v,ngram-mod,ngram-cache\r\n comma-separated list of types of speculative decoding to use (default:\r\n none)\r\n\r\n (env: LLAMA_ARG_SPEC_TYPE)\r\n--spec-ngram-mod-n-min N minimum number of ngram tokens to use for ngram-based speculative\r\n decoding (default: 48)\r\n--spec-ngram-mod-n-max N maximum number of ngram tokens to use for ngram-based speculative\r\n decoding (default: 64)\r\n--spec-ngram-mod-n-match N ngram-mod lookup length (default: 24)\r\n--spec-ngram-simple-size-n N ngram size N for ngram-simple speculative decoding, length of lookup\r\n n-gram (default: 12)\r\n--spec-ngram-simple-size-m N ngram size M for ngram-simple speculative decoding, length of draft\r\n m-gram (default: 48)\r\n--spec-ngram-simple-min-hits N minimum hits for ngram-simple speculative decoding (default: 1)\r\n--spec-ngram-map-k-size-n N ngram size N for ngram-map-k speculative decoding, length of lookup\r\n n-gram (default: 12)\r\n--spec-ngram-map-k-size-m N ngram size M for ngram-map-k speculative decoding, length of draft\r\n m-gram (default: 48)\r\n--spec-ngram-map-k-min-hits N minimum hits for ngram-map-k speculative decoding (default: 1)\r\n--spec-ngram-map-k4v-size-n N ngram size N for ngram-map-k4v speculative decoding, length of lookup\r\n n-gram (default: 12)\r\n--spec-ngram-map-k4v-size-m N ngram size M for ngram-map-k4v speculative decoding, length of draft\r\n m-gram (default: 48)\r\n--spec-ngram-map-k4v-min-hits N minimum hits for ngram-map-k4v speculative decoding (default: 1)\r\n--draft, --draft-n, --draft-max N the argument has been removed. use --spec-draft-n-max or\r\n --spec-ngram-mod-n-max\r\n (env: LLAMA_ARG_DRAFT_MAX)\r\n--draft-min, --draft-n-min N the argument has been removed. use --spec-draft-n-min or\r\n --spec-ngram-mod-n-min\r\n (env: LLAMA_ARG_DRAFT_MIN)\r\n--spec-ngram-size-n N the argument has been removed. use the respective\r\n --spec-ngram--size-n or --spec-ngram-mod-n-match\r\n--spec-ngram-size-m N the argument has been removed. use the respective\r\n --spec-ngram--size-m\r\n--spec-ngram-min-hits N the argument has been removed. use the respective\r\n --spec-ngram--min-hits\r\n\r\n\r\n----- example-specific params -----\r\n\r\n-lcs, --lookup-cache-static FNAME path to static lookup cache to use for lookup decoding (not updated by\r\n generation)\r\n-lcd, --lookup-cache-dynamic FNAME path to dynamic lookup cache to use for lookup decoding (updated by\r\n generation)\r\n-ctxcp, --ctx-checkpoints, --swa-checkpoints N\r\n max number of context checkpoints to create per slot (default:\r\n 32)(more info)\r\n (env: LLAMA_ARG_CTX_CHECKPOINTS)\r\n-cms, --checkpoint-min-step N minimum spacing between context checkpoints in tokens (default: 256, 0\r\n = no minimum)\r\n (env: LLAMA_ARG_CHECKPOINT_MIN_SPACING_NT)\r\n-cram, --cache-ram N set the maximum cache size in MiB (default: 8192, -1 - no limit, 0 -\r\n disable)(more\r\n info)\r\n (env: LLAMA_ARG_CACHE_RAM)\r\n-kvu, --kv-unified, -no-kvu, --no-kv-unified\r\n use single unified KV buffer shared across all sequences (default:\r\n enabled if number of slots is auto)\r\n (env: LLAMA_ARG_KV_UNIFIED)\r\n--cache-idle-slots, --no-cache-idle-slots\r\n save and clear idle slots on new task (default: enabled, requires\r\n unified KV and cache-ram)\r\n (env: LLAMA_ARG_CACHE_IDLE_SLOTS)\r\n--context-shift, --no-context-shift whether to use context shift on infinite text generation (default:\r\n disabled)\r\n (env: LLAMA_ARG_CONTEXT_SHIFT)\r\n-r, --reverse-prompt PROMPT halt generation at PROMPT, return control in interactive mode\r\n-sp, --special special tokens output enabled (default: false)\r\n--warmup, --no-warmup whether to perform warmup with an empty run (default: enabled)\r\n--spm-infill use Suffix/Prefix/Middle pattern for infill (instead of\r\n Prefix/Suffix/Middle) as some models prefer this. (default: disabled)\r\n--pooling {none,mean,cls,last,rank} pooling type for embeddings, use model default if unspecified\r\n (env: LLAMA_ARG_POOLING)\r\n-np, --parallel N number of server slots (default: -1, -1 = auto)\r\n (env: LLAMA_ARG_N_PARALLEL)\r\n-cb, --cont-batching, -nocb, --no-cont-batching\r\n whether to enable continuous batching (a.k.a dynamic batching)\r\n (default: enabled)\r\n (env: LLAMA_ARG_CONT_BATCHING)\r\n-mm, --mmproj FILE path to a multimodal projector file. see tools/mtmd/README.md\r\n note: if -hf is used, this argument can be omitted\r\n (env: LLAMA_ARG_MMPROJ)\r\n-mmu, --mmproj-url URL URL to a multimodal projector file. see tools/mtmd/README.md\r\n (env: LLAMA_ARG_MMPROJ_URL)\r\n--mmproj-auto, --no-mmproj, --no-mmproj-auto\r\n whether to use multimodal projector file (if available), useful when\r\n using -hf (default: enabled)\r\n (env: LLAMA_ARG_MMPROJ_AUTO)\r\n--mmproj-offload, --no-mmproj-offload whether to enable GPU offloading for multimodal projector (default:\r\n enabled)\r\n (env: LLAMA_ARG_MMPROJ_OFFLOAD)\r\n--image-min-tokens N minimum number of tokens each image can take, only used by vision\r\n models with dynamic resolution (default: read from model)\r\n (env: LLAMA_ARG_IMAGE_MIN_TOKENS)\r\n--image-max-tokens N maximum number of tokens each image can take, only used by vision\r\n models with dynamic resolution (default: read from model)\r\n (env: LLAMA_ARG_IMAGE_MAX_TOKENS)\r\n-a, --alias STRING set model name aliases, comma-separated (to be used by API)\r\n (env: LLAMA_ARG_ALIAS)\r\n--tags STRING set model tags, comma-separated (informational, not used for routing)\r\n (env: LLAMA_ARG_TAGS)\r\n--embd-normalize N normalisation for embeddings (default: 2) (-1=none, 0=max absolute\r\n int16, 1=taxicab, 2=euclidean, >2=p-norm)\r\n--host HOST ip address to listen, or bind to an UNIX socket if the address ends\r\n with .sock (default: 127.0.0.1)\r\n (env: LLAMA_ARG_HOST)\r\n--port PORT port to listen (default: 8080)\r\n (env: LLAMA_ARG_PORT)\r\n--reuse-port allow multiple sockets to bind to the same port (default: disabled)\r\n (env: LLAMA_ARG_REUSE_PORT)\r\n--path PATH path to serve static files from (default: )\r\n (env: LLAMA_ARG_STATIC_PATH)\r\n--api-prefix PREFIX prefix path the server serves from, without the trailing slash\r\n (default: )\r\n (env: LLAMA_ARG_API_PREFIX)\r\n--webui-config JSON [DEPRECATED: use --ui-config] JSON that provides default WebUI\r\n settings (overrides WebUI defaults)\r\n (env: LLAMA_ARG_WEBUI_CONFIG)\r\n--ui-config JSON JSON that provides default UI settings (overrides UI defaults)\r\n (env: LLAMA_ARG_UI_CONFIG)\r\n--webui-config-file PATH [DEPRECATED: use --ui-config-file] JSON file that provides default\r\n WebUI settings (overrides WebUI defaults)\r\n (env: LLAMA_ARG_WEBUI_CONFIG_FILE)\r\n--ui-config-file PATH JSON file that provides default UI settings (overrides UI defaults)\r\n (env: LLAMA_ARG_UI_CONFIG_FILE)\r\n--webui-mcp-proxy, --no-webui-mcp-proxy\r\n [DEPRECATED: use --ui-mcp-proxy/--no-ui-mcp-proxy] experimental:\r\n whether to enable MCP CORS proxy\r\n (env: LLAMA_ARG_WEBUI_MCP_PROXY)\r\n--ui-mcp-proxy, --no-ui-mcp-proxy experimental: whether to enable MCP CORS proxy - do not enable in\r\n untrusted environments (default: disabled)\r\n (env: LLAMA_ARG_UI_MCP_PROXY)\r\n--tools TOOL1,TOOL2,... experimental: whether to enable built-in tools for AI agents - do not\r\n enable in untrusted environments (default: no tools)\r\n specify "all" to enable all tools\r\n available tools: read_file, file_glob_search, grep_search,\r\n exec_shell_command, write_file, edit_file, apply_diff, get_datetime\r\n (env: LLAMA_ARG_TOOLS)\r\n--webui, --no-webui [DEPRECATED: use --ui/--no-ui] whether to enable the Web UI\r\n (env: LLAMA_ARG_WEBUI)\r\n--ui, --no-ui whether to enable the Web UI (default: enabled)\r\n (env: LLAMA_ARG_UI)\r\n--embedding, --embeddings restrict to only support embedding use case; use only with dedicated\r\n embedding models (default: disabled)\r\n (env: LLAMA_ARG_EMBEDDINGS)\r\n--rerank, --reranking enable reranking endpoint on server (default: disabled)\r\n (env: LLAMA_ARG_RERANKING)\r\n--api-key KEY API key to use for authentication, multiple keys can be provided as a\r\n comma-separated list (default: none)\r\n (env: LLAMA_API_KEY)\r\n--api-key-file FNAME path to file containing API keys (default: none)\r\n (env: LLAMA_ARG_API_KEY_FILE)\r\n--ssl-key-file FNAME path to file a PEM-encoded SSL private key\r\n (env: LLAMA_ARG_SSL_KEY_FILE)\r\n--ssl-cert-file FNAME path to file a PEM-encoded SSL certificate\r\n (env: LLAMA_ARG_SSL_CERT_FILE)\r\n--chat-template-kwargs STRING sets additional params for the json template parser, must be a valid\r\n json object string, e.g. '{"key1":"value1","key2":"value2"}'\r\n (env: LLAMA_ARG_CHAT_TEMPLATE_KWARGS)\r\n-to, --timeout N server read/write timeout in seconds (default: 3600)\r\n (env: LLAMA_ARG_TIMEOUT)\r\n--sse-ping-interval N server SSE ping interval in seconds (-1 = disabled, default: 30)\r\n (env: LLAMA_ARG_SSE_PING_INTERVAL)\r\n--threads-http N number of threads used to process HTTP requests (default: -1)\r\n (env: LLAMA_ARG_THREADS_HTTP)\r\n--cache-prompt, --no-cache-prompt whether to enable prompt caching (default: enabled)\r\n (env: LLAMA_ARG_CACHE_PROMPT)\r\n--cache-reuse N min chunk size to attempt reusing from the cache via KV shifting,\r\n requires prompt caching to be enabled (default: 0)\r\n (card)\r\n (env: LLAMA_ARG_CACHE_REUSE)\r\n--metrics enable prometheus compatible metrics endpoint (default: disabled)\r\n (env: LLAMA_ARG_ENDPOINT_METRICS)\r\n--props enable changing global properties via POST /props (default: disabled)\r\n (env: LLAMA_ARG_ENDPOINT_PROPS)\r\n--slots, --no-slots expose slots monitoring endpoint (default: enabled)\r\n (env: LLAMA_ARG_ENDPOINT_SLOTS)\r\n--slot-save-path PATH path to save slot kv cache (default: disabled)\r\n--media-path PATH directory for loading local media files; files can be accessed via\r\n file:// URLs using relative paths (default: disabled)\r\n--models-dir PATH directory containing models for the router server (default: disabled)\r\n (env: LLAMA_ARG_MODELS_DIR)\r\n--models-preset PATH path to INI file containing model presets for the router server\r\n (default: disabled)\r\n (env: LLAMA_ARG_MODELS_PRESET)\r\n--models-max N for router server, maximum number of models to load simultaneously\r\n (default: 4, 0 = unlimited)\r\n (env: LLAMA_ARG_MODELS_MAX)\r\n--models-autoload, --no-models-autoload\r\n for router server, whether to automatically load models (default:\r\n enabled)\r\n (env: LLAMA_ARG_MODELS_AUTOLOAD)\r\n--jinja, --no-jinja whether to use jinja template engine for chat (default: enabled)\r\n (env: LLAMA_ARG_JINJA)\r\n--reasoning-format FORMAT controls whether thought tags are allowed and/or extracted from the\r\n response, and in which format they're returned; one of:\r\n - none: leaves thoughts unparsed in message.content\r\n - deepseek: puts thoughts in message.reasoning_content\r\n - deepseek-legacy: keeps <think> tags in message.content while\r\n also populating message.reasoning_content\r\n (default: auto)\r\n (env: LLAMA_ARG_THINK)\r\n-rea, --reasoning [on|off|auto] Use reasoning/thinking in the chat ('on', 'off', or 'auto', default:\r\n 'auto' (detect from template))\r\n (env: LLAMA_ARG_REASONING)\r\n--reasoning-budget N token budget for thinking: -1 for unrestricted, 0 for immediate end,\r\n N>0 for token budget (default: -1)\r\n (env: LLAMA_ARG_THINK_BUDGET)\r\n--reasoning-budget-message MESSAGE message injected before the end-of-thinking tag when reasoning budget\r\n is exhausted (default: none)\r\n (env: LLAMA_ARG_THINK_BUDGET_MESSAGE)\r\n--chat-template JINJA_TEMPLATE set custom jinja chat template (default: template taken from model's\r\n metadata)\r\n if suffix/prefix are specified, template will be disabled\r\n only commonly used templates are accepted (unless --jinja is set\r\n before this flag):\r\n list of built-in templates:\r\n bailing, bailing-think, bailing2, chatglm3, chatglm4, chatml,\r\n command-r, deepseek, deepseek-ocr, deepseek2, deepseek3, exaone-moe,\r\n exaone3, exaone4, falcon3, gemma, gigachat, glmedge, gpt-oss, granite,\r\n granite-4.0, granite-4.1, grok-2, hunyuan-dense, hunyuan-moe,\r\n hunyuan-vl, kimi-k2, llama2, llama2-sys, llama2-sys-bos,\r\n llama2-sys-strip, llama3, llama4, megrez, minicpm, mistral-v1,\r\n mistral-v3, mistral-v3-tekken, mistral-v7, mistral-v7-tekken, monarch,\r\n openchat, orion, pangu-embedded, phi3, phi4, rwkv-world, seed_oss,\r\n smolvlm, solar-open, vicuna, vicuna-orca, yandex, zephyr\r\n (env: LLAMA_ARG_CHAT_TEMPLATE)\r\n--chat-template-file JINJA_TEMPLATE_FILE\r\n set custom jinja chat template file (default: template taken from\r\n model's metadata)\r\n if suffix/prefix are specified, template will be disabled\r\n only commonly used templates are accepted (unless --jinja is set\r\n before this flag):\r\n list of built-in templates:\r\n bailing, bailing-think, bailing2, chatglm3, chatglm4, chatml,\r\n command-r, deepseek, deepseek-ocr, deepseek2, deepseek3, exaone-moe,\r\n exaone3, exaone4, falcon3, gemma, gigachat, glmedge, gpt-oss, granite,\r\n granite-4.0, granite-4.1, grok-2, hunyuan-dense, hunyuan-moe,\r\n hunyuan-vl, kimi-k2, llama2, llama2-sys, llama2-sys-bos,\r\n llama2-sys-strip, llama3, llama4, megrez, minicpm, mistral-v1,\r\n mistral-v3, mistral-v3-tekken, mistral-v7, mistral-v7-tekken, monarch,\r\n openchat, orion, pangu-embedded, phi3, phi4, rwkv-world, seed_oss,\r\n smolvlm, solar-open, vicuna, vicuna-orca, yandex, zephyr\r\n (env: LLAMA_ARG_CHAT_TEMPLATE_FILE)\r\n--skip-chat-parsing, --no-skip-chat-parsing\r\n force a pure content parser, even if a Jinja template is specified;\r\n model will output everything in the content section, including any\r\n reasoning and/or tool calls (default: disabled)\r\n (env: LLAMA_ARG_SKIP_CHAT_PARSING)\r\n--prefill-assistant, --no-prefill-assistant\r\n whether to prefill the assistant's response if the last message is an\r\n assistant message (default: prefill enabled)\r\n when this flag is set, if the last message is an assistant message\r\n then it will be treated as a full message and not prefilled\r\n\r\n (env: LLAMA_ARG_PREFILL_ASSISTANT)\r\n-sps, --slot-prompt-similarity SIMILARITY\r\n how much the prompt of a request must match the prompt of a slot in\r\n order to use that slot (default: 0.10, 0.0 = disabled)\r\n--lora-init-without-apply load LoRA adapters without applying them (apply later via POST\r\n /lora-adapters) (default: disabled)\r\n--sleep-idle-seconds SECONDS number of seconds of idleness after which the server will sleep\r\n (default: -1; -1 = disabled)\r\n-mv, --model-vocoder FNAME vocoder model for audio generation (default: unused)\r\n--tts-use-guide-tokens Use guide tokens to improve TTS word recall\r\n--embd-gemma-default use default EmbeddingGemma model (note: can download weights from the\r\n internet)\r\n--fim-qwen-1.5b-default use default Qwen 2.5 Coder 1.5B (note: can download weights from the\r\n internet)\r\n--fim-qwen-3b-default use default Qwen 2.5 Coder 3B (note: can download weights from the\r\n internet)\r\n--fim-qwen-7b-default use default Qwen 2.5 Coder 7B (note: can download weights from the\r\n internet)\r\n--fim-qwen-7b-spec use Qwen 2.5 Coder 7B + 0.5B draft for speculative decoding (note: can\r\n download weights from the internet)\r\n--fim-qwen-14b-spec use Qwen 2.5 Coder 14B + 0.5B draft for speculative decoding (note:\r\n can download weights from the internet)\r\n--fim-qwen-30b-default use default Qwen 3 Coder 30B A3B Instruct (note: can download weights\r\n from the internet)\r\n--gpt-oss-20b-default use gpt-oss-20b (note: can download weights from the internet)\r\n--gpt-oss-120b-default use gpt-oss-120b (note: can download weights from the internet)\r\n--vision-gemma-4b-default use Gemma 3 4B QAT (note: can download weights from the internet)\r\n--vision-gemma-12b-default use Gemma 3 12B QAT (note: can download weights from the internet)\r\n--spec-default enable default speculative decoding config"
}
]

Sign up or log in to comment