Skip to content

vllm.entrypoints.common.cli_args

This file contains the command line arguments for the vLLM's online server. It is kept in a separate file for documentation purposes.

Classes:

  • BaseFrontendArgs –

    Base arguments for the OpenAI-compatible frontend server.

  • FrontendArgs –

    Arguments for the OpenAI-compatible frontend server.

Functions:

BaseFrontendArgs

Base arguments for the OpenAI-compatible frontend server.

This base class does not include host, port, and server-specific arguments like SSL, CORS, and HTTP server settings. Those arguments are added by the subclasses.

Methods:

  • add_cli_args –

    Register CLI arguments for this frontend class.

Attributes:

anthropic_disabled_thinking_effort = 'auto' class-attribute instance-attribute

The reasoning_effort used for Anthropic Messages, token counting, and render requests with thinking: {"type": "disabled"} or thinking: {"type": "between_tools"}. none turns thinking off for models that support it; low suits models that always think (e.g. GLM-5.3) or reject none (e.g. gpt-oss). auto (default) uses low when the renderer rejects none or renders it the same as a thinking effort, and none otherwise.

chat_template = None class-attribute instance-attribute

The file path to the chat template, or the template in single-line form for the specified model.

chat_template_content_format = 'auto' class-attribute instance-attribute

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!"}]

cohere_format = 'cmd4' class-attribute instance-attribute

Cohere --tokenizer-mode cohere only. Which Cohere prompt format to render: cmd4 (current Command A+ models; default) or cmd3 (earlier Cmd-A and Cmd-A reasoning models). Selecting the wrong format silently produces a prompt the model wasn't trained on, which most commonly manifests as the model emitting text but no citations / tool calls / thinking blocks. Equivalent to passing --default-chat-template-kwargs '{"cohere_format": "..."}' -- any explicit request-level chat_template_kwargs.cohere_format takes priority.

cohere_is_reasoning_model = True class-attribute instance-attribute

Cohere /cohere/v2/chat only. Whether the served model is a reasoning Command-family model. When True (default), the assistant's chain-of-thought is surfaced as a thinking content block (or content-* events on the stream). When False, reasoning is surfaced as Cohere's tool_plan field (or tool-plan-delta events) whenever the model emits tool calls, matching older non- reasoning Command models. Has no effect on the non-Cohere endpoints.

default_chat_template_kwargs = None class-attribute instance-attribute

Default keyword arguments to pass to the chat template renderer. These will be merged with request-level chat_template_kwargs, with request values taking precedence. Useful for setting default behavior for reasoning models. Example: '{"enable_thinking": false}' to disable thinking mode by default for Qwen3/DeepSeek models.

enable_auto_tool_choice = False class-attribute instance-attribute

Enable auto tool choice for supported models. Use --tool-call-parser to specify which parser to use.

enable_force_include_usage = False class-attribute instance-attribute

If set to True, including usage on every request.

enable_log_deltas = True class-attribute instance-attribute

If set to False, output deltas will not be logged. Relevant only if --enable-log-outputs is set.

enable_log_outputs = False class-attribute instance-attribute

If set to True, log model outputs (generations). Requires --enable-log-requests. Output text and finish reasons are logged at INFO, while output token IDs are logged at DEBUG.

enable_per_request_metrics = False class-attribute instance-attribute

If set to True, include per-request timing metrics in API responses.

enable_prompt_tokens_details = False class-attribute instance-attribute

If set to True, enable prompt_tokens_details in usage.

enable_scale_out = envs.VLLM_SERVER_DEV_MODE class-attribute instance-attribute

If set to True, register the scale-out endpoints (/render, /derender, /inference/v1/generate and /inference/v1/abort_requests) on vllm serve. Defaults to VLLM_SERVER_DEV_MODE. Has no effect on vllm launch render or vllm serve --tokens-only which always register their required endpoints regardless of this flag.

enable_server_load_tracking = False class-attribute instance-attribute

If set to True, enable tracking server_load_metrics in the app state.

enable_tokenizer_info_endpoint = False class-attribute instance-attribute

Enable the /tokenizer_info endpoint. May expose chat templates and other tokenizer configuration.

exclude_tools_when_tool_choice_none = False class-attribute instance-attribute

If specified, exclude tool definitions in prompts when tool_choice='none'.

fingerprint_mode = 'full' class-attribute instance-attribute

Controls the system_fingerprint field on responses.

  • full (default): vllm-<version>[-<parallelism>]-<hash8>. Encodes server version, non-trivial parallelism degrees (tp/pp/dp/ep), and an 8-char config hash.
  • hash: vllm-<version>-<hash8>. Parallelism stripped.
  • custom: emits the literal string from --fingerprint-value.
  • none: the field is omitted (serialized as null).

fingerprint_value = None class-attribute instance-attribute

