-m, --model FNAME
The model file to load from disk. This is the one option you always need unless you download a model with one of the options below.
Official help text
model path to load
Tell this page about your computer and your model, and it writes the command. A web page can't start programs, so you paste it into a terminal yourself. Nothing leaves your browser.
Four Linux commands. Replace the model path, then paste into a terminal. For macOS or Windows, run python3 src/jc.py from the GitHub repo.
Every layer on the GPU, with the largest context that fits. Usually the fastest.
llama-server \ -m /path/to/your-model.gguf \ --n-gpu-layers all \ --fit on \ --port 8080
Asks for a 32K context. On a small GPU, some layers may move to the CPU.
llama-server \ -m /path/to/your-model.gguf \ --ctx-size 32768 \ --port 8080
Runs without the GPU. Slower, but works on any machine with enough RAM.
llama-server \ -m /path/to/your-model.gguf \ --n-gpu-layers 0 \ --port 8080
The model can search and read files your account can read, including private ones. It can't change anything. Experimental.
Tools are on. They're experimental and can read what your account can read.
llama-server \ -m /path/to/your-model.gguf \ --tools read_file,file_glob_search,grep_search,get_info \ --port 8080
Leave blank if it's already on your PATH.
Downloads on the first run, then stays cached
1,000 tokens is about 750 words. Bigger uses more memory.
Adjusts what you left unset so it fits. With it off, too large a context can stop the server at startup.
How varied the wording gets. Lower is more predictable.
Cleared on reload. The key still appears in your command. Prefer to keep it out of shell history.
No options match. Try a different word, such as memory or security.
Which model the server runs, and where it comes from.
-m, --model FNAMEThe model file to load from disk. This is the one option you always need unless you download a model with one of the options below.
model path to load
-cl, --cache-listLists the models llama.cpp has already downloaded to its cache, then exits without starting a server.
show list of models in cache
Prints information and exits, so run it on its own
-hf, -hfr, --hf-repo <user>/<model>[:quant]Downloads a GGUF model from Hugging Face by name, then runs it. You can add the quality level after a colon, such as :Q4_K_M. If the repo includes a vision file, that downloads too.
Hugging Face model repository; quant is optional, case-insensitive, default to Q4_K_M, or falls back to the first file in the repo if Q4_K_M doesn't exist. mmproj is also downloaded automatically if available. to disable, add --no-mmproj example: ggml-org/GLM-4.7-Flash-GGUF:Q4_K_M (default: unused)
--offlineBlocks all network access for model downloads and uses only what's already cached. A good safety setting once your models are downloaded.
Offline mode: forces use of cache, prevents network access
-mu, --model-url MODEL_URLDownloads a model from a direct web link instead of using a file you already have.
model download url (default: unused)
-dr, --docker-repo [<repo>/]<model>[:quant]Downloads a model from Docker Hub's AI model collection, for example gemma3.
Docker Hub model repository. repo is optional, default to ai/. quant is optional, default to :latest. example: gemma3 (default: unused)
-hff, --hf-file FILEPicks one exact file inside the Hugging Face repo named by --hf-repo, for when the quality shortcut isn't precise enough.
Hugging Face model file. If specified, it will override the quant in --hf-repo (default: unused)
-hft, --hf-token TOKENYour Hugging Face access token. You only need it for private or gated models. Prefer the HF_TOKEN environment variable so the token doesn't show up in your process list.
Hugging Face access token (default: value from HF_TOKEN environment variable)
How much the model can hold in mind, and how the server handles a chat as it grows.
-c, --ctx-size NThe size of the context window: how many tokens the model can hold in mind at once, counting the conversation, its reasoning and the reply. Bigger means longer chats and uses more GPU memory. 0 means use the model's own maximum.
Tip: This is the setting people change most. If the server runs out of memory at startup, lower it or leave it unset so auto-fit can choose.
size of the prompt context (default: 0, 0 = loaded from model)
-np, --parallel NHow many chats the server can run at the same moment. Each one is a slot. Without a unified cache, the context window gets divided between slots, so 4 slots on a 56,000-token window would give each about 14,000.
Tip: Keep it at 1 if you're the only user, so your chat gets the whole window.
number of server slots (default: -1, -1 = auto)
-cram, --cache-ram NLimits the prompt cache that holds recent conversations in system RAM, so switching back to one is faster. 0 turns the cache off and -1 removes the limit.
set the maximum cache size in MiB (default: 8192, -1 - no limit, 0 - disable)[(more info)](https://github.com/ggml-org/llama.cpp/pull/16391)
--context-shift, --no-context-shiftWhen the context fills up, drops the oldest text so generation can continue. Without it, the reply stops at the limit. The model forgets what was dropped, so it can lose track of earlier parts of the chat.
whether to use context shift on infinite text generation (default: disabled)
--cache-prompt, --no-cache-promptReuses the part of the conversation already processed, so each new message only processes what's new. This is why long chats don't restart from zero on every reply. Leave it on.
whether to enable prompt caching (default: enabled)
--keep NHow many tokens from the start of the prompt to protect when the server has to drop old text to make room. -1 keeps the whole initial prompt. Only matters with --context-shift.
number of tokens to keep from the initial prompt (default: 0, -1 = all)
--kv-unified-per-slot NCaps how much of the shared pool each slot can use. If you don't set --ctx-size, the pool is sized to slots times this number.
context limit per parallel slot (default: unset, behavior unchanged). when set without -c/--ctx-size, the shared KV pool is sized to n_parallel*N
-ctxcp, --ctx-checkpoints, --swa-checkpoints NHow many restore points the server keeps per slot. These let it go back to an earlier state without reprocessing everything, which helps when you edit or regenerate messages.
max number of context checkpoints to create per slot (default: 32)[(more info)](https://github.com/ggml-org/llama.cpp/pull/15293)
-cms, --checkpoint-min-step NThe minimum distance between those restore points, in tokens. Lower values make more frequent restore points and use more memory.
minimum spacing between context checkpoints in tokens (default: 8192, 0 = no minimum)
-kvu, --kv-unified, -no-kvu, --no-kv-unifiedShares one context pool across all slots, so a busy chat can use space an idle one isn't using. It's on by default only when the slot count is automatic.
use single unified KV buffer shared across all sequences (default: enabled if number of slots is auto)
--cache-idle-slots, --no-cache-idle-slotsWhen a new task arrives, saves idle slots to the prompt cache first so their work isn't lost. Requires --cache-ram.
save idle slots to the prompt cache on new task, and clear them when using unified KV (default: enabled, requires cache-ram)
--cache-reuse NTries to reuse matching chunks of at least N tokens even when they've moved position in the prompt. It can speed up editing an earlier message or long documents. 0 turns it off.
min chunk size to attempt reusing from the cache via KV shifting, requires prompt caching to be enabled (default: 0) [(card)](https://ggml.ai/f0.png)
--slot-save-path PATHA folder where a slot's memory can be saved and restored through the API, so a long session can be paused and resumed. Off unless you give a folder.
path to save slot kv cache (default: disabled)
-sps, --slot-prompt-similarity SIMILARITYWith several slots, decides how closely a new request must match a slot's existing conversation to reuse that slot. 0 turns the check off. It rarely matters with one slot.
how much the prompt of a request must match the prompt of a slot in order to use that slot (default: 0.10, 0.0 = disabled)
--swa-fullUses a full-size cache for models that use sliding-window attention. It uses more memory but allows better reuse on those particular models.
use full-size SWA cache (default: false) [(more info)](https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
Where the model and its context live. On a small graphics card, this section decides what fits.
-ngl, --gpu-layers, --n-gpu-layers NHow many of the model's layers run on the GPU. GPU layers are much faster. A number sets an exact count, all puts everything on the GPU, and auto lets the server decide. Layers that don't fit run on the CPU using system RAM.
Tip: If you lower it, context memory for those layers moves to system RAM too. That can fit a bigger context, at reduced speed.
max. number of layers to store in VRAM, either an exact number, 'auto', or 'all' (default: auto)
-fit, --fit [on|off]Auto-sizing. When on, the server adjusts any memory settings you didn't set so everything fits in GPU memory. It only changes settings you left unset, so an explicit -c or -ngl stays as you wrote it.
Tip: If you set --ctx-size yourself, auto-fit won't shrink it. With --fit off, a number that's too large can stop the server at startup.
whether to adjust unset arguments to fit in device memory ('on' or
'off', default: 'on')-b, --batch-size NThe most tokens the server will accept in one processing step, before splitting them up. Larger values can read long prompts faster and use more memory.
logical maximum batch size (default: 2048)
-ub, --ubatch-size NThe batch size actually sent to the hardware at once. This one has a direct effect on GPU memory. Lower it if you run out of memory while reading long prompts. Higher can be faster.
physical maximum batch size (default: 512)
-kvo, --kv-offload, -nkvo, --no-kv-offloadControls where context memory lives. It's on the GPU by default. The -nkvo form keeps it in system RAM instead, which frees a lot of GPU memory but makes generation slower.
Tip: One route to a very large context on a small card: all layers on the GPU, context in system RAM. Expect it to be noticeably slower.
whether to enable KV cache offloading (default: enabled)
-lm, --load-mode MODEHow the model file gets loaded. mmap reads it from disk on demand and is the normal default. mlock pins it in RAM so the system can't swap it out. dio uses direct disk reads.
model loading mode (default: auto) - 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
-fitt, --fit-target MiB0,MiB1,MiB2,...How much GPU memory auto-fit leaves free as a safety margin, in MiB. A lower margin gives you more context but leaves less room for your desktop and other apps.
Tip: The default keeps 1 GB free. A smaller margin allows more context but leaves less for your desktop and other apps.
target margin per device for --fit, comma-separated list of values, single value is broadcast across all devices, default: 1024
--sleep-idle-seconds SECONDSAfter this many idle seconds, the server goes to sleep and releases the model from memory. The next request wakes it up, with a delay while it reloads.
Tip: Useful if you want your GPU memory back when you aren't chatting.
number of seconds of idleness after which the server will sleep (default: -1; -1 = disabled)
-fa, --flash-attn [on|off|auto]Flash Attention, a faster way of doing part of the model's math. Auto lets the server use it where it works. Force it on or off only when troubleshooting.
set Flash Attention use ('on', 'off', or 'auto', default: 'auto')--repack, -nr, --no-repackRearranges model weights in memory so the CPU can process them faster. It's useful for layers running on the CPU. Leave it on.
whether to enable weight repacking (default: enabled)
--no-hostSkips a normal memory-transfer step so other optimized memory buffers can be used. It's for troubleshooting and tuning.
bypass host buffer allowing extra buffers to be used
-ctk, --cache-type-k TYPEThe number format for half of the context memory (the keys). Lower-precision formats such as q8_0 can use much less memory but may reduce quality or fail on some setups.
Tip: Can let more context fit on a small card. Test reply quality if you try it.
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)
-ctv, --cache-type-v TYPEThe same as --cache-type-k, for the other half of the context memory (the values).
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)
--rpc SERVERSSends part of the work to other computers running llama.cpp's RPC server, so several machines can share a model. Only use this on a network you trust.
comma-separated list of RPC servers (host:port)
-lzm, --lazy-mode MODEReads certain huge tensors from disk only as needed instead of keeping them in memory. Auto only does this for tensors over 4 GiB, which your 1.6 GB model file doesn't have.
on-demand reading of certain tensors, for example per-layer embeddings (default: auto) - on: read the rows of such tensors from disk on demand instead of keeping them resident (requires mmap) - auto: on, but only for tensors larger than 4 GiB - off: always keep them resident
-dev, --device <dev1,dev2,..>Chooses which hardware to use, by name. Use none to force CPU only. Run --list-devices to see the names.
Tip: --device none forces CPU only.
comma-separated list of devices to use for offloading (none = don't offload) use --list-devices to see a list of available devices
-ot, --override-tensor <tensor name pattern>=<buffer type>,...Places specific parts of the model on a specific device, using name patterns. A power-user way of fitting a model precisely when layer counts aren't fine-grained enough.
override tensor buffer type
-ncffn, --n-cpu-ffn NKeeps the main dense (FFN) weights of the first N layers on the CPU. A finer way to save GPU memory on non-MoE models, trading some speed.
keep the dense FFN weights of the first N layers in the CPU (dense models; for MoE expert weights use --n-cpu-moe)
-fitc, --fit-ctx NThe smallest context size auto-fit is allowed to choose. If even this won't fit, it moves layers off the GPU instead of shrinking context further.
minimum ctx size that can be set by --fit option, default: 4096
--op-offload, --no-op-offloadAllows the GPU to run certain operations on data that sits in system memory. On by default, and rarely worth changing.
whether to offload host tensor operations to device (default: true)
-cb, --cont-batching, -nocb, --no-cont-batchingLets new requests join work already in progress instead of waiting. It only matters when several chats are running at once. Leave it on.
whether to enable continuous batching (a.k.a dynamic batching) (default: enabled)
-cmoe, --cpu-moeKeeps the expert weights of a Mixture of Experts model on the CPU, which saves a lot of GPU memory on those models.
keep all Mixture of Experts (MoE) weights in the CPU
-ncmoe, --n-cpu-moe NThe same as --cpu-moe, but only for the first N layers.
keep the Mixture of Experts (MoE) weights of the first N layers in the CPU
--moe-cache-mib NA GPU cache for the expert weights that are being kept on the CPU.
GPU cache size in MiB for the MoE experts kept in the CPU. with multiple GPUs, it is split among them like the layers (--tensor-split) (default: 0, disabled)
-sm, --split-mode {none,layer,row,tensor}How to divide a model across several GPUs.
how to split the model across multiple GPUs, one of: - 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,...What share of the model each GPU gets, such as 3,1 for a 75/25 split.
fraction of the model to offload to each GPU, comma-separated list of proportions, e.g. 3,1
-mg, --main-gpu INDEXWhich GPU is the main one in a multi-GPU machine.
the GPU to use for the model (with split-mode = none), or for intermediate results and KV (with split-mode = row) (default: 0)
How the processor gets used. With every layer on the GPU, these matter much less.
-t, --threads NHow many CPU threads to use while generating. The default picks automatically. Too many can actually slow things down.
Tip: The automatic choice is usually fine. Matters little when every layer is on the GPU.
number of CPU threads to use during generation (default: -1)
-tb, --threads-batch NThe same as --threads, but for reading the prompt. It defaults to the --threads value.
number of threads to use during batch and prompt processing (default: same as --threads)
-C, --cpu-mask MRestricts generation to certain CPU cores, using a hex bitmask.
CPU affinity mask: arbitrarily long hex. Complements cpu-range (default: "")
-Cr, --cpu-range lo-hiRestricts generation to a range of CPU cores, such as 0-5. An easier form of --cpu-mask.
range of CPUs for affinity. Complements --cpu-mask
--cpu-strict <0|1>Forces threads to stay on the exact cores you selected instead of letting the system move them.
use strict CPU placement (default: 0)
--prio NHow strongly the system should favor this process over others, from low to realtime. High values can make the rest of your desktop sluggish.
set process/thread priority : low(-1), normal(0), medium(1), high(2), realtime(3) (default: 0)
--poll <0...100>How actively threads wait for work. Higher responds faster but burns more CPU while waiting. 0 waits quietly.
use polling level to wait for work (0 - no polling, default: 50)
-Cb, --cpu-mask-batch MThe same as --cpu-mask, for prompt processing.
CPU affinity mask: arbitrarily long hex. Complements cpu-range-batch (default: same as --cpu-mask)
-Crb, --cpu-range-batch lo-hiThe same as --cpu-range, for prompt processing.
ranges of CPUs for affinity. Complements --cpu-mask-batch
--cpu-strict-batch <0|1>The same as --cpu-strict, for prompt processing.
use strict CPU placement (default: same as --cpu-strict)
--prio-batch NThe same as --prio, for prompt processing.
set process/thread priority : 0-normal, 1-medium, 2-high, 3-realtime (default: 0)
--poll-batch <0|1>The same as --poll, for prompt processing.
use polling to wait for work (default: same as --poll)
--threads-http NHow many threads handle incoming web requests. Automatic is fine unless many clients connect at once.
number of threads used to process HTTP requests (default: -1)
--numa TYPEOptimizations for multi-socket servers, where parts of the RAM are closer to some CPUs than others.
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
How the model picks each next word. These change the feel of replies, not what the model knows.
--temp, --temperature NThe main creativity dial. Lower gives focused, predictable answers and higher gives varied, surprising ones. 0 nearly always picks the single most likely word.
Tip: Check your model's documentation, which often recommends a value.
temperature (default: 0.80)
--top-p NKeeps only the most likely next words until their combined probability reaches this value, then picks from those. Lower is more focused. 1.0 turns it off.
top-p sampling (default: 0.95, 1.0 = disabled)
--min-p NRemoves any word whose chance is below this fraction of the top word's chance. It trims unlikely words while adapting to how sure the model is. 0 turns it off.
Tip: Check your model's documentation, which sometimes recommends turning this off.
min-p sampling (default: 0.05, 0.0 = disabled)
-s, --seed SEEDThe random starting number. The same seed, prompt and settings should produce a very similar reply, which is useful for testing. -1 picks a random seed each time.
RNG seed (default: -1, use random seed for -1)
--top-k NOnly considers the K most likely next words. Lower is more conservative. 0 turns it off.
top-k sampling (default: 40, 0 = disabled)
--repeat-last-n NHow many recent tokens the repeat penalties look back over. 0 turns this off.
last n tokens to consider for penalize (default: 64, 0 = disabled)
--repeat-penalty NMakes recently used words less likely, which helps when a model gets stuck repeating itself. 1.0 is off. Too high makes writing feel strained.
penalize repeat sequence of tokens (default: 1.00, 1.0 = disabled)
--samplers SAMPLERSSets which sampling steps run and in what order, written out by name. Order matters, because each step filters what the next one sees.
samplers that will be used for generation in the order, separated by ';' (default: penalties;dry;top_n_sigma;top_k;typ_p;top_p;min_p;xtc;temperature)
--sampler-seq, --sampling-seq SEQUENCEThe same as --samplers, written as a short string of single letters.
simplified sequence for samplers that will be used (default: edskypmxt)
--top-nsigma, --top-n-sigma NKeeps words that score within a set statistical distance of the best one. An alternative to top-k and top-p. -1 is off.
top-n-sigma sampling (default: -1.00, -1.0 = disabled)
--xtc-probability NHow often XTC runs. XTC sometimes removes the most obvious word choices to force more variety. 0 is off.
xtc probability (default: 0.00, 0.0 = disabled)
--xtc-threshold NHow likely a word must be for XTC to count it as obvious and remove it.
xtc threshold (default: 0.10, 1.0 = disabled)
--typical, --typical-p NFavors words of typical likelihood instead of only the most likely, which can make writing feel more natural. 1.0 is off.
locally typical sampling, parameter p (default: 1.00, 1.0 = disabled)
--presence-penalty NDiscourages any word that has already appeared, however often, which nudges the model toward new topics. 0 is off.
repeat alpha presence penalty (default: 0.00, 0.0 = disabled)
--frequency-penalty NDiscourages words in proportion to how often they've appeared. 0 is off.
repeat alpha frequency penalty (default: 0.00, 0.0 = disabled)
--dry-multiplier NThe strength of DRY, a penalty that targets repeated phrases rather than single words. 0 is off, and DRY needs this set to do anything.
set DRY sampling multiplier (default: 0.00, 0.0 = disabled)
--dry-base NHow quickly the DRY penalty grows as a repeated phrase gets longer.
set DRY sampling base value (default: 1.75)
--dry-allowed-length NHow long a repeated phrase can be before DRY starts penalizing it.
set allowed length for DRY sampling (default: 2)
--dry-penalty-last-n NHow far back DRY looks for repeats. 0 turns it off.
set DRY penalty for the last n tokens (default: 64, 0 = disable)
--dry-sequence-breaker STRINGCharacters that reset DRY's repeat matching. Setting your own replaces the defaults (newline, colon, quote, asterisk). Use none for no breakers.
add sequence breaker for DRY sampling, clearing out default breakers
('\n', ':', '"', '*') in the process; use "none" to not use any
sequence breakers--adaptive-target NAdaptive-P aims for words near a chosen probability and adjusts over time, which gives a steadier feel across a long reply. Negative values turn it off.
adaptive-p: select 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 NHow fast Adaptive-P reacts. Lower is more reactive and higher is more stable.
adaptive-p: 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 NLets temperature vary by this amount during a reply, based on how sure the model is. 0 is off.
dynamic temperature range (default: 0.00, 0.0 = disabled)
--dynatemp-exp NShapes how strongly dynamic temperature responds to the model's uncertainty.
dynamic temperature exponent (default: 1.00)
--mirostat NAn older self-adjusting method that aims for a steady level of surprise. Turning it on makes the server ignore top-k, top-p and typical sampling.
use Mirostat sampling. Top K, Nucleus and Locally Typical samplers are ignored if used. (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0)
--mirostat-lr NHow quickly Mirostat adjusts.
Mirostat learning rate, parameter eta (default: 0.10)
--mirostat-ent NThe level of surprise Mirostat aims for. Lower gives more focused text.
Mirostat target entropy, parameter tau (default: 5.00)
-bs, --backend-samplingExperimental. Runs sampling on the GPU instead of the CPU.
enable backend sampling (experimental) (default: disabled)
Limits and hard rules on what the model is allowed to write.
-n, --predict, --n-predict NThe longest reply allowed, in tokens. -1 means no limit other than the context window. A cap stops a thinking model from running away, but a low one can cut its answers short.
number of tokens to predict (default: -1, -1 = infinity)
-j, --json-schema SCHEMAForces replies to be JSON that matches a schema you give. Useful for apps that need to parse the answer. This applies to all requests, so setting it per request in the API is usually better.
JSON schema to constrain generations (https://json-schema.org/), e.g.
`{"type": "object"}` for any JSON object-jf, --json-schema-file FILEThe same as --json-schema, read from a file.
File containing a JSON schema to constrain generations
(https://json-schema.org/), e.g. `{"type": "object"}` for any JSON
object-e, --escape, --no-escapeWhether sequences like \n in text you pass on the command line become real newlines. On by default.
whether to process escapes sequences (\n, \r, \t, \', \", \\) (default: true)
--ignore-eosMakes the model keep writing past the point where it would normally stop. It's for speed testing and will produce rambling in normal use.
ignore end of stream token and continue generating (implies --logit-bias EOS-inf)
-l, --logit-bias TOKEN_ID(+/-)BIASMakes one specific token more or less likely, by its ID number. Useful for banning a token outright, but you have to look up the ID first.
modifies the likelihood of token appearing in the completion, i.e. `--logit-bias 15043+1` to increase likelihood of token ' Hello', or `--logit-bias 15043-1` to decrease likelihood of token ' Hello'
--grammar GRAMMARForces replies to follow a formal pattern that you write in the GBNF grammar format, so only valid output can be produced.
BNF-like grammar to constrain generations (see samples in grammars/ dir)
--grammar-file FNAMEThe same as --grammar, read from a file.
file to read grammar from
-r, --reverse-prompt PROMPTStops generating when the model produces this exact text. Mostly for raw text completion. Chat models already know when to stop.
halt generation at PROMPT, return control in interactive mode
-sp, --specialShows special control tokens in the output instead of hiding them. Mostly useful for debugging.
special tokens output enabled (default: false)
Whether the model reasons before answering, and how the conversation gets formatted for it.
-rea, --reasoning [on|off|auto]Turns the model's thinking on or off. Off gives quicker answers, which often means less careful ones. Auto detects support from the chat template.
Tip: Try off if replies feel slow for simple questions.
Use reasoning/thinking in the chat ('on', 'off', or 'auto', default:
'auto' (detect from template))--chat-template-kwargs STRINGPasses extra settings to the chat template as JSON. For example, {"enable_thinking":false} on templates that use that setting.
sets additional params for the json template parser, must be a valid
json object string, e.g. '{"key1":"value1","key2":"value2"}'--jinja, --no-jinjaUses the full template engine to format the conversation for the model. Tools and thinking depend on it. On by default.
whether to use jinja template engine for chat (default: enabled)
--reasoning-budget NLimits how many tokens the model can spend thinking. -1 is unlimited, 0 ends thinking immediately, and any higher number is the budget.
token budget for thinking: -1 for unrestricted, 0 for immediate end, N>0 for token budget (default: -1)
--reasoning-preserve, --no-reasoning-preserveKeeps earlier thinking in the conversation history instead of only the latest message. This can improve continuity but uses more of your context window, so long chats fill up faster.
Tip: Turn it off with --no-reasoning-preserve to make your context window last longer.
preserve reasoning trace in the full history, not just the last assistant message (default: enabled) compatible with certain templates having 'supports_preserve_reasoning' capability example: https://docs.z.ai/guides/capabilities/thinking-mode#preserved-thinking
--reasoning-format FORMATHow thinking is separated from the answer in API responses. It affects how apps and the web UI display it, not what the model thinks.
controls whether thought tags are allowed and/or extracted from the response, and in which format they're returned; one of: - none: leaves thoughts unparsed in `message.content` - deepseek: puts thoughts in `message.reasoning_content` - deepseek-legacy: keeps `<think>` tags in `message.content` while also populating `message.reasoning_content` (default: auto)
--reasoning-budget-message MESSAGEText inserted when the thinking budget runs out, such as a note telling the model to answer now.
message injected before the end-of-thinking tag when reasoning budget is exhausted (default: none)
--chat-template JINJA_TEMPLATEOverrides how messages are formatted for the model, either with template text or the name of a built-in format. A wrong template can make a good model behave badly, so only use this to fix a real problem.
set custom jinja chat template (default: template taken from model's metadata) if suffix/prefix are specified, template will be disabled only commonly used templates are accepted (unless --jinja is set before this flag): list of built-in templates: 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
--chat-template-file JINJA_TEMPLATE_FILEThe same as --chat-template, read from a file.
set custom jinja chat template file (default: template taken from model's metadata) if suffix/prefix are specified, template will be disabled only commonly used templates are accepted (unless --jinja is set before this flag): list of built-in templates: 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
--skip-chat-parsing, --no-skip-chat-parsingSends everything the model writes, including thinking and tool calls, as plain text instead of separating it. It's for debugging and breaks tool use in normal clients.
force a pure content parser, even if a Jinja template is specified; model will output everything in the content section, including any reasoning and/or tool calls (default: disabled)
--prefill-assistant, --no-prefill-assistantIf a request ends with an assistant message, continues that message instead of treating it as finished. The --no- form turns this off.
whether to prefill the assistant's response if the last message is an assistant message (default: prefill enabled) when this flag is set, if the last message is an assistant message then it will be treated as a full message and not prefilled
--reasoning-effort LEVELAsks the model to think lightly or deeply, from minimal to max, where the chat template supports it.
Tip: The chat template has to support this. The server's /props page lists the template's capabilities.
reasoning effort level given to the chat template: 'default' to keep the template default, or a level such as 'minimal', 'low', 'medium', 'high', 'xhigh' or 'max' (default: default)
What the model can do beyond writing text. llama.cpp marks these experimental, so read the warnings.
--tools TOOL1,TOOL2,...Lets the model use tools built into the server. Choose from read_file, file_glob_search, grep_search, exec_shell_command, write_file, edit_file and get_info, or use all. Experimental. Limits browser access to localhost by default.
Tip: These run with your user account's permissions, so they can read anything you can, including SSH keys. Start with the read-only ones.
experimental: whether to enable built-in tools for AI agents - do not enable in untrusted environments (default: no tools) specify "all" to enable all tools available tools: read_file, file_glob_search, grep_search, exec_shell_command, write_file, edit_file, get_info note: for security reasons, this will limit --cors-origins to localhost by default
--ui-mcp-proxy, --webui-mcp-proxy, --no-ui-mcp-proxy, --no-webui-mcp-proxyLets the web UI reach MCP servers that a browser would normally block. Experimental. Don't use it on an untrusted network.
experimental: whether to enable MCP CORS proxy - do not enable in untrusted environments (default: disabled)
--tools-runtime OPTIONRuns those tools somewhere separate from your main system, such as a Docker container or another machine over SSH. This is the safe way to allow file writes or shell commands.
Tip: Use this before you enable shell or file-writing tools.
experimental: run tools in a separate runtime environment (default: none, use host environment) available options: 'docker:<image>', 'podman:<image>': spin up a new container and reuse it for all invocations, clean up on server exit 'docker-container:<id>', 'podman-container:<id>': use an existing container by ID, won't stop on server exit 'ssh:<target>': run tools on a remote POSIX host over SSH, key-based auth and a trusted host key are required
--mcp-servers-config PATHConnects MCP servers listed in a JSON file, in the same format Cursor uses. MCP servers give the model abilities such as fetching web pages or using other apps. Experimental.
experimental: path to JSON file with MCP server definitions (Cursor-compatible format) - do not enable in untrusted environments (default: none) note: for security reasons, this will limit --cors-origins to localhost by default
-ag, --agent, -no-ag, --no-agentTurns on all built-in tools at once, including running shell commands, and the MCP proxy. A shortcut for full agent mode. Not recommended on your main system without --tools-runtime.
whether to enable CORS proxy and all built-in tools - do not enable in untrusted environments (default: disabled) note: for security reasons, this will limit --cors-origins to localhost by default
--mcp-servers-json JSONThe same as --mcp-servers-config, written directly on the command line.
experimental: inline JSON with MCP server definitions (Cursor-compatible format) - do not enable in untrusted environments (default: none) note: for security reasons, this will limit --cors-origins to localhost by default
Add-ons that change how the base model behaves.
--lora FNAMELoads a LoRA adapter on top of the base model. A LoRA is a small add-on that changes how the model behaves using extra training. It must have been trained for this base model.
Tip: It has to have been trained for the base model you're loading.
path to LoRA adapter (use comma-separated values to load multiple adapters)
--lora-scaled FNAME:SCALE,...The same as --lora, with a strength for each adapter, where 1.0 is full strength.
path to LoRA adapter with user defined scaling (format: FNAME:SCALE,...) note: use comma-separated values
--control-vector FNAMELoads a control vector, a way of steering a model's personality or tone without retraining it.
add a control vector note: use comma-separated values to add multiple control vectors
--control-vector-scaled FNAME:SCALE,...The same as --control-vector, with a strength for each vector.
add a control vector with user defined scaling SCALE note: use comma-separated values (format: FNAME:SCALE,...)
--control-vector-layer-range START ENDLimits a control vector to certain layers of the model.
layer range to apply the control vector(s) to, start and end inclusive
--lora-init-without-applyLoads adapters switched off so you can turn them on later through the API, without a restart.
load LoRA adapters without applying them (apply later via POST /lora-adapters) (default: disabled)
Who can reach the server and how.
--host HOSTWhich network address the server listens on. 127.0.0.1 means only this computer can reach it. 0.0.0.0 opens it to your whole network, so add an API key if you do that.
Tip: If you open it to your network, add --api-key too.
IP addresses to listen on, comma-separated, or UNIX socket paths ending in .sock; with multiple TCP addresses, :: binds IPv6 only; overlapping addresses result in undefined behavior (default: 127.0.0.1)
--port PORTThe port number in the web address. Run two servers at once by giving them different ports.
Tip: Run two servers at once by giving each its own port.
port to listen (default: 9931)
--cors-origins ORIGINSWhich websites' pages are allowed to call this server from a browser. The default of * allows any website. Setting localhost restricts it to pages on this computer.
Tip: With the default, any page open in your browser can reach the server. --cors-origins localhost closes that gap, and also stops this site's connection test from working.
comma-separated list of allowed origins for CORS (default: *) if set to special value 'localhost', reflect the Origin header only if it is localhost
--api-key KEYRequires a password-like key on API requests. Set this before exposing the server to anything beyond your own computer. Several keys can be comma-separated.
Tip: Keys on the command line can end up in shell history and process lists. --api-key-file avoids that.
API key to use for authentication, multiple keys can be provided as a comma-separated list (default: none)
--api-key-file FNAMEThe same as --api-key, read from a file with one key per line. This keeps keys off the command line, where other programs could see them.
path to file containing API keys, one per line; lines starting with a hash are treated as comments (default: none)
--reuse-portLets several server processes share one port, usually for load balancing.
allow multiple sockets to bind to the same port (default: disabled)
--cors-methods METHODSWhich kinds of web requests browser pages can make.
comma-separated list of allowed methods for CORS (default: GET, POST, DELETE, OPTIONS)
--cors-headers HEADERSWhich request headers browser pages can send.
comma-separated list of allowed headers for CORS (default: *)
--cors-credentials, --no-cors-credentialsWhether browser pages may include credentials such as cookies with their requests.
whether to allow credentials for CORS (default: enabled) note: if this is enabled and --cors-origins is set to * (default), the Origin header will be echoed back, and credentials will always be allowed
--api-prefix PREFIXServes everything under a path, such as /llm, for when the server sits behind a reverse proxy.
prefix path the server serves from, without the trailing slash (default: )
--ssl-key-file FNAMEThe private key for serving over HTTPS. Use together with --ssl-cert-file. Only needed if traffic leaves this computer without another layer protecting it.
path to file a PEM-encoded SSL private key
--ssl-cert-file FNAMEThe certificate for serving over HTTPS.
path to file a PEM-encoded SSL certificate
-to, --timeout NHow long a connection can sit before the server gives up, in seconds. The default is one hour.
server read/write timeout in seconds (default: 3600)
--sse-ping-interval NHow often the server sends keep-alive signals during streamed replies, so proxies don't close a slow connection. -1 turns it off.
server SSE ping interval in seconds (-1 = disabled, default: 30)
The chat page, and the extra pages the server can show.
--ui, --webui, --no-ui, --no-webuiTurns the chat web page on or off. On by default. --no-ui leaves only the API, for servers that only apps talk to.
whether to enable the Web UI (default: enabled)
-a, --alias STRINGThe display name for the model in the web UI and API, rather than the file name. Comma-separate several names.
set model name aliases, comma-separated (to be used by API)
--ui-config, --webui-config JSONSets the web UI's default settings using JSON, such as its theme or sampling defaults, so they apply on any browser.
JSON that provides default UI settings (overrides UI defaults)
--ui-config-file, --webui-config-file PATHThe same as --ui-config, read from a file.
JSON file that provides default UI settings (overrides UI defaults)
--metricsAdds a /metrics page with usage statistics such as speed and token counts, in the format Prometheus monitoring reads.
enable prometheus compatible metrics endpoint (default: disabled)
--slots, --no-slotsAdds a /slots page that shows what each chat slot is doing. On by default. Turn it off if you don't want prompts visible there.
expose slots monitoring endpoint (default: enabled)
--tags STRINGLabels attached to a model for your own information. They don't affect routing.
set model tags, comma-separated (informational, not used for routing)
--path PATHServes web files from this folder, which lets you replace the built-in web page with your own.
path to serve static files from (default: )
--propsAllows server properties to be changed through POST /props. Reading them is always possible. Off by default because it lets clients change settings.
enable changing global properties via POST /props (default: disabled)
Only for models built to take these inputs.
--mmproj-auto, --no-mmproj, --no-mmproj-autoWhen downloading with --hf-repo, controls whether the vision file comes with it. --no-mmproj skips it, which saves space and memory if you only want text.
whether to use multimodal projector file (if available), useful when using -hf (default: enabled)
--media-path PATHA folder of local media files that requests can refer to with file:// links. Off by default, because it gives clients access to that folder.
directory for loading local media files; files can be accessed via file:// URLs using relative paths (default: disabled)
-mm, --mmproj FILEThe vision file (mmproj) that lets a model see images or hear audio. Needs a file built for that specific model.
path to a multimodal projector file. see tools/mtmd/README.md note: if -hf is used, this argument can be omitted
-mmu, --mmproj-url URLThe same as --mmproj, downloaded from a web link.
URL to a multimodal projector file. see tools/mtmd/README.md
--mmproj-offload, --no-mmproj-offloadWhether the vision file runs on the GPU. --no-mmproj-offload keeps it on the CPU to save GPU memory.
whether to enable GPU offloading for multimodal projector (default: enabled)
-mmdev, --mmproj-device DEVICEWhich hardware runs the vision file.
device to use for multimodal projector (none = don't offload, default: follows --device) use --list-devices to see a list of available devices
--image-min-tokens NThe fewest tokens an image can use, on vision models with variable resolution.
minimum number of tokens each image can take, only used by vision models with dynamic resolution (default: read from model)
--image-max-tokens NThe most tokens an image can use. Lower saves context but gives the model less detail.
maximum number of tokens each image can take, only used by vision models with dynamic resolution (default: read from model)
--mtmd-batch-max-tokens NHow many image tokens to process in one step. Lower values use less memory.
maximum number of image tokens per batch when encoding images (default: 1024)
--video-fps NHow many frames per second to take from a video.
target video frame rate (default: 4.0)
--video-timestamp-interval NHow often to insert time markers into a video's text, in milliseconds.
interval in milliseconds between text timestamps (default: 5000)
--video-ffmpeg-dir DIRWhere to find ffmpeg and ffprobe, the video tools.
path to the directory containing ffmpeg and ffprobe (default: search in PATH)
Embeddings, reranking and code completion: jobs other than chat, usually needing a dedicated model.
--spm-infillChanges the order of the parts in code-completion prompts, because some models expect suffix, prefix, middle. Only matters for fill-in-the-middle use.
use Suffix/Prefix/Middle pattern for infill (instead of Prefix/Suffix/Middle) as some models prefer this. (default: disabled)
--pooling {none,mean,cls,last,rank}How an embedding model combines word-level results into one result.
pooling type for embeddings, use model default if unspecified
--embd-normalize NHow embedding numbers get scaled. The default of 2 suits typical similarity search.
normalisation for embeddings (default: 2) (-1=none, 0=max absolute int16, 1=taxicab, 2=euclidean, >2=p-norm)
--embedding, --embeddingsRuns the server for embeddings only. Embeddings turn text into numbers for search and comparison. Use it only with a dedicated embedding model.
Tip: Turning this on stops a chat model from chatting.
restrict to only support embedding use case; use only with dedicated embedding models (default: disabled)
--rerank, --rerankingAdds a reranking endpoint, which scores documents by how well they answer a query. It needs a dedicated reranking model.
enable reranking endpoint on server (default: disabled)
Run one server that switches between models.
--models-dir PATHStarts router mode, where one server offers every model in a folder and you pick one with the UI's model selector. This is how /model becomes useful.
Tip: This is what makes the web UI's model picker useful. On a small GPU, pair it with --models-max 1.
directory containing models for the router server (default: disabled)
--models-preset PATHAn INI file that lists models and the settings each one should use, such as its own context size. Lets you save your favorite setups.
path to INI file containing model presets for the router server (default: disabled)
--models-max NHow many models the router can hold in memory at once. Older ones are unloaded to make room. 0 means no limit.
Tip: On a small GPU, use 1.
for router server, maximum number of models to load simultaneously (default: 4, 0 = unlimited)
--models-autoload, --no-models-autoloadWhether the router loads a model automatically when a request asks for it. With this off, you load models yourself.
for router server, whether to automatically load models (default: enabled)
Guess several tokens ahead, then check them all at once. Most of this section tunes that same idea.
--spec-draft-model, -md, --model-draft FNAMEThe small second model that does the guessing.
Tip: A draft model needs room in memory too, and helps most on longer outputs.
draft model for speculative decoding (default: unused)
--spec-type none,draft-simple,draft-eagle3,draft-mtp,draft-dflash,draft-dspark,ngram-simple,ngram-map-k,ngram-map-k4v,ngram-mod,ngram-cacheChooses how guessing works, and you can list several. draft-* types use a second small model, while ngram-* types reuse patterns already in the text and need no extra model.
Tip: The ngram types use no extra GPU memory, so they're the easiest to try. They help most when replies repeat existing text, as in code edits.
comma-separated list of types of speculative decoding to use (default: none)
--spec-draft-type-k, -ctkd, --cache-type-k-draft TYPEThe context memory format for the draft model's keys. The draft version of --cache-type-k.
KV cache data type for K for the draft model allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1 (default: f16)
--spec-draft-type-v, -ctvd, --cache-type-v-draft TYPEThe context memory format for the draft model's values. The draft version of --cache-type-v.
KV cache data type for V for the draft model allowed values: f32, f16, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1 (default: f16)
--spec-draft-hf, -hfd, -hfrd, --hf-repo-draft <user>/<model>[:quant]The same as --hf-repo, for downloading the draft model.
Same as --hf-repo, but for the draft model (default: unused)
--spec-draft-threads, -td, --threads-draft NCPU threads for generating with the draft model.
number of threads to use during generation (default: same as --threads)
--spec-draft-threads-batch, -tbd, --threads-batch-draft NCPU threads for prompt processing with the draft model.
number of threads to use during batch and prompt processing (default: same as --threads-draft)
--spec-draft-cpu-mask, -Cd, --cpu-mask-draft MRestricts the draft model to certain CPU cores, using a hex bitmask.
Draft model CPU affinity mask. Complements cpu-range-draft (default: same as --cpu-mask)
--spec-draft-cpu-range, -Crd, --cpu-range-draft lo-hiRestricts the draft model to a range of CPU cores.
Ranges of CPUs for affinity. Complements --cpu-mask-draft
--spec-draft-cpu-strict, --cpu-strict-draft <0|1>Keeps draft model threads on exactly the cores you selected.
Use strict CPU placement for draft model (default: same as --cpu-strict)
--spec-draft-prio, --prio-draft NCPU priority for the draft model.
set draft process/thread priority : 0-normal, 1-medium, 2-high, 3-realtime (default: 0)
--spec-draft-poll, --poll-draft <0|1>How actively draft model threads wait for work.
Use polling to wait for draft model work (default: same as --poll)
--spec-draft-cpu-mask-batch, -Cbd, --cpu-mask-batch-draft MThe CPU core mask for the draft model's prompt processing.
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>Strict core placement for the draft model's prompt processing.
Use strict CPU placement for draft model (default: --cpu-strict-draft)
--spec-draft-prio-batch, --prio-batch-draft NCPU priority for the draft model's prompt processing.
set draft process/thread priority : 0-normal, 1-medium, 2-high, 3-realtime (default: 0)
--spec-draft-poll-batch, --poll-batch-draft <0|1>How actively threads wait during the draft model's prompt processing.
Use polling to wait for draft model work (default: --poll-draft)
--spec-draft-override-tensor, -otd, --override-tensor-draft <tensor name pattern>=<buffer type>,...Places specific parts of the draft model on a specific device. The draft version of --override-tensor.
override tensor buffer type for draft model
--spec-draft-cpu-moe, -cmoed, --cpu-moe-draftKeeps a Mixture of Experts draft model's expert weights on the CPU.
keep all Mixture of Experts (MoE) weights in the CPU for the draft model
--spec-draft-n-cpu-moe, --spec-draft-ncmoe, -ncmoed, --n-cpu-moe-draft NThe same, for only the draft model's first N layers.
keep the Mixture of Experts (MoE) weights of the first N layers in the CPU for the draft model
--spec-draft-n-max NThe most tokens to guess ahead at once.
number of tokens to draft for speculative decoding (default: 3)
--spec-draft-n-min NThe fewest guessed tokens worth checking. Shorter guesses get thrown away.
minimum number of draft tokens to use for speculative decoding (default: 0)
--spec-draft-p-split, --draft-p-split PThe split probability used when drafting: how likely an alternate token must be before a draft branches.
speculative decoding split probability (default: 0.10)
--spec-draft-p-min, --draft-p-min PHow confident the draft model must be to keep guessing. Higher means fewer but safer guesses.
minimum speculative decoding probability (greedy) (default: 0.00)
--spec-draft-backend-sampling, --no-spec-draft-backend-samplingRuns the draft model's sampling on the GPU. On by default.
offload draft sampling to the backend (default: enabled)
--spec-draft-sampling {greedy,probabilistic}How draft tokens get picked: always the top choice (greedy), or randomly with a verification step (probabilistic).
how the draft is sampled: greedy takes its argmax, probabilistic samples it and has the target verify by rejection sampling (default: greedy)
--spec-draft-device, -devd, --device-draft <dev1,dev2,..>Which hardware runs the draft model.
comma-separated list of devices to use for offloading the draft model (none = don't offload, default: follows --device) use --list-devices to see a list of available devices
--spec-draft-ngl, -ngld, --gpu-layers-draft, --n-gpu-layers-draft NHow many draft model layers run on the GPU.
max. number of draft model layers to store in VRAM, either an exact number, 'auto', or 'all' (default: auto)
--spec-ngram-mod-n-min Nngram-mod: the fewest tokens worth guessing at once.
minimum number of ngram tokens to use for ngram-based speculative decoding (default: 48)
--spec-ngram-mod-n-max Nngram-mod: the most tokens to guess at once.
maximum number of ngram tokens to use for ngram-based speculative decoding (default: 64)
--spec-ngram-mod-n-match Nngram-mod: how many recent tokens to match when looking for a pattern.
ngram-mod lookup length (default: 24)
--spec-ngram-simple-size-n Nngram-simple: how many recent tokens to match when looking for a pattern.
ngram size N for ngram-simple speculative decoding, length of lookup n-gram (default: 12)
--spec-ngram-simple-size-m Nngram-simple: how many tokens to guess after a match.
ngram size M for ngram-simple speculative decoding, length of draft m-gram (default: 48)
--spec-ngram-simple-min-hits Nngram-simple: how many times a pattern must appear before it's trusted.
minimum hits for ngram-simple speculative decoding (default: 1)
--spec-ngram-map-k-size-n Nngram-map-k: how many recent tokens to match when looking for a pattern.
ngram size N for ngram-map-k speculative decoding, length of lookup n-gram (default: 12)
--spec-ngram-map-k-size-m Nngram-map-k: how many tokens to guess after a match.
ngram size M for ngram-map-k speculative decoding, length of draft m-gram (default: 48)
--spec-ngram-map-k-min-hits Nngram-map-k: how many times a pattern must appear before it's trusted.
minimum hits for ngram-map-k speculative decoding (default: 1)
--spec-ngram-map-k4v-size-n Nngram-map-k4v: how many recent tokens to match when looking for a pattern.
ngram size N for ngram-map-k4v speculative decoding, length of lookup n-gram (default: 12)
--spec-ngram-map-k4v-size-m Nngram-map-k4v: how many tokens to guess after a match.
ngram size M for ngram-map-k4v speculative decoding, length of draft m-gram (default: 48)
--spec-ngram-map-k4v-min-hits Nngram-map-k4v: how many times a pattern must appear before it's trusted.
minimum hits for ngram-map-k4v speculative decoding (default: 1)
-lcs, --lookup-cache-static FNAMEA pre-built lookup file for pattern-based guessing. It doesn't change as the server runs.
path to static lookup cache to use for lookup decoding (not updated by generation)
-lcd, --lookup-cache-dynamic FNAMEA lookup file for pattern-based guessing that keeps learning as text is generated.
path to dynamic lookup cache to use for lookup decoding (updated by generation)
--spec-defaultTurns on a default speculative decoding setup. Speculative decoding guesses several tokens ahead and verifies them in one step, which can speed up replies without changing what the main model would normally write.
enable default speculative decoding config
--spec-synth-len LFake guess lengths for benchmarking the speculative system. Not for real use.
target mean synthetic acceptance length, including the target token (benchmarking only)
--spec-synth-rates P0,P1,...Fake guess success rates for benchmarking. Not for real use.
comma-separated unconditional per-position synthetic acceptance probabilities (benchmarking only)
See what the server is doing, or print information and exit.
-h, --help, --usagePrints the full list of options and exits. This page was built from its output.
print usage and exit
Prints information and exits, so run it on its own
--versionPrints the version and build, then exits.
show version and build info
Prints information and exits, so run it on its own
--perf, --no-perfTurns on detailed internal speed timings. Useful when you're benchmarking settings against each other.
whether to enable internal libllama performance timings (default: false)
--list-devicesLists the hardware the server can use, then exits. A quick way to confirm it sees your GPU.
print list of available devices and exit
Prints information and exits, so run it on its own
--log-file FNAMEWrites the log to a file, on top of showing it where the server is running.
Log to file
-lv, --verbosity, --log-verbosity NHow much detail to log, from 0 to 5. Raise it to see more detail about what the server is doing.
Set the verbosity threshold. Messages with a higher verbosity will be ignored. Values: - 0: generic output - 1: error - 2: warning - 3: info - 4: trace (more info) - 5: debug (default: 3)
--completion-bashPrints a script that adds Tab completion for these options to your terminal.
print source-able bash completion script for llama.cpp
Prints information and exits, so run it on its own
--check-tensorsChecks the model file for invalid numbers while loading. Useful if you suspect a corrupted download, and makes loading slower.
check model tensor data for invalid values (default: false)
--log-disableTurns off logging entirely. This makes problems much harder to diagnose.
Log disable
--log-jsonl, --no-log-jsonlWrites logs as JSON, one object per line, for other programs to read.
Log as JSONL (one JSON object per line) to stdout, this also disables colored logging (default: disabled)
--log-colors [on|off|auto]Controls colored log text. Auto uses color only in a terminal.
Set colored logging ('on', 'off', or 'auto', default: 'auto')
'auto' enables colors when output is to a terminal-v, --verbose, --log-verboseLogs everything. Output gets very large, so only use it when debugging.
Set verbosity level to infinity (i.e. log all messages, useful for debugging)
--log-prefix, --no-log-prefixAdds a prefix to each log line.
Enable prefix in log messages
--log-timestamps, --no-log-timestampsAdds the time to each log line.
Enable timestamps in log messages
--warmup, --no-warmupRuns an empty pass at startup so the first real reply isn't delayed. --no-warmup starts slightly faster.
whether to perform warmup with an empty run (default: enabled)
--log-prompts-dir PATHSaves every prompt to a folder for debugging. Your conversations will sit on disk in plain text, so turn it off when finished.
Log prompts to directory (auto-created if not present; only used for debugging, default: disabled)
Internal model settings. Leave these alone unless a model's documentation says otherwise.
--rope-scaling {none,linear,yarn}How the model handles positions in text when run beyond the context length it was trained on. Don't change this unless a model's documentation tells you to.
RoPE frequency scaling method, defaults to linear unless specified by the model
--rope-scale NStretches the model's position handling by a factor of N.
RoPE context scaling factor, expands context by a factor of N
--rope-freq-base NA base number for the model's position math. It's read from the model.
RoPE base frequency, used by NTK-aware scaling (default: loaded from model)
--rope-freq-scale NAnother way of stretching position handling, by a factor of 1/N.
RoPE frequency scaling factor, expands context by a factor of 1/N
--yarn-orig-ctx NYaRN is one method of extending context length. This is the context size the model was originally trained with.
YaRN: original context size of model (default: 0 = model training context size)
--yarn-ext-factor NA YaRN tuning value that mixes interpolation and extrapolation.
YaRN: extrapolation mix factor (default: -1.00, 0.0 = full interpolation)
--yarn-attn-factor NA YaRN tuning value for attention strength.
YaRN: scale sqrt(t) or attention magnitude (default: -1.00)
--yarn-beta-slow NA YaRN tuning value (high correction dimension).
YaRN: high correction dim or alpha (default: -1.00)
--yarn-beta-fast NA YaRN tuning value (low correction dimension).
YaRN: low correction dim or beta (default: -1.00)
--override-kv KEY=TYPE:VALUE,...Changes a value in the model's built-in metadata as it loads, without editing the file. For fixing badly packaged models.
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
Each one downloads a specific model and configures everything for it.
--fim-qwen-1.5b-defaultSets everything up for Qwen 2.5 Coder 1.5B, a code-completion model.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use default Qwen 2.5 Coder 1.5B (note: can download weights from the internet)
--fim-qwen-3b-defaultSets everything up for Qwen 2.5 Coder 3B, a code-completion model.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use default Qwen 2.5 Coder 3B (note: can download weights from the internet)
--vision-gemma-4b-defaultSets everything up for Gemma 3 4B, a vision-capable model.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use Gemma 3 4B QAT (note: can download weights from the internet)
--embd-gemma-defaultSets everything up for EmbeddingGemma, a text-embedding model.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use default EmbeddingGemma model (note: can download weights from the internet)
--fim-qwen-7b-defaultSets everything up for Qwen 2.5 Coder 7B, a code-completion model.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use default Qwen 2.5 Coder 7B (note: can download weights from the internet)
--fim-qwen-7b-specQwen 2.5 Coder 7B with a 0.5B helper model for faster output.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use Qwen 2.5 Coder 7B + 0.5B draft for speculative decoding (note: can download weights from the internet)
--fim-qwen-14b-specQwen 2.5 Coder 14B with a 0.5B helper model for faster output.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use Qwen 2.5 Coder 14B + 0.5B draft for speculative decoding (note: can download weights from the internet)
--fim-qwen-30b-defaultSets everything up for Qwen 3 Coder 30B.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use default Qwen 3 Coder 30B A3B Instruct (note: can download weights from the internet)
--gpt-oss-20b-defaultSets everything up for gpt-oss-20b.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use gpt-oss-20b (note: can download weights from the internet)
--gpt-oss-120b-defaultSets everything up for gpt-oss-120b.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use gpt-oss-120b (note: can download weights from the internet)
--vision-gemma-12b-defaultSets everything up for Gemma 3 12B, a vision-capable model.
Tip: Downloads a large model from the internet, so check that it fits your machine first.
use Gemma 3 12B QAT (note: can download weights from the internet)
Listed so you recognize them in old guides. Don't use these.
-dt, --defrag-thold NAn old setting for tidying context memory. Deprecated.
KV cache defragmentation threshold (DEPRECATED)
Removed or on its way out, so it can't be added here
--draft, --draft-n, --draft-max NRemoved in this build. The help text names its replacement. Use --spec-draft-n-max or --spec-ngram-mod-n-max.
the argument has been removed. use --spec-draft-n-max or --spec-ngram-mod-n-max
Removed or on its way out, so it can't be added here
--draft-min, --draft-n-min NRemoved in this build. The help text names its replacement. Use --spec-draft-n-min or --spec-ngram-mod-n-min.
the argument has been removed. use --spec-draft-n-min or --spec-ngram-mod-n-min
Removed or on its way out, so it can't be added here
--spec-ngram-size-n NRemoved in this build. The help text names its replacement. Use the matching --spec-ngram-*-size-n, or --spec-ngram-mod-n-match.
the argument has been removed. use the respective --spec-ngram-*-size-n or --spec-ngram-mod-n-match
Removed or on its way out, so it can't be added here
--spec-ngram-size-m NRemoved in this build. The help text names its replacement. Use the matching --spec-ngram-*-size-m.
the argument has been removed. use the respective --spec-ngram-*-size-m
Removed or on its way out, so it can't be added here
--spec-ngram-min-hits NRemoved in this build. The help text names its replacement. Use the matching --spec-ngram-*-min-hits.
the argument has been removed. use the respective --spec-ngram-*-min-hits
Removed or on its way out, so it can't be added here
Most of these 257 options exist for rare situations, and the defaults are sensible. Learn the 13 in Start here, then look up the rest when something specific bothers you, like slow replies, running out of memory or wanting tools.
-c and --ctx-size do the same thing.--no- form. --no-ui turns off --ui.This page builds the command in your browser, and nothing you type gets sent anywhere. Test connection only contacts the server on your own computer. Fonts load from Google Fonts.
Option names, defaults, environment variables and official text come from llama-server --help for version 0.6.0-dev, build 11564, commit 08ffba21e. It covers 414 flag spellings. Other builds differ, so check your own --help if a flag gets rejected. The plain-English text was written for this project and hasn't been tested option by option.
llama.cpp is MIT licensed, copyright The ggml authors. Icons are from Lucide (ISC, with Feather-derived icons under MIT). Design rules follow unslop by Damir Sokolovsky, CC BY 4.0, adapted for this layout. Upstream license notices are included in this page's source. Jumper Cables on GitHub.