Skip to content

Command-line reference

nvserve [--threads N] [--prompt-threads N] <COMMAND>
Command Does
convert convert a GGUF model into an .nvpack file
inspect show a .gguf or .nvpack file's model and layout
verify check an .nvpack file, optionally against its source GGUF
run generate text
score measure perplexity on a text
serve serve the OpenAI-compatible HTTP API

nvserve <command> --help prints the same information. Sizes such as 4G accept the suffixes K, M and G (powers of 1024), with or without B/iB, and decimals such as 1.5G.

Global options

Option Default Meaning
--threads N half the cores, at least 4 compute threads; CANDLE_NUM_THREADS also sets it. See Threads
--prompt-threads N all cores but two, at least --threads threads for the Q4_K and Q6_K matmuls of prompt chunks (16 or more tokens); NVSERVE_PROMPT_THREADS also sets it

convert

nvserve convert [--force] <INPUT.gguf> <OUTPUT.nvpack>
Option Meaning
--force overwrite the output if it exists

inspect

nvserve inspect [--tensors] [--metadata] <FILE>
Option Meaning
--tensors also list every tensor (and, for .nvpack, its block)
--metadata also list every metadata key; long arrays are summarized

verify

nvserve verify [--against <SOURCE.gguf>] <PACK.nvpack>
Option Meaning
--against also compare with the source GGUF, tensor by tensor

Exits with status 1 if a problem is found.

Model options

run, score and serve share these options:

Option Default Meaning
<MODEL> the .nvpack file
--mem-limit SIZE none plan memory for this budget and cap the process at it (details)
--ctx N 2048 maximum context, prompt plus output, in tokens
--kv auto\|ram\|disk auto where the KV cache lives; auto keeps it in RAM if the budget allows
--kv-dir DIR temp dir (/var/tmp on Linux) folder for disk KV cache files
--expert-cache auto\|0\|SIZE auto MoE models: RAM for recently used experts
--expert-reads N 8 MoE models: expert reads in flight at once
--expert-prefetch N 8 MoE models: experts read ahead for the next layer (0 = off)
--prefill-chunk N 256 prompt tokens per pass; lower it to save memory on long prompts
--slots N 2 streaming buffers (2 = read the next layer while computing this one)
--readers N 1 reader threads per block
--chunk-mb N 64 read size per request with several readers
--buffered off read through the OS page cache instead of direct I/O
--resident off load all weights into RAM instead of streaming

run

nvserve run [model options] -p <PROMPT> [-p <PROMPT> ...] <MODEL>
Option Default Meaning
-p, --prompt TEXT the prompt; repeat it to generate for several prompts in one batch
--chat off wrap the prompt in the model's chat template
--system TEXT none system message (with --chat)
--no-think off with --chat, reasoning models answer without thinking first
-n, --max-tokens N 64 tokens to generate at most
--temperature T 0 0 is greedy
--top-k K 40
--top-p P 0.95
--seed N 0
--draft PACK none speculative decoding with a small draft model (guide)
--lookup off speculative decoding from earlier text, with no draft model
--draft-tokens auto\|N auto tokens drafted per pass; auto adapts between 1 and 8

--draft and --lookup work with a single --prompt.

score

nvserve score [model options] (--text TEXT | --file FILE) <MODEL>

Prints the mean negative log-likelihood and the perplexity of the text. The text must fit in --ctx tokens.

serve

nvserve serve [model options] [server options] <MODEL>
Option Default Meaning
--host ADDR 127.0.0.1 address to listen on
--port N 8080
--model-name NAME file name model id reported by /v1/models
--max-batch N 4 requests generated together (also capped by --mem-limit)
--default-max-tokens N 256 max_tokens when a request does not set it
--no-think off reasoning models answer directly unless a request enables thinking
--draft PACK, --lookup, --draft-tokens off speculative decoding while one request is generating

See The server and the HTTP API reference.

Environment variables

Variable Effect
CANDLE_NUM_THREADS compute threads, when --threads is not given
NVSERVE_PROMPT_THREADS prompt threads, when --prompt-threads is not given
NVSERVE_KERNELS candle uses candle's matmul kernels instead of NVserve's (for comparisons)
NVSERVE_BUILD pip installs only: v3 or compat picks the build instead of checking the CPU