Literal fingerprint string used when --fingerprint-mode=custom.

log_error_stack = envs.VLLM_SERVER_DEV_MODE class-attribute instance-attribute

If set to True, log the stack trace of error responses

lora_modules = None class-attribute instance-attribute

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"}

max_log_len = None class-attribute instance-attribute

Max number of prompt characters or prompt ID numbers being printed in log. The default of None means unlimited.

max_tokenize_tokens = None class-attribute instance-attribute

Maximum number of tokens allowed in /tokenize, /detokenize, and /v1/messages/count_tokens requests. Defaults to VLLM_MAX_TOKENIZE_TOKENS if set, otherwise max(max_model_len * 2, 131072). Set to <= 0 to disable the limit. Currently enforced on standard template rendering paths in the Python frontend (GPT-OSS Harmony rendering is not yet covered).

reasoning_effort_map = None class-attribute instance-attribute

JSON mapping that rewrites a request's reasoning effort to a value the chat template supports, for templates that silently fall back on efforts they do not recognize. Applies to the effort set through the Chat Completions, Responses, Anthropic Messages and /tokenize APIs; efforts not listed pass through unchanged. Example: '{"medium": "low", "xhigh": "max"}' for a template that only knows low, high and max.

response_role = 'assistant' class-attribute instance-attribute

The role name to return if request.add_generation_prompt=true.

return_tokens_as_token_ids = False class-attribute instance-attribute

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.

sse_keep_alive_interval = 0 class-attribute instance-attribute

Send an SSE keep-alive comment line every this many seconds when a /v1/chat/completions or /v1/completions streaming response is idle (queued, prefill, or between tokens), to prevent reverse proxies/tunnels with read timeouts from closing the connection. Defaults to 0, which disables keep-alive comments entirely.

tokens_only = False class-attribute instance-attribute

If set to True, only enable the Tokens In<>Out endpoint. This is intended for use in a Disaggregated Everything setup.

tool_call_parser = None class-attribute instance-attribute

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.

tool_parser_plugin = '' class-attribute instance-attribute

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.

tool_server = None class-attribute instance-attribute

Comma-separated list of host:port pairs (IPv4, IPv6, or hostname). Examples: 127.0.0.1:8000, [::1]:8000, localhost:1234. Or demo for built-in demo tools (browser and Python code interpreter). WARNING: The demo Python tool executes model-generated code in Docker without network isolation by default. See the security guide for more information.

tool_strict_level = None class-attribute instance-attribute

Server-side floor for structural-tag based tool calling, applied on top of the per-tool strict field. auto follows the request's tool choice and per-tool strictness; function constrains the tool-call envelope (markup and function name) for every request with tools; parameter additionally pins argument schemas, as if every tool were strict: true. When unset, the tool parser's default level applies, which is auto for most parsers.

trust_request_chat_template = False class-attribute instance-attribute

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.

trust_request_mm_kwargs = False class-attribute instance-attribute

Whether to trust per-request multimodal kwargs (mm_processor_kwargs and media_io_kwargs). If False, the server rejects non-empty values because they can change multimodal preprocessing resource usage. Only enable this when API clients are trusted.

_customize_cli_kwargs(frontend_kwargs) classmethod

Customize argparse kwargs before arguments are registered.

Subclasses should override this and call super()._customize_cli_kwargs(frontend_kwargs) first.

add_cli_args(parser) classmethod

Register CLI arguments for this frontend class.

Subclasses should override _customize_cli_kwargs instead of this method so that base-class postprocessing is always applied.

FrontendArgs

Bases: BaseFrontendArgs

Arguments for the OpenAI-compatible frontend server.

Attributes:

allow_credentials = False class-attribute instance-attribute

Allow credentials.

allowed_headers = field(default_factory=lambda: ['*']) class-attribute instance-attribute

Allowed headers.

allowed_methods = field(default_factory=lambda: ['*']) class-attribute instance-attribute

Allowed methods.

allowed_origins = field(default_factory=list) class-attribute instance-attribute

Allowed origins. Cross-origin browser access is disabled by default.

api_key = None class-attribute instance-attribute

If provided, the server will require one of these keys to be presented in the header.

Warning: this only authenticates endpoints under the /v1, /v2, /inference, and /cohere path prefixes. Other endpoints on the same server, including /invocations (which exposes the same inference capabilities as /v1), remain unauthenticated. Do not rely on --api-key alone to secure vLLM; see https://docs.vllm.ai/en/latest/usage/security.html#api-key-authentication-limitations for what it does and does not protect.

data_parallel_supervisor_port = 9256 class-attribute instance-attribute

HTTP port for aggregated health endpoints in multi-port external LB mode.

disable_access_log_for_endpoints = None class-attribute instance-attribute

