此内容没有您所选择的语言版本。
Chapter 3. vLLM server usage
The vllm command provides subcommands for starting the inference server, generating chat and text completions, running benchmarks, and executing batch prompts.
vllm [-h] [-v] {chat,complete,serve,bench,collect-env,run-batch}
$ vllm [-h] [-v] {chat,complete,serve,bench,collect-env,run-batch}
- chat
- Generate chat completions via the running API server.
- complete
- Generate text completions based on the given prompt via the running API server.
- serve
- Start the vLLM OpenAI Compatible API server.
- bench
- vLLM bench subcommand.
- collect-env
- Start collecting environment information.
- run-batch
- Run batch prompts and write results to file.
3.1. vllm serve arguments 复制链接链接已复制到粘贴板!
vllm serve launches a local server that loads and serves the language model.
3.1.1. JSON CLI arguments 复制链接链接已复制到粘贴板!
-
--json-arg '{"key1": "value1", "key2": {"key3": "value2"}}' -
--json-arg.key1 value1 --json-arg.key2.key3 value2
Additionally, list elements can be passed individually using +:
-
--json-arg '{"key4": ["value3", "value4", "value5"]}' -
--json-arg.key4+ value3 --json-arg.key4+='value4,value5'
3.1.2. Options 复制链接链接已复制到粘贴板!
3.1.2.1. --headless 复制链接链接已复制到粘贴板!
Run in headless mode. See multi-node data parallel documentation for more details.
Default: False
3.1.2.2. --api-server-count, -asc 复制链接链接已复制到粘贴板!
How many API server processes to run.
Default: 1
3.1.2.3. --config 复制链接链接已复制到粘贴板!
Read CLI options from a config file. Must be a YAML with the following options: https://docs.vllm.ai/en/latest/configuration/serve_args.html
Default: None
3.1.2.4. --disable-log-stats 复制链接链接已复制到粘贴板!
Disable logging statistics.
Default: False
3.1.2.5. --aggregate-engine-logging 复制链接链接已复制到粘贴板!
Log aggregate rather than per-engine statistics when using data parallelism.
Default: False
3.1.2.6. --enable-log-requests, --no-enable-log-requests 复制链接链接已复制到粘贴板!
Enable logging requests.
Default: False
This argument is deprecated.
Disable logging requests.
Default: True
3.1.3. Frontend 复制链接链接已复制到粘贴板!
Arguments for the OpenAI-compatible frontend server.
3.1.3.1. --host 复制链接链接已复制到粘贴板!
Host name.
Default: None
3.1.3.2. --port 复制链接链接已复制到粘贴板!
Port number.
Default: 8000
3.1.3.3. --uds 复制链接链接已复制到粘贴板!
Unix domain socket path. If set, host and port arguments are ignored.
Default: None
3.1.3.4. --uvicorn-log-level 复制链接链接已复制到粘贴板!
Possible choices: critical, debug, error, info, trace, warning
Log level for uvicorn.
Default: info
Disable uvicorn access log.
Default: False
3.1.3.6. --allow-credentials, --no-allow-credentials 复制链接链接已复制到粘贴板!
Allow credentials.
Default: False
3.1.3.7. --allowed-origins 复制链接链接已复制到粘贴板!
Allowed origins.
Default: ['*']
3.1.3.8. --allowed-methods 复制链接链接已复制到粘贴板!
Allowed methods.
Default: ['*']
3.1.3.9. --allowed-headers 复制链接链接已复制到粘贴板!
Allowed headers.
Default: ['*']
3.1.3.10. --api-key 复制链接链接已复制到粘贴板!
If provided, the server will require one of these keys to be presented in the header.
Default: None
3.1.3.11. --lora-modules 复制链接链接已复制到粘贴板!
LoRA modules configurations in either 'name=path' format or JSON format or JSON list format. Example (old format): 'name=path' Example (new format): {"name": "name", "path": "lora_path", "base_model_name": "id"}
Default: None
3.1.3.12. --chat-template 复制链接链接已复制到粘贴板!
The file path to the chat template, or the template in single-line form for the specified model.
Default: None
3.1.3.13. --chat-template-content-format 复制链接链接已复制到粘贴板!
Possible choices: auto, openai, string
The format to render message content within a chat template.
-
"string" will render the content as a string. Example:
"Hello World" -
"openai" will render the content as a list of dictionaries, similar to OpenAI schema. Example:
[{"type": "text", "text": "Hello world!"}]
Default: auto
Whether to trust the chat template provided in the request. If False, the server will always use the chat template specified by --chat-template or the ones from tokenizer.
Default: False
3.1.3.15. --response-role 复制链接链接已复制到粘贴板!
The role name to return if request.add_generation_prompt=true.
Default: assistant
3.1.3.16. --ssl-keyfile 复制链接链接已复制到粘贴板!
The file path to the SSL key file.
Default: None
3.1.3.17. --ssl-certfile 复制链接链接已复制到粘贴板!
The file path to the SSL cert file.
Default: None
3.1.3.18. --ssl-ca-certs 复制链接链接已复制到粘贴板!
The CA certificates file.
Default: None
3.1.3.19. --enable-ssl-refresh, --no-enable-ssl-refresh 复制链接链接已复制到粘贴板!
Refresh SSL Context when SSL certificate files change
Default: False
3.1.3.20. --ssl-cert-reqs 复制链接链接已复制到粘贴板!
Whether client certificate is required (see stdlib ssl module’s).
Default: 0
3.1.3.21. --root-path 复制链接链接已复制到粘贴板!
FastAPI root_path when app is behind a path based routing proxy.
Default: None
3.1.3.22. --middleware 复制链接链接已复制到粘贴板!
Additional ASGI middleware to apply to the app. We accept multiple --middleware arguments. The value should be an import path. If a function is provided, vLLM will add it to the server using @app.middleware('http'). If a class is provided, vLLM will add it to the server using app.add_middleware().
Default: []
When --max-logprobs is specified, represents single tokens as strings of the form 'token_id:{token_id}' so that tokens that are not JSON-encodable can be identified.
Default: False
If specified, will run the OpenAI frontend server in the same process as the model serving engine.
Default: False
If specified, API server will add X-Request-Id header to responses.
Default: False
Enable auto tool choice for supported models. Use --tool-call-parser to specify which parser to use.
Default: False
If specified, exclude tool definitions in prompts when tool_choice='none'.
Default: False
3.1.3.28. --tool-call-parser 复制链接链接已复制到粘贴板!
Select the tool call parser depending on the model that you’re using. This is used to parse the model-generated tool call into OpenAI API format. Required for --enable-auto-tool-choice. You can choose any option from the built-in parsers or register a plugin via --tool-parser-plugin.
Default: None
3.1.3.29. --tool-parser-plugin 复制链接链接已复制到粘贴板!
Special the tool parser plugin write to parse the model-generated tool into OpenAI API format, the name register in this plugin can be used in --tool-call-parser.
Default: ""
3.1.3.30. --tool-server 复制链接链接已复制到粘贴板!
Comma-separated list of host:port pairs (IPv4, IPv6, or hostname). Examples: 127.0.0.1:8000, [::1]:8000, localhost:1234. Or demo for demo purpose.
Default: None
3.1.3.31. --log-config-file 复制链接链接已复制到粘贴板!
Path to logging config JSON file for both vllm and uvicorn
Default: None
3.1.3.32. --max-log-len 复制链接链接已复制到粘贴板!
Max number of prompt characters or prompt ID numbers being printed in log. The default of None means unlimited.
Default: None
Disable FastAPI’s OpenAPI schema, Swagger UI, and ReDoc endpoint.
Default: False
If set to True, enable prompt_tokens_details in usage.
Default: False
If set to True, enable tracking server_load_metrics in the app state.
Default: False
If set to True, including usage on every request.
Default: False
Enable the /tokenizer_info endpoint. May expose chat templates and other tokenizer configuration.
Default: False
3.1.3.38. --enable-log-outputs, --no-enable-log-outputs 复制链接链接已复制到粘贴板!
If True, log model outputs (generations). Requires --enable-log-requests.
Default: False
3.1.3.39. --h11-max-incomplete-event-size 复制链接链接已复制到粘贴板!
Maximum size (bytes) of an incomplete HTTP event (header or body) for h11 parser. Helps mitigate header abuse. Default: 4194304 (4 MB).
Default: 4194304
3.1.3.40. --h11-max-header-count 复制链接链接已复制到粘贴板!
Maximum number of HTTP headers allowed in a request for h11 parser. Helps mitigate header abuse. Default: 256.
Default: 256
3.1.3.41. --log-error-stack, --no-log-error-stack 复制链接链接已复制到粘贴板!
If set to True, log the stack trace of error responses
Default: False
3.1.3.42. --tokens-only, --no-tokens-only 复制链接链接已复制到粘贴板!
If set to True, only enable the Tokens In<>Out endpoint. This is intended for use in a Disaggregated Everything setup.
Default: False
3.1.4. ModelConfig 复制链接链接已复制到粘贴板!
Configuration for the model.
3.1.4.1. --model 复制链接链接已复制到粘贴板!
Name or path of the Hugging Face model to use. It is also used as the content for model_name tag in metrics output when served_model_name is not specified.
Default: Qwen/Qwen3-0.6B
3.1.4.2. --runner 复制链接链接已复制到粘贴板!
Possible choices: auto, draft, generate, pooling
The type of model runner to use. Each vLLM instance only supports one model runner, even if the same model can be used for multiple types.
Default: auto
3.1.4.3. --convert 复制链接链接已复制到粘贴板!
Possible choices: auto, classify, embed, none, reward
Convert the model using adapters defined in [vllm.model_executor.models.adapters][]. The most common use case is to adapt a text generation model to be used for pooling tasks.
Default: auto
3.1.4.4. --tokenizer 复制链接链接已复制到粘贴板!
Name or path of the Hugging Face tokenizer to use. If unspecified, model name or path will be used.
Default: None
3.1.4.5. --tokenizer-mode 复制链接链接已复制到粘贴板!
Possible choices: auto, deepseek_v32, hf, mistral, slow
Tokenizer mode:
-
"auto" will use the tokenizer from
mistral_commonfor Mistral models if available, otherwise it will use the "hf" tokenizer. - "hf" will use the fast tokenizer if available.
- "slow" will always use the slow tokenizer.
-
"mistral" will always use the tokenizer from
mistral_common. -
"deepseek_v32" will always use the tokenizer from
deepseek_v32. - Other custom values can be supported via plugins.
Default: auto
3.1.4.6. --trust-remote-code, --no-trust-remote-code 复制链接链接已复制到粘贴板!
Trust remote code (e.g., from HuggingFace) when downloading the model and tokenizer.
Default: False
3.1.4.7. --dtype 复制链接链接已复制到粘贴板!
Possible choices: auto, bfloat16, float, float16, float32, half
Data type for model weights and activations:
- "auto" will use FP16 precision for FP32 and FP16 models, and BF16 precision for BF16 models.
- "half" for FP16. Recommended for AWQ quantization.
- "float16" is the same as "half".
- "bfloat16" for a balance between precision and range.
- "float" is shorthand for FP32 precision.
- "float32" for FP32 precision.
Default: auto
3.1.4.8. --seed 复制链接链接已复制到粘贴板!
Random seed for reproducibility.
We must set the global seed because otherwise, different tensor parallel workers would sample different tokens, leading to inconsistent results.
Default: 0
3.1.4.9. --hf-config-path 复制链接链接已复制到粘贴板!
Name or path of the Hugging Face config to use. If unspecified, model name or path will be used.
Default: None
3.1.4.10. --allowed-local-media-path 复制链接链接已复制到粘贴板!
Allowing API requests to read local images or videos from directories specified by the server file system. This is a security risk. Should only be enabled in trusted environments.
Default: ""
3.1.4.11. --allowed-media-domains 复制链接链接已复制到粘贴板!
If set, only media URLs that belong to this domain can be used for multi-modal inputs.
Default: None
3.1.4.12. --revision 复制链接链接已复制到粘贴板!
The specific model version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
Default: None
3.1.4.13. --code-revision 复制链接链接已复制到粘贴板!
The specific revision to use for the model code on the Hugging Face Hub. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
Default: None
3.1.4.14. --tokenizer-revision 复制链接链接已复制到粘贴板!
The specific revision to use for the tokenizer on the Hugging Face Hub. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
Default: None
3.1.4.15. --max-model-len 复制链接链接已复制到粘贴板!
Model context length (prompt and output). If unspecified, will be automatically derived from the model config.
When passing via --max-model-len, supports k/m/g/K/M/G in human-readable format. Examples:
- 1k -> 1000
- 1K -> 1024
- 25.6k -> 25,600
Parse human-readable integers like '1k', '2M', etc. Including decimal values with decimal multipliers.
Examples: - '1k' -> 1,000 - '1K' -> 1,024 - '25.6k' -> 25,600
Examples:
- '1k' -> 1,000
- '1K' -> 1,024
- '25.6k' -> 25,600
Default: None
3.1.4.16. --quantization, -q 复制链接链接已复制到粘贴板!
Method used to quantize the weights. If None, we first check the quantization_config attribute in the model config file. If that is None, we assume the model weights are not quantized and use dtype to determine the data type of the weights.
Default: None
3.1.4.17. --enforce-eager, --no-enforce-eager 复制链接链接已复制到粘贴板!
Whether to always use eager-mode PyTorch. If True, we will disable CUDA graph and always execute the model in eager mode. If False, we will use CUDA graph and eager execution in hybrid for maximal performance and flexibility.
Default: False
3.1.4.18. --max-logprobs 复制链接链接已复制到粘贴板!
Maximum number of log probabilities to return when logprobs is specified in SamplingParams. The default value comes the default for the OpenAI Chat Completions API. -1 means no cap, i.e. all (output_length * vocab_size) logprobs are allowed to be returned and it may cause OOM.
Default: 20
3.1.4.19. --logprobs-mode 复制链接链接已复制到粘贴板!
Possible choices: processed_logits, processed_logprobs, raw_logits, raw_logprobs
Indicates the content returned in the logprobs and prompt_logprobs. Supported mode: 1) raw_logprobs, 2) processed_logprobs, 3) raw_logits, 4) processed_logits. Raw means the values before applying any logit processors, like bad words. Processed means the values after applying all processors, including temperature and top_k/top_p.
Default: raw_logprobs
Whether to disable sliding window. If True, we will disable the sliding window functionality of the model, capping to sliding window size. If the model does not support sliding window, this argument is ignored.
Default: False
Disable cascade attention for V1. While cascade attention does not change the mathematical correctness, disabling it could be useful for preventing potential numerical issues. Note that even if this is set to False, cascade attention will be only used when the heuristic tells that it’s beneficial.
Default: False
Skip initialization of tokenizer and detokenizer. Expects valid prompt_token_ids and None for prompt from the input. The generated output will contain token ids.
Default: False
If True, enables passing text embeddings as inputs via the prompt_embeds key.
The vLLM engine may crash if incorrect shape of embeddings is passed. Only enable this flag for trusted users!
Default: False
3.1.4.24. --served-model-name 复制链接链接已复制到粘贴板!
The model name(s) used in the API. If multiple names are provided, the server will respond to any of the provided names. The model name in the model field of a response will be the first name in this list. If not specified, the model name will be the same as the --model argument. Noted that this name(s) will also be used in model_name tag content of prometheus metrics, if multiple names provided, metrics tag will take the first one.
Default: None
3.1.4.25. --config-format 复制链接链接已复制到粘贴板!
Possible choices: auto, hf, mistral
The format of the model config to load:
- "auto" will try to load the config in hf format if available after trying to load in mistral format.
- "hf" will load the config in hf format.
- "mistral" will load the config in mistral format.
Default: auto
3.1.4.26. --hf-token 复制链接链接已复制到粘贴板!
The token to use as HTTP bearer authorization for remote files . If True, will use the token generated when running huggingface-cli login (stored in ~/.huggingface).
Default: None
3.1.4.27. --hf-overrides 复制链接链接已复制到粘贴板!
If a dictionary, contains arguments to be forwarded to the Hugging Face config. If a callable, it is called to update the HuggingFace config.
Default: {}
3.1.4.28. --pooler-config 复制链接链接已复制到粘贴板!
Pooler config which controls the behaviour of output pooling in pooling models.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.4.29. --logits-processor-pattern 复制链接链接已复制到粘贴板!
Optional regex pattern specifying valid logits processor qualified names that can be passed with the logits_processors extra completion argument. Defaults to None, which allows no processors.
Default: None
3.1.4.30. --generation-config 复制链接链接已复制到粘贴板!
The folder path to the generation config. Defaults to "auto", the generation config will be loaded from model path. If set to "vllm", no generation config is loaded, vLLM defaults will be used. If set to a folder path, the generation config will be loaded from the specified folder path. If max_new_tokens is specified in generation config, then it sets a server-wide limit on the number of output tokens for all requests.
Default: auto
3.1.4.31. --override-generation-config 复制链接链接已复制到粘贴板!
Overrides or sets generation config. e.g. {"temperature": 0.5}. If used with --generation-config auto, the override parameters will be merged with the default config from the model. If used with --generation-config vllm, only the override parameters are used.
Should either be a valid JSON string or JSON keys passed individually.
Default: {}
3.1.4.32. --enable-sleep-mode, --no-enable-sleep-mode 复制链接链接已复制到粘贴板!
Enable sleep mode for the engine (only cuda and hip platforms are supported).
Default: False
3.1.4.33. --model-impl 复制链接链接已复制到粘贴板!
Possible choices: auto, terratorch, transformers, vllm
Which implementation of the model to use:
- "auto" will try to use the vLLM implementation, if it exists, and fall back to the Transformers implementation if no vLLM implementation is available.
- "vllm" will use the vLLM model implementation.
- "transformers" will use the Transformers model implementation.
- "terratorch" will use the TerraTorch model implementation.
Default: auto
3.1.4.34. --override-attention-dtype 复制链接链接已复制到粘贴板!
Override dtype for attention
Default: None
3.1.4.35. --logits-processors 复制链接链接已复制到粘贴板!
One or more logits processors' fully-qualified class names or class definitions
Default: None
3.1.4.36. --io-processor-plugin 复制链接链接已复制到粘贴板!
IOProcessor plugin name to load at model startup
Default: None
3.1.5. LoadConfig 复制链接链接已复制到粘贴板!
Configuration for loading the model weights.
3.1.5.1. --load-format 复制链接链接已复制到粘贴板!
The format of the model weights to load:
- "auto" will try to load the weights in the safetensors format and fall back to the pytorch bin format if safetensors format is not available.
- "pt" will load the weights in the pytorch bin format.
- "safetensors" will load the weights in the safetensors format.
- "npcache" will load the weights in pytorch format and store a numpy cache to speed up the loading.
- "dummy" will initialize the weights with random values, which is mainly for profiling.
- "tensorizer" will use CoreWeave’s tensorizer library for fast weight loading. See the Tensorize vLLM Model script in the Examples section for more information.
- "runai_streamer" will load the Safetensors weights using Run:ai Model Streamer.
- "runai_streamer_sharded" will load weights from pre-sharded checkpoint files using Run:ai Model Streamer.
- "bitsandbytes" will load the weights using bitsandbytes quantization.
- "sharded_state" will load weights from pre-sharded checkpoint files, supporting efficient loading of tensor-parallel models.
- "gguf" will load weights from GGUF format files (details specified in https://github.com/ggml-org/ggml/blob/master/docs/gguf.md).
- "mistral" will load weights from consolidated safetensors files used by Mistral models.
- Other custom values can be supported via plugins.
Default: auto
3.1.5.2. --download-dir 复制链接链接已复制到粘贴板!
Directory to download and load the weights, default to the default cache directory of Hugging Face.
Default: None
3.1.5.3. --safetensors-load-strategy 复制链接链接已复制到粘贴板!
Specifies the loading strategy for safetensors weights.
- "lazy" (default): Weights are memory-mapped from the file. This enables on-demand loading and is highly efficient for models on local storage.
- "eager": The entire file is read into CPU memory upfront before loading. This is recommended for models on network filesystems (e.g., Lustre, NFS) as it avoids inefficient random reads, significantly speeding up model initialization. However, it uses more CPU RAM.
- "torchao": Weights are loaded in upfront and then reconstructed into torchao tensor subclasses. This is used when the checkpoint was quantized using torchao and saved using safetensors. Needs torchao >= 0.14.0
Default: lazy
3.1.5.4. --model-loader-extra-config 复制链接链接已复制到粘贴板!
Extra config for model loader. This will be passed to the model loader corresponding to the chosen load_format.
Default: {}
3.1.5.5. --ignore-patterns 复制链接链接已复制到粘贴板!
The list of patterns to ignore when loading the model. Default to "original/*/" to avoid repeated loading of llama’s checkpoints.
Default: ['original/**/*']
3.1.5.6. --use-tqdm-on-load, --no-use-tqdm-on-load 复制链接链接已复制到粘贴板!
Whether to enable tqdm for showing progress bar when loading model weights.
Default: True
3.1.5.7. --pt-load-map-location 复制链接链接已复制到粘贴板!
pt_load_map_location: the map location for loading pytorch checkpoint, to support loading checkpoints can only be loaded on certain devices like "cuda", this is equivalent to {"": "cuda"}. Another supported format is mapping from different devices like from GPU 1 to GPU 0: {"cuda:1": "cuda:0"}. Note that when passed from command line, the strings in dictionary needs to be double quoted for json parsing. For more details, see original doc for map_location in https://pytorch.org/docs/stable/generated/torch.load.html
Default: cpu
3.1.6. AttentionConfig 复制链接链接已复制到粘贴板!
Configuration for attention mechanisms in vLLM.
3.1.6.1. --attention-backend 复制链接链接已复制到粘贴板!
Attention backend to use. If None, will be selected automatically.
Default: None
3.1.7. StructuredOutputsConfig 复制链接链接已复制到粘贴板!
Dataclass which contains structured outputs config for the engine.
3.1.7.1. --reasoning-parser 复制链接链接已复制到粘贴板!
Select the reasoning parser depending on the model that you’re using. This is used to parse the reasoning content into OpenAI API format.
Default: ""
3.1.7.2. --reasoning-parser-plugin 复制链接链接已复制到粘贴板!
Path to a dynamically reasoning parser plugin that can be dynamically loaded and registered.
Default: ""
3.1.8. ParallelConfig 复制链接链接已复制到粘贴板!
Configuration for the distributed execution.
3.1.8.1. --distributed-executor-backend 复制链接链接已复制到粘贴板!
Possible choices: external_launcher, mp, ray, uni
Backend to use for distributed model workers, either "ray" or "mp" (multiprocessing). If the product of pipeline_parallel_size and tensor_parallel_size is less than or equal to the number of GPUs available, "mp" will be used to keep processing on a single host. Otherwise, an error will be raised. To use "mp" you must also set nnodes, and to use "ray" you must manually set distributed_executor_backend to "ray".
Note that tpu only support Ray for distributed inference.
Default: None
3.1.8.2. --pipeline-parallel-size, -pp 复制链接链接已复制到粘贴板!
Number of pipeline parallel groups.
Default: 1
3.1.8.3. --master-addr 复制链接链接已复制到粘贴板!
distributed master address for multi-node distributed inference when distributed_executor_backend is mp.
Default: 127.0.0.1
3.1.8.4. --master-port 复制链接链接已复制到粘贴板!
distributed master port for multi-node distributed inference when distributed_executor_backend is mp.
Default: 29501
3.1.8.5. --nnodes, -n 复制链接链接已复制到粘贴板!
num of nodes for multi-node distributed inference when distributed_executor_backend is mp.
Default: 1
3.1.8.6. --node-rank, -r 复制链接链接已复制到粘贴板!
distributed node rank for multi-node distributed inference when distributed_executor_backend is mp.
Default: 0
3.1.8.7. --tensor-parallel-size, -tp 复制链接链接已复制到粘贴板!
Number of tensor parallel groups.
Default: 1
3.1.8.8. --decode-context-parallel-size, -dcp 复制链接链接已复制到粘贴板!
Number of decode context parallel groups, because the world size does not change by dcp, it simply reuse the GPUs of TP group, and tp_size needs to be divisible by dcp_size.
Default: 1
3.1.8.9. --dcp-kv-cache-interleave-size 复制链接链接已复制到粘贴板!
Interleave size of kv_cache storage while using DCP. dcp_kv_cache_interleave_size has been replaced by cp_kv_cache_interleave_size, and will be deprecated when PCP is fully supported.
Default: 1
3.1.8.10. --cp-kv-cache-interleave-size 复制链接链接已复制到粘贴板!
Interleave size of kv_cache storage while using DCP or PCP. For total_cp_rank = pcp_rank * dcp_world_size + dcp_rank, and total_cp_world_size = pcp_world_size * dcp_world_size. store interleave_size tokens on total_cp_rank i, then store next interleave_size tokens on total_cp_rank i+1. Interleave_size=1: token-level alignment, where token i is stored on total_cp_rank i %% total_cp_world_size. Interleave_size=block_size: block-level alignment, where tokens are first populated to the preceding ranks. Tokens are then stored in (rank i+1, block j) only after (rank i, block j) is fully occupied. Block_size should be greater than or equal to cp_kv_cache_interleave_size. Block_size should be divisible by cp_kv_cache_interleave_size.
Default: 1
3.1.8.11. --prefill-context-parallel-size, -pcp 复制链接链接已复制到粘贴板!
Number of prefill context parallel groups.
Default: 1
3.1.8.12. --data-parallel-size, -dp 复制链接链接已复制到粘贴板!
Number of data parallel groups. MoE layers will be sharded according to the product of the tensor parallel size and data parallel size.
Default: 1
3.1.8.13. --data-parallel-rank, -dpn 复制链接链接已复制到粘贴板!
Data parallel rank of this instance. When set, enables external load balancer mode.
Default: None
3.1.8.14. --data-parallel-start-rank, -dpr 复制链接链接已复制到粘贴板!
Starting data parallel rank for secondary nodes.
Default: None
3.1.8.15. --data-parallel-size-local, -dpl 复制链接链接已复制到粘贴板!
Number of data parallel replicas to run on this node.
Default: None
3.1.8.16. --data-parallel-address, -dpa 复制链接链接已复制到粘贴板!
Address of data parallel cluster head-node.
Default: None
3.1.8.17. --data-parallel-rpc-port, -dpp 复制链接链接已复制到粘贴板!
Port for data parallel RPC communication.
Default: None
3.1.8.18. --data-parallel-backend, -dpb 复制链接链接已复制到粘贴板!
Backend for data parallel, either "mp" or "ray".
Default: mp
Whether to use "hybrid" DP LB mode. Applies only to online serving and when data_parallel_size > 0. Enables running an AsyncLLM and API server on a "per-node" basis where vLLM load balances between local data parallel ranks, but an external LB balances between vLLM nodes/replicas. Set explicitly in conjunction with --data-parallel-start-rank.
Default: False
Whether to use "external" DP LB mode. Applies only to online serving and when data_parallel_size > 0. This is useful for a "one-pod-per-rank" wide-EP setup in Kubernetes. Set implicitly when --data-parallel-rank is provided explicitly to vllm serve.
Default: False
Use expert parallelism instead of tensor parallelism for MoE layers.
Default: False
3.1.8.22. --all2all-backend 复制链接链接已复制到粘贴板!
Possible choices: allgather_reducescatter, deepep_high_throughput, deepep_low_latency, flashinfer_all2allv, naive, pplx, None
All2All backend for MoE expert parallel communication. If not set, uses the value from VLLM_ALL2ALL_BACKEND environment variable. Available options:
- "naive": Naive all2all implementation using broadcasts
- "allgather_reducescatter": All2all based on allgather and reducescatter
- "pplx": Use pplx kernels
- "deepep_high_throughput": Use deepep high-throughput kernels
- "deepep_low_latency": Use deepep low-latency kernels
- "flashinfer_all2allv": Use flashinfer alltoallv kernels for mnnvl
Default: None
3.1.8.23. --enable-dbo, --no-enable-dbo 复制链接链接已复制到粘贴板!
Enable dual batch overlap for the model executor.
Default: False
3.1.8.24. --dbo-decode-token-threshold 复制链接链接已复制到粘贴板!
The threshold for dual batch overlap for batches only containing decodes. If the number of tokens in the request is greater than this threshold, microbatching will be used. Otherwise, the request will be processed in a single batch.
Default: 32
3.1.8.25. --dbo-prefill-token-threshold 复制链接链接已复制到粘贴板!
The threshold for dual batch overlap for batches that contain one or more prefills. If the number of tokens in the request is greater than this threshold, microbatching will be used. Otherwise, the request will be processed in a single batch.
Default: 512
Forces the dp synchronization logic in vllm/v1/worker/dp_utils.py to use Gloo instead of NCCL for its all reduce
Default: False
3.1.8.27. --enable-eplb, --no-enable-eplb 复制链接链接已复制到粘贴板!
Enable expert parallelism load balancing for MoE layers.
Default: False
3.1.8.28. --eplb-config 复制链接链接已复制到粘贴板!
Expert parallelism configuration.
Should either be a valid JSON string or JSON keys passed individually.
Default: EPLBConfig(window_size=1000, step_interval=3000, num_redundant_experts=0, log_balancedness=False, use_async=False, policy='default')
3.1.8.29. --expert-placement-strategy 复制链接链接已复制到粘贴板!
Possible choices: linear, round_robin
The expert placement strategy for MoE layers:
- "linear": Experts are placed in a contiguous manner. For example, with 4 experts and 2 ranks, rank 0 will have experts [0, 1] and rank 1 will have experts [2, 3].
- "round_robin": Experts are placed in a round-robin manner. For example, with 4 experts and 2 ranks, rank 0 will have experts [0, 2] and rank 1 will have experts [1, 3]. This strategy can help improve load balancing for grouped expert models with no redundant experts.
Default: linear
3.1.8.30. --max-parallel-loading-workers 复制链接链接已复制到粘贴板!
Maximum number of parallel loading workers when loading model sequentially in multiple batches. To avoid RAM OOM when using tensor parallel and large models.
Default: None
Whether to profile Ray workers with nsight, see https://docs.ray.io/en/latest/ray-observability/user-guides/profiling.html#profiling-nsight-profiler.
Default: False
Disable the custom all-reduce kernel and fall back to NCCL.
Default: False
3.1.8.33. --worker-cls 复制链接链接已复制到粘贴板!
The full name of the worker class to use. If "auto", the worker class will be determined based on the platform.
Default: auto
3.1.8.34. --worker-extension-cls 复制链接链接已复制到粘贴板!
The full name of the worker extension class to use. The worker extension class is dynamically inherited by the worker class. This is used to inject new attributes and methods to the worker class for use in collective_rpc calls.
Default: ""
3.1.9. CacheConfig 复制链接链接已复制到粘贴板!
Configuration for the KV cache.
3.1.9.1. --block-size 复制链接链接已复制到粘贴板!
Possible choices: 1, 8, 16, 32, 64, 128, 256
Size of a contiguous cache block in number of tokens. On CUDA devices, only block sizes up to 32 are supported.
This config has no static default. If left unspecified by the user, it will be set in Platform.check_and_update_config() based on the current platform.
Default: None
3.1.9.2. --gpu-memory-utilization 复制链接链接已复制到粘贴板!
The fraction of GPU memory to be used for the model executor, which can range from 0 to 1. For example, a value of 0.5 would imply 50%% GPU memory utilization. If unspecified, will use the default value of 0.9. This is a per-instance limit, and only applies to the current vLLM instance. It does not matter if you have another vLLM instance running on the same GPU. For example, if you have two vLLM instances running on the same GPU, you can set the GPU memory utilization to 0.5 for each instance.
Default: 0.9
3.1.9.3. --kv-cache-memory-bytes 复制链接链接已复制到粘贴板!
Size of KV Cache per GPU in bytes. By default, this is set to None and vllm can automatically infer the kv cache size based on gpu_memory_utilization. However, users may want to manually specify the kv cache memory size. kv_cache_memory_bytes allows more fine-grain control of how much memory gets used when compared with using gpu_memory_utilization. Note that kv_cache_memory_bytes (when not-None) ignores gpu_memory_utilization
Parse human-readable integers like '1k', '2M', etc. Including decimal values with decimal multipliers.
Examples: - '1k' -> 1,000 - '1K' -> 1,024 - '25.6k' -> 25,600
Examples:
- '1k' -> 1,000
- '1K' -> 1,024
- '25.6k' -> 25,600
Default: None
3.1.9.4. --swap-space 复制链接链接已复制到粘贴板!
Size of the CPU swap space per GPU (in GiB).
Default: 4
3.1.9.5. --kv-cache-dtype 复制链接链接已复制到粘贴板!
Possible choices: auto, bfloat16, fp8, fp8_ds_mla, fp8_e4m3, fp8_e5m2, fp8_inc
Data type for kv cache storage. If "auto", will use model data type. CUDA 11.8+ supports fp8 (=fp8_e4m3) and fp8_e5m2. ROCm (AMD GPU) supports fp8 (=fp8_e4m3). Intel Gaudi (HPU) supports fp8 (using fp8_inc). Some models (namely DeepSeekV3.2) default to fp8, set to bfloat16 to use bfloat16 instead, this is an invalid option for models that do not default to fp8.
Default: auto
3.1.9.6. --num-gpu-blocks-override 复制链接链接已复制到粘贴板!
Number of GPU blocks to use. This overrides the profiled num_gpu_blocks if specified. Does nothing if None. Used for testing preemption.
Default: None
Whether to enable prefix caching.
Default: None
3.1.9.8. --prefix-caching-hash-algo 复制链接链接已复制到粘贴板!
Possible choices: sha256, sha256_cbor, xxhash, xxhash_cbor
Set the hash algorithm for prefix caching:
- "sha256" uses Pickle for object serialization before hashing. This is the current default, as SHA256 is the most secure choice to avoid potential hash collisions.
- "sha256_cbor" provides a reproducible, cross-language compatible hash. It serializes objects using canonical CBOR and hashes them with SHA-256.
-
"xxhash" uses Pickle serialization with xxHash (128-bit) for faster, non-cryptographic hashing. Requires the optional
xxhashpackage. IMPORTANT: Use of a hashing algorithm that is not considered cryptographically secure theoretically increases the risk of hash collisions, which can cause undefined behavior or even leak private information in multi-tenant environments. Even if collisions are still very unlikely, it is important to consider your security risk tolerance against the performance benefits before turning this on. -
"xxhash_cbor" combines canonical CBOR serialization with xxHash for reproducible hashing. Requires the optional
xxhashpackage.
Default: sha256
3.1.9.9. --cpu-offload-gb 复制链接链接已复制到粘贴板!
The space in GiB to offload to CPU, per GPU. Default is 0, which means no offloading. Intuitively, this argument can be seen as a virtual way to increase the GPU memory size. For example, if you have one 24 GB GPU and set this to 10, virtually you can think of it as a 34 GB GPU. Then you can load a 13B model with BF16 weight, which requires at least 26GB GPU memory. Note that this requires fast CPU-GPU interconnect, as part of the model is loaded from CPU memory to GPU memory on the fly in each model forward pass.
Default: 0
This enables dynamic calculation of k_scale and v_scale when kv_cache_dtype is fp8. If False, the scales will be loaded from the model checkpoint if available. Otherwise, the scales will default to 1.0.
Default: False
This feature is work in progress and no prefill optimization takes place with this flag enabled currently.
In some KV sharing setups, e.g. YOCO (https://arxiv.org/abs/2405.05254), some layers can skip tokens corresponding to prefill. This flag enables attention metadata for eligible layers to be overridden with metadata necessary for implementing this optimization in some models (e.g. Gemma3n)
Default: False
3.1.9.12. --mamba-cache-dtype 复制链接链接已复制到粘贴板!
Possible choices: auto, float16, float32
The data type to use for the Mamba cache (both the conv as well as the ssm state). If set to 'auto', the data type will be inferred from the model config.
Default: auto
3.1.9.13. --mamba-ssm-cache-dtype 复制链接链接已复制到粘贴板!
Possible choices: auto, float16, float32
The data type to use for the Mamba cache (ssm state only, conv state will still be controlled by mamba_cache_dtype). If set to 'auto', the data type for the ssm state will be determined by mamba_cache_dtype.
Default: auto
3.1.9.14. --mamba-block-size 复制链接链接已复制到粘贴板!
Size of a contiguous cache block in number of tokens for mamba cache. Can be set only when prefix caching is enabled. Value must be a multiple of 8 to align with causal_conv1d kernel.
Default: None
3.1.9.15. --kv-offloading-size 复制链接链接已复制到粘贴板!
Size of the KV cache offloading buffer in GiB. When TP > 1, this is the total buffer size summed across all TP ranks. By default, this is set to None, which means no KV offloading is enabled. When set with kv_offloading_backend, vLLM will enable KV cache offloading to CPU
Default: None
3.1.9.16. --kv-offloading-backend 复制链接链接已复制到粘贴板!
Possible choices: lmcache, native, None
The backend to use for KV cache offloading. Supported backends include 'native' (vLLM native CPU offloading), 'lmcache' This option must be used together with kv_offloading_size.
Default: None
3.1.10. MultiModalConfig 复制链接链接已复制到粘贴板!
Controls the behavior of multimodal models.
3.1.10.1. --limit-mm-per-prompt 复制链接链接已复制到粘贴板!
The maximum number of input items and options allowed per prompt for each modality. Defaults to 999 for each modality.
Legacy format (count only): {"image": 16, "video": 2}
Configurable format (with options): {"video": {"count": 1, "num_frames": 32, "width": 512, "height": 512}, "image": {"count": 5, "width": 512, "height": 512}}
Mixed format (combining both): {"image": 16, "video": {"count": 1, "num_frames": 32, "width": 512, "height": 512}}
Should either be a valid JSON string or JSON keys passed individually.
Default: {}
3.1.10.2. --enable-mm-embeds, --no-enable-mm-embeds 复制链接链接已复制到粘贴板!
If True, enables passing multimodal embeddings: for LLM class, this refers to tensor inputs under multi_modal_data; for the OpenAI-compatible server, this refers to chat messages with content "type": "*_embeds".
The vLLM engine may crash if incorrect shape of embeddings is passed. Only enable this flag for trusted users!
Default: False
3.1.10.3. --media-io-kwargs 复制链接链接已复制到粘贴板!
Additional args passed to process media inputs, keyed by modalities. For example, to set num_frames for video, set --media-io-kwargs '{"video": {"num_frames": 40} }'
Should either be a valid JSON string or JSON keys passed individually.
Default: {}
3.1.10.4. --mm-processor-kwargs 复制链接链接已复制到粘贴板!
Arguments to be forwarded to the model’s processor for multi-modal data, e.g., image processor. Overrides for the multi-modal processor obtained from transformers.AutoProcessor.from_pretrained.
The available overrides depend on the model that is being run.
For example, for Phi-3-Vision: {"num_crops": 4}.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.10.5. --mm-processor-cache-gb 复制链接链接已复制到粘贴板!
The size (in GiB) of the multi-modal processor cache, which is used to avoid re-processing past multi-modal inputs.
This cache is duplicated for each API process and engine core process, resulting in a total memory usage of mm_processor_cache_gb * (api_server_count + data_parallel_size).
Set to 0 to disable this cache completely (not recommended).
Default: 4
3.1.10.6. --mm-processor-cache-type 复制链接链接已复制到粘贴板!
Possible choices: lru, shm
Type of cache to use for the multi-modal preprocessor/mapper. If shm, use shared memory FIFO cache. If lru, use mirrored LRU cache.
Default: lru
3.1.10.7. --mm-shm-cache-max-object-size-mb 复制链接链接已复制到粘贴板!
Size limit (in MiB) for each object stored in the multi-modal processor shared memory cache. Only effective when mm_processor_cache_type is "shm".
Default: 128
3.1.10.8. --mm-encoder-tp-mode 复制链接链接已复制到粘贴板!
Possible choices: data, weights
Indicates how to optimize multi-modal encoder inference using tensor parallelism (TP).
-
"weights": Within the same vLLM engine, split the weights of each layer across TP ranks. (default TP behavior) -
"data": Within the same vLLM engine, split the batched input data across TP ranks to process the data in parallel, while hosting the full weights on each TP rank. This batch-level DP is not to be confused with API request-level DP (which is controlled by--data-parallel-size). This is only supported on a per-model basis and falls back to"weights"if the encoder does not support DP.
Default: weights
3.1.10.9. --mm-encoder-attn-backend 复制链接链接已复制到粘贴板!
Optional override for the multi-modal encoder attention backend when using vision transformers. Accepts any value from vllm.attention.backends.registry.AttentionBackendEnum (e.g. FLASH_ATTN).
Default: None
Enable fully interleaved support for multimodal prompts, while using --chat-template-content-format=string.
Default: False
3.1.10.11. --skip-mm-profiling, --no-skip-mm-profiling 复制链接链接已复制到粘贴板!
When enabled, skips multimodal memory profiling and only profiles with language backbone model during engine initialization.
This reduces engine startup time but shifts the responsibility to users for estimating the peak memory usage of the activation of multimodal encoder and embedding cache.
Default: False
3.1.10.12. --video-pruning-rate 复制链接链接已复制到粘贴板!
Sets pruning rate for video pruning via Efficient Video Sampling. Value sits in range [0;1) and determines fraction of media tokens from each video to be pruned.
Default: None
3.1.11. LoRAConfig 复制链接链接已复制到粘贴板!
Configuration for LoRA.
3.1.11.1. --enable-lora, --no-enable-lora 复制链接链接已复制到粘贴板!
If True, enable handling of LoRA adapters.
Default: None
3.1.11.2. --max-loras 复制链接链接已复制到粘贴板!
Max number of LoRAs in a single batch.
Default: 1
3.1.11.3. --max-lora-rank 复制链接链接已复制到粘贴板!
Possible choices: 1, 8, 16, 32, 64, 128, 256, 320, 512
Max LoRA rank.
Default: 16
3.1.11.4. --lora-dtype 复制链接链接已复制到粘贴板!
Data type for LoRA. If auto, will default to base model dtype.
Default: auto
3.1.11.5. --max-cpu-loras 复制链接链接已复制到粘贴板!
Maximum number of LoRAs to store in CPU memory. Must be >= than max_loras.
Default: None
By default, only half of the LoRA computation is sharded with tensor parallelism. Enabling this will use the fully sharded layers. At high sequence length, max rank or tensor parallel size, this is likely faster.
Default: False
3.1.11.7. --default-mm-loras 复制链接链接已复制到粘贴板!
Dictionary mapping specific modalities to LoRA model paths; this field is only applicable to multimodal models and should be leveraged when a model always expects a LoRA to be active when a given modality is present. Note that currently, if a request provides multiple additional modalities, each of which have their own LoRA, we do NOT apply default_mm_loras because we currently only support one lora adapter per prompt. When run in offline mode, the lora IDs for n modalities will be automatically assigned to 1-n with the names of the modalities in alphabetic order.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.12. ObservabilityConfig 复制链接链接已复制到粘贴板!
Configuration for observability - metrics and tracing.
3.1.12.2. --otlp-traces-endpoint 复制链接链接已复制到粘贴板!
Target URL to which OpenTelemetry traces will be sent.
Default: None
3.1.12.3. --collect-detailed-traces 复制链接链接已复制到粘贴板!
Possible choices: all, model, worker, None, model,worker, model,all, worker,model, worker,all, all,model, all,worker
It makes sense to set this only if --otlp-traces-endpoint is set. If set, it will collect detailed traces for the specified modules. This involves use of possibly costly and or blocking operations and hence might have a performance impact.
Note that collecting detailed timing information for each request can be expensive.
Default: None
3.1.12.4. --kv-cache-metrics, --no-kv-cache-metrics 复制链接链接已复制到粘贴板!
Enable KV cache residency metrics (lifetime, idle time, reuse gaps). Uses sampling to minimize overhead. Requires log stats to be enabled (i.e., --disable-log-stats not set).
Default: False
3.1.12.5. --kv-cache-metrics-sample 复制链接链接已复制到粘贴板!
Sampling rate for KV cache metrics (0.0, 1.0]. Default 0.01 = 1%% of blocks.
Default: 0.01
3.1.12.6. --cudagraph-metrics, --no-cudagraph-metrics 复制链接链接已复制到粘贴板!
Enable CUDA graph metrics (number of padded/unpadded tokens, runtime cudagraph dispatch modes, and their observed frequencies at every logging interval).
Default: False
Enable layerwise NVTX tracing. This traces the execution of each layer or module in the model and attach informations such as input/output shapes to nvtx range markers. Noted that this doesn’t work with CUDA graphs enabled.
Default: False
3.1.13. SchedulerConfig 复制链接链接已复制到粘贴板!
Scheduler configuration.
3.1.13.1. --max-num-batched-tokens 复制链接链接已复制到粘贴板!
Maximum number of tokens to be processed in a single iteration.
The default value here is mainly for convenience when testing. In real usage, this should be set in EngineArgs.create_engine_config.
Parse human-readable integers like '1k', '2M', etc. Including decimal values with decimal multipliers.
Examples: - '1k' -> 1,000 - '1K' -> 1,024 - '25.6k' -> 25,600
Examples:
- '1k' -> 1,000
- '1K' -> 1,024
- '25.6k' -> 25,600
Default: None
3.1.13.2. --max-num-seqs 复制链接链接已复制到粘贴板!
Maximum number of sequences to be processed in a single iteration.
The default value here is mainly for convenience when testing. In real usage, this should be set in EngineArgs.create_engine_config.
Default: None
3.1.13.3. --max-num-partial-prefills 复制链接链接已复制到粘贴板!
For chunked prefill, the maximum number of sequences that can be partially prefilled concurrently.
Default: 1
3.1.13.4. --max-long-partial-prefills 复制链接链接已复制到粘贴板!
For chunked prefill, the maximum number of prompts longer than long_prefill_token_threshold that will be prefilled concurrently. Setting this less than max_num_partial_prefills will allow shorter prompts to jump the queue in front of longer prompts in some cases, improving latency.
Default: 1
3.1.13.5. --long-prefill-token-threshold 复制链接链接已复制到粘贴板!
For chunked prefill, a request is considered long if the prompt is longer than this number of tokens.
Default: 0
3.1.13.6. --scheduling-policy 复制链接链接已复制到粘贴板!
Possible choices: fcfs, priority
The scheduling policy to use:
- "fcfs" means first come first served, i.e. requests are handled in order of arrival.
- "priority" means requests are handled based on given priority (lower value means earlier handling) and time of arrival deciding any ties).
Default: fcfs
If True, prefill requests can be chunked based on the remaining max_num_batched_tokens.
The default value here is mainly for convenience when testing. In real usage, this should be set in EngineArgs.create_engine_config.
Default: None
If set to true and chunked prefill is enabled, we do not want to partially schedule a multimodal item. Only used in V1 This ensures that if a request has a mixed prompt (like text tokens TTTT followed by image tokens IIIIIIIIII) where only some image tokens can be scheduled (like TTTTIIIII, leaving IIIII), it will be scheduled as TTTT in one step and IIIIIIIIII in the next.
Default: False
3.1.13.9. --scheduler-cls 复制链接链接已复制到粘贴板!
The scheduler class to use. "vllm.v1.core.sched.scheduler.Scheduler" is the default scheduler. Can be a class directly or the path to a class of form "mod.custom_class".
Default: None
If set to True, KV cache manager will allocate the same size of KV cache for all attention layers even if there are multiple type of attention layers like full attention and sliding window attention. If set to None, the default value will be determined based on the environment and starting configuration.
Default: None
3.1.13.11. --async-scheduling, --no-async-scheduling 复制链接链接已复制到粘贴板!
If set to True, perform async scheduling. This helps to avoid gaps in GPU utilization, leading to better latency and throughput. Async scheduling is currently not supported with some features such as speculative decoding and pipeline parallelism.
Default: False
3.1.13.12. --stream-interval 复制链接链接已复制到粘贴板!
The interval (or buffer size) for streaming in terms of token length. A smaller value (1) makes streaming smoother by sending each token immediately, while a larger value (e.g., 10) reduces host overhead and may increase throughput by batching multiple tokens before sending.
Default: 1
3.1.14. CompilationConfig 复制链接链接已复制到粘贴板!
Configuration for compilation.
3.1.14.1. --cudagraph-capture-sizes 复制链接链接已复制到粘贴板!
Sizes to capture cudagraph.
- None (default): capture sizes are inferred from vllm config.
- list[int]: capture sizes are specified as given.
Default: None
3.1.14.2. --max-cudagraph-capture-size 复制链接链接已复制到粘贴板!
The maximum cudagraph capture size.
If cudagraph_capture_sizes is specified, this will be set to the largest size in that list (or checked for consistency if specified). If cudagraph_capture_sizes is not specified, the list of sizes is generated automatically following the pattern:
[1, 2, 4] + list(range(8, 256, 8)) + list( range(256, max_cudagraph_capture_size + 1, 16))
[1, 2, 4] + list(range(8, 256, 8)) + list(
range(256, max_cudagraph_capture_size + 1, 16))
If not specified, max_cudagraph_capture_size is set to min(max_num_seqs*2, 512) by default. This voids OOM in tight memory scenarios with small max_num_seqs, and prevents capture of many large graphs (>512) that would greatly increase startup time with limited performance benefit.
Default: None
3.1.15. VllmConfig 复制链接链接已复制到粘贴板!
Dataclass which contains all vllm-related configuration. This simplifies passing around the distinct configurations in the codebase.
3.1.15.1. --speculative-config 复制链接链接已复制到粘贴板!
Speculative decoding configuration.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.15.2. --kv-transfer-config 复制链接链接已复制到粘贴板!
The configurations for distributed KV cache transfer.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.15.3. --kv-events-config 复制链接链接已复制到粘贴板!
The configurations for event publishing.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.15.4. --ec-transfer-config 复制链接链接已复制到粘贴板!
The configurations for distributed EC cache transfer.
Should either be a valid JSON string or JSON keys passed individually.
Default: None
3.1.15.5. --compilation-config, -cc 复制链接链接已复制到粘贴板!
torch.compile and cudagraph capture configuration for the model.
As a shorthand, one can append compilation arguments via -cc.parameter=argument such as -cc.mode=3 (same as -cc='{"mode":3}').
You can specify the full compilation config like so: {"mode": 3, "cudagraph_capture_sizes": [1, 2, 4, 8]}
Should either be a valid JSON string or JSON keys passed individually.
Default: {'level': None, 'mode': None, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': [], 'splitting_ops': None, 'compile_mm_encoder': False, 'compile_sizes': None, 'compile_ranges_split_points': None, 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': None, 'cudagraph_num_of_warmups': 0, 'cudagraph_capture_sizes': None, 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': None, 'pass_config': {}, 'max_cudagraph_capture_size': None, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False}, 'local_cache_dir': None}
3.1.15.6. --attention-config, -ac 复制链接链接已复制到粘贴板!
Attention configuration.
Should either be a valid JSON string or JSON keys passed individually.
Default: AttentionConfig(backend=None, flash_attn_version=None, use_prefill_decode_attention=False, flash_attn_max_num_splits_for_cuda_graph=32, use_cudnn_prefill=False, use_trtllm_ragged_deepseek_prefill=False, use_trtllm_attention=None, disable_flashinfer_prefill=False, disable_flashinfer_q_quantization=False)
3.1.15.7. --additional-config 复制链接链接已复制到粘贴板!
Additional config for specified platform. Different platforms may support different configs. Make sure the configs are valid for the platform you are using. Contents must be hashable.
Default: {}
3.1.15.8. --structured-outputs-config 复制链接链接已复制到粘贴板!
Structured outputs configuration.
Should either be a valid JSON string or JSON keys passed individually.
Default: StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='', reasoning_parser_plugin='', enable_in_reasoning=False)
3.1.15.9. --profiler-config 复制链接链接已复制到粘贴板!
Profiling configuration.
Should either be a valid JSON string or JSON keys passed individually.
Default: ProfilerConfig(profiler=None, torch_profiler_dir='', torch_profiler_with_stack=True, torch_profiler_with_flops=False, torch_profiler_use_gzip=True, torch_profiler_dump_cuda_time_total=True, torch_profiler_record_shapes=False, torch_profiler_with_memory=False, ignore_frontend=False, delay_iterations=0, max_iterations=0)
3.1.15.10. --optimization-level 复制链接链接已复制到粘贴板!
The optimization level. These levels trade startup time cost for performance, with -O0 having the best startup time and -O3 having the best performance. -02 is used by defult. See OptimizationLevel for full description.
Default: 2
3.2. vllm chat arguments 复制链接链接已复制到粘贴板!
Generate chat completions with the running API server.
vllm chat [options]
$ vllm chat [options]
- --api-key API_KEY
OpenAI API key. If provided, this API key overrides the API key set in the environment variables.
Default: None
- --model-name MODEL_NAME
The model name used in prompt completion, defaults to the first model in list models API call.
Default: None
- --system-prompt SYSTEM_PROMPT
The system prompt to be added to the chat template, used for models that support system prompts.
Default: None
- --url URL
URL of the running OpenAI-compatible RESTful API server
Default:
http://localhost:8000/v1- -q MESSAGE, --quick MESSAGE
Send a single prompt as
MESSAGEand print the response, then exit.Default: None
3.3. vllm complete arguments 复制链接链接已复制到粘贴板!
Generate text completions based on the given prompt with the running API server.
vllm complete [options]
$ vllm complete [options]
- --api-key API_KEY
API key for OpenAI services. If provided, this API key overrides the API key set in the environment variables.
Default: None
- --model-name MODEL_NAME
The model name used in prompt completion, defaults to the first model in list models API call.
Default: None
- --url URL
URL of the running OpenAI-compatible RESTful API server
Default:
http://localhost:8000/v1- -q PROMPT, --quick PROMPT
Send a single prompt and print the completion output, then exit.
Default: None
3.4. vllm bench arguments 复制链接链接已复制到粘贴板!
Benchmark online serving throughput.
vllm bench [options]
$ vllm bench [options]
- bench
Positional arguments:
-
latency- Benchmarks the latency of a single batch of requests. -
serve- Benchmarks the online serving throughput. -
throughput- Benchmarks offline inference throughput.
-
3.5. vllm collect-env arguments 复制链接链接已复制到粘贴板!
Collect environment information.
vllm collect-env
$ vllm collect-env
3.6. vllm run-batch arguments 复制链接链接已复制到粘贴板!
Run batch inference jobs for the specified model.
vllm run-batch
$ vllm run-batch
- --disable-log-requests
Disable logging requests.
Default: False
- --disable-log-stats
Disable logging statistics.
Default: False
- --enable-metrics
Enables Prometheus metrics.
Default: False
- --enable-prompt-tokens-details
Enables
prompt_tokens_detailsin usage when set to True.Default: False
- --max-log-len MAX_LOG_LEN
Maximum number of prompt characters or prompt ID numbers printed in the log.
Default: Unlimited
- --output-tmp-dir OUTPUT_TMP_DIR
The directory to store the output file before uploading it to the output URL.
Default: None
- --port PORT
Port number for the Prometheus metrics server. Only needed if
enable-metricsis set.Default: 8000
- --response-role RESPONSE_ROLE
The role name to return if
request.add_generation_prompt=True.Default: assistant
- --url URL
Prometheus metrics server URL. Only required if
enable-metricsis set).Default: 0.0.0.0
- --use-v2-block-manager
DEPRECATED. Block manager v1 has been removed.
SelfAttnBlockSpaceManager(block manager v2) is now the default. Setting--use-v2-block-managerflag to True or False has no effect on vLLM behavior.Default: True
- -i INPUT_FILE, --input-file INPUT_FILE
The path or URL to a single input file. Supports local file paths and HTTP or HTTPS. If a URL is specified, the file should be available using HTTP GET.
Default: None
- -o OUTPUT_FILE, --output-file OUTPUT_FILE
The path or URL to a single output file. Supports local file paths and HTTP or HTTPS. If a URL is specified, the file should be available using HTTP PUT.
Default: None