Comma-separated list of endpoint paths to exclude from uvicorn access logs. This is useful to reduce log noise from high-frequency endpoints like health checks. Example: "/health,/metrics,/ping". When set, access logs for requests to these paths will be suppressed while keeping logs for other endpoints.

disable_fastapi_docs = False class-attribute instance-attribute

Disable FastAPI's OpenAPI schema, Swagger UI, and ReDoc endpoint.

disable_uvicorn_access_log = False class-attribute instance-attribute

Disable uvicorn access log.

dp_supervisor_probe_failure_threshold = 3 class-attribute instance-attribute

Number of consecutive connection-error retries before a child health probe is declared failed in multi-port external LB mode.

dp_supervisor_probe_interval_s = 5.0 class-attribute instance-attribute

Seconds between aggregated health probes in multi-port external LB mode.

dp_supervisor_probe_timeout_s = 5.0 class-attribute instance-attribute

Seconds to wait between retries when a child health probe fails with a connection error in multi-port external LB mode.

enable_flash_late_interaction = True class-attribute instance-attribute

If set, run pooling score MaxSim on GPU in the API server process. Can significantly improve late-interaction scoring performance. When disabled, the setting is also propagated to the engine's PoolerConfig, so the engine-side scorer uses the reference MaxSim path instead of the fused Triton kernel.

enable_offline_docs = False class-attribute instance-attribute

Enable offline FastAPI documentation for air-gapped environments. Uses vendored static assets bundled with vLLM.

enable_request_id_headers = False class-attribute instance-attribute

If specified, API server will add X-Request-Id header to responses.

enable_ssl_refresh = False class-attribute instance-attribute

Refresh SSL Context when SSL certificate files change

grpc_port = None class-attribute instance-attribute

Enable the Rust frontend's additional gRPC Inference and Control services on this port. Requires VLLM_USE_RUST_FRONTEND=1 vllm serve; HTTP remains on --port. Binds on --host, or 127.0.0.1 with --uds. Cannot be combined with the Python gRPC server's --grpc flag.

h11_max_header_count = H11_MAX_HEADER_COUNT_DEFAULT class-attribute instance-attribute

Maximum number of HTTP headers allowed in a request for h11 parser. Helps mitigate header abuse. Default: 256.

h11_max_incomplete_event_size = H11_MAX_INCOMPLETE_EVENT_SIZE_DEFAULT class-attribute instance-attribute

Maximum size (bytes) of an incomplete HTTP event (header or body) for h11 parser. Helps mitigate header abuse. Default: 4194304 (4 MB).

host = None class-attribute instance-attribute

Host name.

middleware = field(default_factory=lambda: []) class-attribute instance-attribute

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().

mm_tensor_refs_config = None class-attribute instance-attribute

Enable features.kwargs_refs in /inference/v1/generate, which loads processed multimodal tensors that clients upload to an S3-compatible store. Requires --enable-scale-out or --tokens-only. Off by default. Example: '{"s3_allowed_uri_prefix": "s3://bucket/prefix"}'.

port = 8000 class-attribute instance-attribute

Port number.

root_path = None class-attribute instance-attribute

FastAPI root_path when app is behind a path based routing proxy.

ssl_ca_certs = None class-attribute instance-attribute

The CA certificates file.

ssl_cert_reqs = int(ssl.CERT_NONE) class-attribute instance-attribute

Whether client certificate is required (see stdlib ssl module's).

ssl_certfile = None class-attribute instance-attribute

The file path to the SSL cert file.

ssl_ciphers = None class-attribute instance-attribute

SSL cipher suites for HTTPS (TLS 1.2 and below only). Example: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305'

ssl_keyfile = None class-attribute instance-attribute

The file path to the SSL key file.

uds = None class-attribute instance-attribute

Unix domain socket path. If set, host and port arguments are ignored.

uvicorn_log_level = 'info' class-attribute instance-attribute

Log level for uvicorn.

make_arg_parser(parser)

Create the CLI argument parser used by the OpenAI API server.

We rely on the helper methods of FrontendArgs and AsyncEngineArgs to register all arguments instead of manually enumerating them here. This avoids code duplication and keeps the argument definitions in one place.

propagate_flash_late_interaction(args, engine_args)

Propagate --disable-flash-late-interaction into the engine config.

The frontend flag alone only disables the API-server scoring path; mirroring it into PoolerConfig.enable_flash_late_interaction lets the engine-side scorer fall back to the reference MaxSim path too.

resolve_default_chat_template_kwargs(args, tokenizer_mode=None)

Resolve renderer defaults, including the dedicated Cohere format flag.

cohere_format is only injected for --tokenizer-mode cohere; other renderers don't consume it.

validate_grpc_port_arg(args)

Validate the Rust frontend's optional gRPC listener.

validate_parsed_serve_args(args)

Quick checks for model serve args that raise prior to loading.