Environment variables
Code version: vLLM @ 3e44c0d · 2026-10-22
In one sentence
Each VLLM_* setting is a lambda in one dict in vllm/envs.py; a read of envs.X calls the lambda, until a process turns on the cache.
Use this page in two ways. To learn the mechanism, read the first three sections. To look up one variable, go to All environment variables, or search for its name. The script tools/gen_env_vars.py makes the big tables from vllm/envs.py. The text above the tables is written by hand from the code.
How vLLM declares an environment variable#
An environment variable is a named text value that a process gets from its parent when it starts. vLLM declares each of its variables two times in vllm/envs.py.
- For type checkers. The
if TYPE_CHECKING:block at the top of the file gives each variable a type and a default. Python does not run this block, so these defaults have no effect at run time:if TYPE_CHECKING: VLLM_HOST_IP: str = "" VLLM_PORT: int | None = None VLLM_RPC_BASE_PATH: str = tempfile.gettempdir() VLLM_USE_MODELSCOPE: bool = False VLLM_USE_FASTOKENS: bool = False VLLM_RINGBUFFER_WARNING_INTERVAL: int = 60 - For the run time. The dict
environment_variablesmaps each name to a function with no arguments, mostly alambda(vllm/envs.py:618). The function readsos.environ, parses the text and returns the value. Its fallback value is the real default:"VLLM_LOGGING_CONFIG_PATH": lambda: os.getenv("VLLM_LOGGING_CONFIG_PATH"), # this is used for configuring the default logging level "VLLM_LOGGING_LEVEL": lambda: os.getenv("VLLM_LOGGING_LEVEL", "INFO").upper(), # this is used for configuring the default logging stream "VLLM_LOGGING_STREAM": lambda: os.getenv("VLLM_LOGGING_STREAM", "ext://sys.stdout"), # if set, VLLM_LOGGING_PREFIX will be prepended to all log messages "VLLM_LOGGING_PREFIX": lambda: os.getenv("VLLM_LOGGING_PREFIX", ""), # Controls colored logging output. Options: "auto" (default, colors when terminal), # "1" (always use colors), "0" (never use colors) "VLLM_LOGGING_COLOR": lambda: os.getenv("VLLM_LOGGING_COLOR", "auto"), # Standard unix flag for disabling ANSI color codes "NO_COLOR": lambda: os.getenv("NO_COLOR", "0") != "0", # De-facto standard flag for forcing ANSI color codes (e.g. non-tty case) "FORCE_COLOR": lambda: os.getenv("FORCE_COLOR", "0") != "0", # If set, vllm will log stats at this interval in seconds # If not set, vllm will log stats every 10 seconds. "VLLM_LOG_STATS_INTERVAL": lambda: ( val if (val := float(os.getenv("VLLM_LOG_STATS_INTERVAL", "10."))) > 0.0 else 10.0 ),VLLM_LOGGING_LEVELfalls back to"INFO".VLLM_LOG_STATS_INTERVALfalls back to 10 seconds, and also replaces a value of 0 or less with 10.
Other code imports the module (import vllm.envs as envs) and reads envs.VLLM_LOGGING_LEVEL. The module has no such attribute. So Python calls the module-level __getattr__, which calls the lambda:
def __getattr__(name: str):
"""Gets environment variables lazily.
NOTE: After enable_envs_cache() invocation (which triggered after service
initialization), all environment variables will be cached.
"""
if name in environment_variables:
return environment_variables[name]()
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")Two more helpers use the dict. envs.is_set("NAME") tells if the variable is in os.environ at all (vllm/envs.py:2344-2348). __dir__ returns all the names (vllm/envs.py:2340-2341).
How the text becomes a value#
Each lambda parses its own text. There is no shared rule for a boolean, so the same text can give different results. These are the common forms:
| Form in the lambda | Example | true | 1 | yes |
|---|---|---|---|---|
bool(int(os.getenv(...))) | VLLM_ENABLE_V1_MULTIPROCESSING (vllm/envs.py:1442-1444) | ValueError | True | ValueError |
os.getenv(...) == "1" | VLLM_SKIP_P2P_CHECK (vllm/envs.py:1207) | False | True | False |
.lower() == "true" | VLLM_DEBUG_LOG_API_SERVER_RESPONSE (vllm/envs.py:830-832) | True | False | False |
.lower() in ("1", "true") | VLLM_USE_MODELSCOPE (vllm/envs.py:735-737) | True | True | False |
maybe_convert_bool: unset gives None (vllm/envs.py:359-362) | VLLM_USE_V2_MODEL_RUNNER (vllm/envs.py:2147-2149) | ValueError | True | ValueError |
Variables with a fixed list of values use env_with_choices. It returns the default when the variable is not set, and raises ValueError for a value that is not in the list (vllm/envs.py:419-440). VLLM_WORKER_MULTIPROC_METHOD is an example (vllm/envs.py:938-940).
When vLLM reads a variable#
A read through envs.X runs the lambda again each time. So a change to os.environ has an effect at the next read. This stays true until the process calls enable_envs_cache():
def enable_envs_cache() -> None:
"""Enables caching of environment variables. This is useful for performance
reasons, as it avoids the need to re-evaluate environment variables on
every call.
NOTE: Currently, it's invoked after service initialization to reduce
runtime overhead. This also means that environment variables should NOT
be updated after the service is initialized.
"""
if _is_envs_cache_enabled():
# Avoid wrapping functools.cache multiple times
return
# Tag __getattr__ with functools.cache
global __getattr__
__getattr__ = functools.cache(__getattr__)
# Cache all environment variables
for key in environment_variables:
__getattr__(key)The function wraps __getattr__ in functools.cache and then reads every variable one time. After that, each read returns the cached value. Two places call it, at the end of their start-up:
- the EngineCore, as the last statement of
EngineCore.__init__, after the executor and the KV cache are ready (vllm/v1/engine/core.py:241-243,vllm/v1/engine/core.py:147,vllm/v1/engine/core.py:160). This also covers a worker that runs inside the engine core process; - each worker process of the multiprocessing executor, at the end of
WorkerProc.__init__(vllm/v1/executor/multiproc_executor.py:708-710).
No code in vllm/entrypoints/ calls it. So the front end process of vllm serve reads the environment again at each access. A code comment in the metrics code says the same: "processes that never enable the envs cache (the API server)" (vllm/v1/metrics/stats.py:479-481). cleanup_dist_env_and_memory removes the cache again with disable_envs_cache() (vllm/distributed/parallel_state.py:2543-2544).
Some code copies a value one time, at import, and the lambda never runs again for that copy:
from vllm.envs import VLLM_ENGINE_READY_TIMEOUT_Sin the engine core client (vllm/v1/engine/core_client.py:29). The start-up wait uses this copy (vllm/v1/engine/core_client.py:757-759).- The class body of the front-end arguments:
log_error_stack: bool = envs.VLLM_SERVER_DEV_MODE(vllm/entrypoints/common/cli_args.py:201). - The default logging dict of
vllm/logger.py, a module-level value (vllm/logger.py:75,vllm/logger.py:82).
Child processes get a copy of the parent environment when they start. The vllm CLI sets VLLM_WORKER_MULTIPROC_METHOD=spawn when the variable is not set (vllm/entrypoints/common/startup.py:147-149). The engine core processes and the worker processes get their start method from get_mp_context() (vllm/v1/engine/utils.py:256, vllm/v1/executor/multiproc_executor.py:723). With spawn, they start as new Python interpreters. They import vllm.envs again and read the environment that they got at start.
How to read the tables#
- Groups.
envs.pyhas only two section comments: "Installation Time Env Vars" and "Runtime Env Vars" (vllm/envs.py:619,vllm/envs.py:710). The group "Installation time" keeps the code's placement. The script splits the runtime variables into topics by name patterns. The topics are the tool's choice, not a structure in the code. - Type and default come from the
TYPE_CHECKINGblock. When the lambda falls back to another value, the row says so (but the read falls back to). A few variables have noTYPE_CHECKINGline; the row then shows the fallback of the lambda. - Description is the code comment above the dict key, quoted as it is. It is not in Simplified Technical English.
- Used in
vllm/counts the lines that readenvs.NAME,from vllm.envs import NAMEorenvs.is_set("NAME"), and links the first five. "Noenvs.*use" means that no Python file invllm/reads the variable throughenvs. The row then names other files that mention it, for examplesetup.pyor C++ code.
The 15 variables a serving operator meets first#
This list is a choice for online serving with vllm serve. Each default is the fallback of the lambda, not the TYPE_CHECKING value.
| Variable | Default | What it does in vllm serve |
|---|---|---|
VLLM_LOGGING_LEVEL | INFO, made upper case (vllm/envs.py:860) | The default of LoggingConfig.log_level (vllm/config/logging.py:26-28). The flag --log-level overrides it (vllm/engine/arg_utils.py:1646-1654). |
VLLM_PLUGINS | not set = load all plugins (vllm/envs.py:1160-1167) | A comma-separated list of plugin names. An empty text loads no plugins. load_plugins_by_group reads it (vllm/plugins/__init__.py:40). See How vLLM finds and loads plugins. |
VLLM_USE_V2_MODEL_RUNNER | not set = None (vllm/envs.py:2147-2149) | None lets VllmConfig.use_v2_model_runner decide; 1 or 0 forces the choice (vllm/config/vllm.py:730-732). There are two exceptions. HiSparse with 0 raises ValueError (vllm/config/vllm.py:714-719). Watermarking ignores 0 and uses Model Runner V2 (vllm/config/vllm.py:722-728). See The model runner (Model Runner V2). |
VLLM_LOG_STATS_INTERVAL | 10. seconds; 0 or less also gives 10 (vllm/envs.py:874-878) | The API server calls do_log_stats() at this interval when stats are on (vllm/entrypoints/launchers/utils/server_utils.py:78-84). |
VLLM_ENABLE_V1_MULTIPROCESSING | 1 (vllm/envs.py:1442-1444) | Only LLMEngine (the offline path) reads it (vllm/v1/engine/llm_engine.py:186-188). AsyncLLM always starts the engine core in a background process (vllm/v1/engine/async_llm.py:188-193), so the value does not change the process layout of vllm serve. |
VLLM_WORKER_MULTIPROC_METHOD | fork in envs.py (vllm/envs.py:938-940), but the CLI sets spawn (vllm/entrypoints/common/startup.py:147-149) | The start method of the engine core and worker processes. get_mp_context can still force spawn (vllm/utils/system_utils.py:192-200). |
VLLM_CHAT_TEMPLATE_RENDER_TIMEOUT | 30 seconds (vllm/envs.py:817-819) | The time limit for one chat template render. 0 turns the limit off. After the time, the renderer replaces its thread pool and raises TimeoutError (vllm/renderers/hf.py:1044-1056). |
VLLM_HOST_IP | empty (vllm/envs.py:723) | The IP address of this node for internal communication, read by get_ip() (vllm/utils/network_utils.py:52-53). It is not the API server address (--host) (docs/configuration/env_vars.md:5-6). |
VLLM_PORT | not set = None (vllm/envs.py:728, vllm/envs.py:527-528) | The first port for internal sockets; vLLM counts up from it (vllm/utils/network_utils.py:214-224). It is not the API server port (--port). A URI value, as Kubernetes sets for a service named vllm, raises ValueError (vllm/envs.py:534-541). |
VLLM_API_KEY | not set (vllm/envs.py:828) | The API key when --api-key is not given; the flag wins (vllm/entrypoints/serve/middleware/register.py:32-36). |
VLLM_CACHE_ROOT | $XDG_CACHE_HOME/vllm, else ~/.cache/vllm (vllm/envs.py:711-718, vllm/envs.py:339-343) | The root of vLLM's caches, for example the torch.compile cache in torch_compile_cache/<hash> (vllm/compilation/backends.py:1095-1097). |
VLLM_ENGINE_READY_TIMEOUT_S | 600 seconds (vllm/envs.py:810-814) | How long the front end waits for the engine cores to report ready. Slow weight loading is the usual cause of a timeout (vllm/v1/engine/core_client.py:757-768). |
VLLM_SERVER_DEV_MODE | 0 (vllm/envs.py:1463-1466) | Adds the development routes, for example /reset_prefix_cache (vllm/entrypoints/launchers/api_server/routers.py:46-49), and logs stack traces of error responses (vllm/entrypoints/common/cli_args.py:201-202). Do not use it in production. |
VLLM_KEEP_ALIVE_ON_ENGINE_DEATH | 0 (vllm/envs.py:1105-1109) | With 1, the API server does not stop after the engine fails (vllm/entrypoints/launchers/launcher.py:332-337). |
VLLM_HTTP_TIMEOUT_KEEP_ALIVE | 5 seconds (vllm/envs.py:1133-1136) | The HTTP keep-alive timeout that uvicorn gets (vllm/entrypoints/launchers/api_server/entry.py:152). |
Known issues#
Three defaults in TYPE_CHECKING do not match the read#
For these variables, the type hint says one default, but the lambda falls back to another. The lambda value is the real one.
| Variable | TYPE_CHECKING says | The lambda falls back to | Effect of the real default |
|---|---|---|---|
VLLM_SKIP_P2P_CHECK | False (vllm/envs.py:128) | "1", so True (vllm/envs.py:1207) | The custom all-reduce trusts the driver's peer-to-peer report and does not test it (vllm/distributed/device_communicators/custom_all_reduce.py:90-94). |
VLLM_DP_MASTER_IP | "" (vllm/envs.py:182) | "127.0.0.1" (vllm/envs.py:1503) | The data-parallel master address when the config falls back to the environment (vllm/config/parallel.py:1024-1028). |
VLLM_XGRAMMAR_CACHE_MB | 0 (vllm/envs.py:226) | "512" (vllm/envs.py:1689) | The xgrammar compiler cache gets 512 MiB (vllm/v1/structured_output/backend_xgrammar.py:223). |
A declared variable that no code reads#
VLLM_XLA_CHECK_RECOMPILATION is in the dict (vllm/envs.py:1086-1088), but no file in the repository mentions the name outside envs.py. So the variable has no effect.
Variables read outside envs.py#
Some names are in the dict, but code outside vllm/, or code that reads os.environ, uses them:
- C++:
VLLM_ROCM_SLEEP_MEM_CHUNK_SIZEis read withgetenvincsrc/cumem_allocator.cpp(csrc/cumem_allocator.cpp:26). The lambda and theenvscache do not apply. - Rust:
VLLM_CHAT_TEMPLATE_FUELis read by the experimental Rust front end (rust/src/chat/src/renderer/hf/mod.rs:106). No Python file outsideenvs.pyreads it, so the Python front end does not use it. - Python, with
os.environ:VLLM_ENABLE_CUDA_COMPATIBILITYandVLLM_CUDA_COMPATIBILITY_PATH(vllm/env_override.py:62-69), andVLLM_TRITON_FORCE_FIRST_CONFIG(vllm/env_override.py:976). These reads skip the lambda and theenvscache. - Build time only:
MAX_JOBS,NVCC_THREADS,VLLM_USE_PRECOMPILEDand other variables of the "Installation time" group have no reader invllm/.setup.pyloadsvllm/envs.pyas a separate module and reads them through it (setup.py:56,setup.py:218), so for these variables the lambda still gives the value. The Docker files also set them. The generated table names those files.
All environment variables#
317 variables in environment_variables (envs.py:618), in 20 groups. 24 have no envs.* use in vllm/. Type and default come from the TYPE_CHECKING block (envs.py:14).
Installation time (20)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:622 | str, "cuda" | Target device of vLLM, supporting [cuda (by default), rocm, cpu] | 2: platforms/__init__.py:176, platforms/__init__.py:244 |
VLLM_envs.py:624 | str, "13.0" | Main CUDA version of vLLM. This follows PyTorch but can be overridden. | no envs.* use; named in setup.py, docker/Dockerfile, docs/contributing/ci/nightly_builds.md |
VLLM_envs.py:629 | Literal["highest", "high", "medium"], "highest"choices: highest, high, medium | Controls PyTorch float32 matmul precision mode within vLLM workers. Valid options mirror torch.set_float32_matmul_precision | 1: v1/worker/gpu_worker.py:214 |
VLLM_envs.py:637 | bool, False | Enable batch-invariant mode: deterministic results regardless of batch composition. Requires NVIDIA GPU with compute capability >= 9.0. | 101: config/vllm.py:184, config/vllm.py:797, config/vllm.py:836, distributed/device_communicators/all_reduce_utils.py:135, distributed/device_communicators/all_reduce_utils.py:164 (+96 more) |
VLLM_envs.py:638 | bool, False | (no comment of its own) | 1: model_executor/layers/fused_embed_norm.py:58 |
VLLM_envs.py:648 | bool | None, None | Use tensor descriptors for Q/K/V loads and output stores in the Triton unified-attention kernel. Enables HW 2D block reads on Intel XPU; the non-TD branch is dead-code-eliminated at Triton compile time so other platforms see no overhead. Tri-state override: unset (default) lets the `triton_attn` backend auto-select per platform (currently auto-enabled on … | 5: model_executor/layers/fused_moe/utils.py:745, model_executor/layers/fused_moe/utils.py:767, model_executor/layers/fused_moe/utils.py:785, triton_utils/tensor_descriptor.py:11, v1/attention/backends/triton_attn.py:571 |
VLLM_envs.py:657 | Literal["warn", "error"] | None, Nonechoices: warn, error | If set, enable GPU<->CPU synchronization checking around the worker's `execute_model` and `sample_tokens` calls, via PyTorch's sync debug mode plus wrappers flagging `non_blocking` CPU<->CUDA copies that silently block the host (CPU tensors that are not pinned or not densely laid out). Valid values are "warn" (warn on each sync) or "error" (raise on sync). … | 1: utils/gpu_sync_debug.py:43 |
MAX_envs.py:662 | str | None, None | Maximum number of compilation jobs to run in parallel. By default this is the number of CPUs | no envs.* use; named in setup.py, tools/build_nixl_with_torch215_for_rubin.py, tools/build_triton_from_source.sh |
NVCC_envs.py:666 | str | None, None | Number of threads to use for nvcc By default this is 1. If set, `MAX_JOBS` will be reduced to avoid oversubscribing the CPU. | no envs.* use; named in setup.py, CMakeLists.txt, tools/generate_cmake_presets.py |
VLLM_envs.py:668 | bool, False | If set, vllm will use precompiled native binaries (*.so and vllm-rs). | no envs.* use; named in setup.py, docker/Dockerfile, docker/Dockerfile.rocm |
VLLM_envs.py:673 | bool, False | If set, vllm will use the precompiled Rust frontend binary (vllm-rs). | no envs.* use; named in setup.py, tests/test_envs.py |
VLLM_envs.py:677 | bool, False | If set, skip adding +precompiled suffix to version string | no envs.* use; named in setup.py, docker/Dockerfile |
VLLM_envs.py:682 | bool, False | Used to mark that setup.py is running in a Docker build context, in order to force the use of precompiled binaries. | no envs.* use; named in setup.py, docker/Dockerfile, docker/Dockerfile.rocm |
VLLM_envs.py:687 | str, "unknown" | Build provenance metadata embedded in official vllm-openai images. Set via Docker ENV at image build time; informational only. | no envs.* use; named in tools/ci/kernel_symbol_map.py, docker/Dockerfile, docker/docker-bake.hcl |
VLLM_envs.py:688 | str, "local" | (no comment of its own) | no envs.* use; named in docker/Dockerfile, docker/docker-bake.hcl, .buildkite/scripts/docker-build-metadata-args.sh |
VLLM_envs.py:689 | str, "" | (no comment of its own) | no envs.* use; named in docker/Dockerfile, docker/docker-bake.hcl, .buildkite/scripts/docker-build-metadata-args.sh |
VLLM_envs.py:690 | str, "" | (no comment of its own) | no envs.* use; named in docker/Dockerfile, docker/docker-bake.hcl, .buildkite/scripts/docker-build-metadata-args.sh |
CMAKE_envs.py:694 | Literal["Debug", "Release", "RelWithDebInfo"] | None, Nonechoices: Debug, Release, RelWithDebInfo | CMake build type If not set, defaults to "Debug" or "RelWithDebInfo" Available options: "Debug", "Release", "RelWithDebInfo" | no envs.* use; named in setup.py, CMakeLists.txt, cmake/cpu_extension.cmake |
VERBOSEenvs.py:698 | bool, False | If set, vllm will print verbose logs during installation | no envs.* use; named in setup.py |
VLLM_envs.py:704 | str, os.path.expanduser("~/.config/vllm") | Root directory for vLLM configuration files Defaults to `~/.config/vllm` unless `XDG_CONFIG_HOME` is set Note that this not only affects how vllm finds its configuration files during runtime, but also affects how vllm installs its configuration files during **installation**. | 2: ray/ray_env.py:11, usage/usage_lib.py:28 |
ROCm (AMD) (32)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:758 | int, 256 | flag to control the chunk size (in MB) for sleeping memory allocations under ROCm | no envs.* use; named in csrc/cumem_allocator.cpp, docs/features/sleep_mode.md |
VLLM_envs.py:1260 | bool, False | (no comment of its own) | 8: _aiter_ops.py:2185, _aiter_ops.py:2218, model_executor/layers/fused_moe/oracle/fp8.py:506, model_executor/layers/fused_moe/oracle/fp8.py:508, model_executor/layers/fused_moe/oracle/unquantized.py:320 (+3 more) |
VLLM_envs.py:1265 | bool, True | Use AITER's CustomAllreduce as the custom-allreduce backend inside vLLM's CudaCommunicator on ROCm. Also enables AITER AG/RS for DP communication. | 2: _aiter_ops.py:2188, _aiter_ops.py:2219 |
VLLM_envs.py:1269 | str, "fp32" | Muse Spark on ROCm: dtype of the TP reduction before the post-expert norm. | 1: models/muse_spark/amd/muse_moe_runner.py:150 |
VLLM_envs.py:1276 | bool, True | use aiter linear op if aiter ops are enabled The following list of related ops - scaled_mm (per-tensor / rowwise) - use aiter tuned gemms for unquantized gemms | 3: _aiter_ops.py:2189, _aiter_ops.py:2220, platforms/rocm.py:402 |
VLLM_envs.py:1279 | bool, False | (no comment of its own) | 3: _aiter_ops.py:2198, _aiter_ops.py:2228, platforms/rocm.py:403 |
VLLM_envs.py:1284 | bool, True | Whether to use aiter moe ops. By default is enabled. | 6: _aiter_ops.py:2190, _aiter_ops.py:2221, model_executor/layers/fused_moe/oracle/fp8.py:506, model_executor/layers/fused_moe/oracle/fp8.py:509, model_executor/layers/fused_moe/oracle/unquantized.py:320 (+1 more) |
VLLM_envs.py:1289 | Literal["auto", "a4w4", "a8w4", "a16w4"], "auto"choices: auto, a4w4, a8w4, a16w4, 0, 1 | Activation dtype for the Kimi-K3 SiTU MXFP4 MoE (AITER FlyDSL SiTUv2): auto (= a4w4), a4w4, a8w4 or a16w4. Legacy 1/0 mean a4w4/a16w4. | 1: _aiter_ops.py:2078 |
VLLM_envs.py:1299 | bool | None, None | Opt-in switch for a4w4 (FP4 activation) MoE on DeepSeek V4.1, AITER MXFP4 backend. Default is a8w4 (FP8); set to "1" to enable a4w4 ("true" is not accepted -- only "0"/"1"). Raises if set for other models. | 2: model_executor/layers/fused_moe/config.py:1378, models/deepseek_v41/amd/mono_decode.py:253 |
VLLM_envs.py:1310 | int, 0 | MoE sorting dispatch policy for AITER fused MoE kernels. 0 = auto (default): single-pass for small batches, multi-pass for large batches 1 = always single-pass: one kernel launch, no workspace, may be preferred for low-concurrency decode workloads 2 = always multi-pass: can be faster for MoE-heavy models (e.g., +2-5% on Qwen3-Next, +1.5% on DeepSeek-V3 at … | 2: _aiter_ops.py:2181, _aiter_ops.py:2235 |
VLLM_envs.py:1314 | bool, True | use aiter rms norm op if aiter ops are enabled. | 1: platforms/rocm.py:1379 |
VLLM_envs.py:1319 | bool, True | Whether to use aiter mla ops. By default is enabled. | 2: _aiter_ops.py:2191, _aiter_ops.py:2222 |
VLLM_envs.py:1326 | Literal["auto", "asm", "segmented"], "auto"choices: auto, asm, segmented | Kernel for causal multi-token (spec-decode) verify steps under decode context parallelism: "asm" uses AITER's round-robin ASM decode (gfx950), "segmented" the Triton segmented MLA path. "auto" (default) takes "asm" wherever it can serve the shape and "segmented" otherwise. | 1: v1/attention/backends/mla/rocm_aiter_mla.py:794 |
VLLM_envs.py:1340 | Literal["auto", "gluon", "asm"], "auto"choices: auto, gluon, asm | Small-head (<16) AITER MLA decode kernel selection. Small head counts (e.g. Kimi-K3: 12 heads/rank at TP8, 6 at TP16) can decode either through the Gluon small-head kernel or through the padded persistent-scheduling (PS) ASM kernel. "auto" (default) keeps Gluon for head counts that divide 16 where a Gluon build exists (gfx950/CDNA4) and otherwise uses the … | 1: v1/attention/backends/mla/rocm_aiter_mla.py:478 |
VLLM_envs.py:1348 | bool, True | Whether to use aiter mha ops. By default is enabled. | 2: _aiter_ops.py:2192, _aiter_ops.py:2223 |
VLLM_envs.py:1355 | bool, False | Whether sparse MLA prefill and decode run on aiter's Triton kernel, which reads the KV cache as stored (bf16 or fp8, paged or flat). Used by the ROCM_AITER_MLA_SPARSE backend (DeepSeek V3.2, GLM-5.x) and DeepSeek V4 / V4.1. gfx950 only. By default is disabled. | 2: _aiter_ops.py:2201, _aiter_ops.py:2230 |
VLLM_envs.py:1361 | bool, False | Whether to use aiter rope. By default is disabled. | 2: _aiter_ops.py:2200, _aiter_ops.py:2229 |
VLLM_envs.py:1367 | bool, False | Whether to use aiter triton fp8 bmm kernel for MLA kv_b_proj. By default is disabled: it re-quantizes the projection weights online, regardless of the precision the checkpoint asked for. | 3: _aiter_ops.py:2196, _aiter_ops.py:2226, models/deepseek_v4/amd/rocm.py:950 |
VLLM_envs.py:1372 | bool, False | Whether to use aiter triton fp4 bmm kernel for MLA kv_b_proj. By default is disabled, for the same reason as the fp8 variant above. | 2: _aiter_ops.py:2197, _aiter_ops.py:2227 |
VLLM_envs.py:1376 | bool, False | Use AITER triton unified attention for V1 attention | 2: _aiter_ops.py:2194, _aiter_ops.py:2225 |
VLLM_envs.py:1382 | bool, False | Whether to use aiter fusion shared experts ops. By default is disabled. | 6: _aiter_ops.py:2202, _aiter_ops.py:2231, distributed/device_communicators/all2all.py:1021, models/deepseek_v4/amd/model.py:529, models/deepseek_v4/amd/model.py:546 (+1 more) |
VLLM_envs.py:1388 | bool, True | Whether to use aiter triton kernels for gemm ops. By default is enabled. | 2: _aiter_ops.py:2205, _aiter_ops.py:2234 |
VLLM_envs.py:1392 | bool, True | use rocm skinny gemms | 3: model_executor/kernels/linear/scaled_mm/rocm.py:92, model_executor/layers/utils.py:356, model_executor/layers/utils.py:380 |
VLLM_envs.py:1396 | bool, True | Pad the fp8 weights to 256 bytes for ROCm | 1: model_executor/layers/quantization/utils/fp8_utils.py:1283 |
VLLM_envs.py:1398 | bool, True | Pad the weights for the moe kernel | 2: model_executor/layers/fused_moe/oracle/unquantized.py:497, model_executor/layers/fused_moe/unquantized_fused_moe_method.py:154 |
VLLM_envs.py:1400 | bool, False | Whether to use the shuffled kv cache layout | 2: _aiter_ops.py:2193, _aiter_ops.py:2224 |
VLLM_envs.py:1406 | Literal[
"FP", "INT8", "INT6", "INT4", "INT3", "NONE"
], "NONE"choices: FP, INT8, INT6, INT4, INT3, NONE | Custom quick allreduce kernel for MI3* cards Choice of quantization level: FP, INT8, INT6, INT4, INT3 or NONE Recommended for large models to get allreduce | 1: distributed/device_communicators/quick_all_reduce.py:173 |
VLLM_envs.py:1415 | bool, True | Custom quick allreduce kernel for MI3* cards Due to the lack of the bfloat16 asm instruction, bfloat16 kernels are slower than fp16, If environment variable is set to 1, the input is converted to fp16 | 3: _aiter_ops.py:99, distributed/device_communicators/quick_all_reduce.py:172, distributed/device_communicators/quick_all_reduce.py:228 |
VLLM_envs.py:1425 | int | None, None | Custom quick allreduce kernel for MI3* cards. Controls the maximum allowed number of data bytes(MB) for custom quick allreduce communication. Default: 2048 MB. Data exceeding this size will use either custom allreduce or RCCL communication. | 2: _aiter_ops.py:86, distributed/device_communicators/quick_all_reduce.py:233 |
VLLM_envs.py:1432 | int | None, None | Custom quick allreduce kernel for MI3* cards. Controls the minimum allowed number of data bytes(MB) required to use custom quick allreduce communication. If unset, use the built-in threshold table. | 1: distributed/device_communicators/quick_all_reduce.py:263 |
VLLM_envs.py:1438 | int | None, None | Controls the minimum tensor size (KB, where 1 KB = 1024 bytes) required to use the configured QuickReduce codec. Smaller tensors use FP QuickReduce. This does not affect QuickReduce eligibility. | 1: distributed/device_communicators/quick_all_reduce.py:281 |
VLLM_envs.py:1951 | bool, False | If set, use the fp8 mfma in rocm paged attention. | 1: _custom_ops.py:124 |
CPU backend (7)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:895 | int | None, 0 | (CPU backend only) CPU key-value cache space. default is None and will be set as 4 GB | 1: entrypoints/launchers/render/entry.py:88 |
VLLM_envs.py:902 | str, "auto" | (CPU backend only) CPU core ids bound by OpenMP threads, e.g., "0-31", "0,1,2", "0-31,33". CPU cores of different ranks are separated by '|'. | 1: utils/ompmultiprocessing.py:123 |
VLLM_envs.py:905 | int | None, None | (CPU backend only) CPU cores not used by OMP threads . Those CPU cores will not be used by OMP threads of a rank. | 3: utils/ompmultiprocessing.py:56, utils/ompmultiprocessing.py:57, utils/ompmultiprocessing.py:64 |
VLLM_envs.py:911 | bool, False | (CPU backend only) whether vLLM is running in a CI environment. | 2: platforms/cpu.py:376, v1/worker/cpu_worker.py:196 |
VLLM_envs.py:913 | bool, True | (CPU backend only) whether to enable attention spilt KV. | 1: v1/attention/backends/cpu_attn.py:273 |
VLLM_envs.py:918 | bool, True | (Zen CPU backend) eagerly prepack weights into ZenDNN blocked layout at model load time. Eliminates per-inference layout conversion overhead. | 1: model_executor/layers/utils.py:588 |
VLLM_envs.py:923 | bool, True | (CPU backend only) whether to use SGLang INT4 W4A8 kernels for AWQ, and on Zen CPUs whether to serve int4 checkpoints as DA8W4 rather than W4A16. | 3: model_executor/kernels/linear/mixed_precision/cpu.py:173, model_executor/kernels/linear/mixed_precision/zentorch.py:117, model_executor/layers/fused_moe/oracle/int_wna16.py:174 |
Intel XPU (4)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:926 | bool, True | Using a flag to control microbatch on XPU device, users on XPU device can decide to disable it when they needed. | 2: v1/core/sched/async_scheduler.py:22, v1/worker/gpu/pp_utils.py:82 |
VLLM_envs.py:2221 | bool, False | Force N-contiguous weight layout for all XPU unquantized linears. | 1: model_executor/layers/linear.py:224 |
VLLM_envs.py:2225 | bool, True | whether use xpu specific sample kernel | 1: v1/sample/ops/topk_topp_sampler.py:176 |
VLLM_envs.py:2235 | Literal["auto", "ark", "w4a16", "w4a8"], "auto"choices: auto, ark, w4a16, w4a8 | Kernel backend for INC weight-only intN (WNA16) linear layers on XPU. "auto" keeps the default preference order (ARK when importable, else the oneDNN w4a16 path). "ark" forces the auto_round_kernel backend, "w4a16" forces oneDNN int4_gemm_w4a16, and "w4a8" additionally quantizes activations to per-token int8 (int4_gemm_w4a8) for large token counts. The two … | 2: model_executor/layers/quantization/inc/schemes/inc_wna16_scheme.py:80, model_executor/layers/quantization/inc/schemes/inc_wna16_scheme.py:170 |
TPU / XLA (4)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:1079 | str, os.path.join(VLLM_CACHE_ROOT, "xla_cache") | Path to the XLA persistent cache directory. Only used for XLA devices such as TPUs. | no envs.* use; named in docs/usage/security.md, tests/config/test_config_utils.py |
VLLM_envs.py:1086 | bool, False | If set, assert on XLA recompilation after each execution step. | no envs.* use |
VLLM_envs.py:1090 | bool, False | Enable SPMD mode for TPU backend. | 1: config/parallel.py:1063 |
VLLM_envs.py:1594 | bool, False | Whether using Pathways | 1: platforms/__init__.py:37 |
Logging and usage statistics (19)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:830 | bool, False | Whether to log responses from API Server for debugging | 1: entrypoints/serve/middleware/register.py:57 |
VLLM_envs.py:838 | str, "https://stats.vllm.ai" | Usage stats collection | 1: usage/usage_lib.py:32 |
VLLM_envs.py:841 | bool, False | (no comment of its own) | 1: usage/usage_lib.py:64 |
VLLM_envs.py:842 | bool, False | (no comment of its own) | 1: usage/usage_lib.py:63 |
VLLM_envs.py:850 | str, "production" | (no comment of its own) | 1: usage/usage_lib.py:239 |
VLLM_envs.py:855 | bool, True | Logging configuration If set to 0, vllm will not configure logging If set to 1, vllm will configure logging using the default configuration or the configuration file specified by VLLM_LOGGING_CONFIG_PATH | 2: config/logging.py:34, logger.py:211 |
VLLM_envs.py:858 | str | None, None | (no comment of its own) | 2: config/logging.py:43, logger.py:213 |
VLLM_envs.py:860 | str, "INFO" | this is used for configuring the default logging level | 7: config/compilation.py:939, config/logging.py:27, logger.py:82, logger.py:88, logger.py:96 (+2 more) |
VLLM_envs.py:862 | str, "ext://sys.stdout" | this is used for configuring the default logging stream | 4: logger.py:68, logger.py:70, logger.py:97, logger.py:237 |
VLLM_envs.py:864 | str, "" | if set, VLLM_LOGGING_PREFIX will be prepended to all log messages | 1: logger.py:29 |
VLLM_envs.py:867 | str, "auto" | Controls colored logging output. Options: "auto" (default, colors when terminal), "1" (always use colors), "0" (never use colors) | 2: logger.py:64, logger.py:66 |
NO_envs.py:869 | bool, False | Standard unix flag for disabling ANSI color codes | 1: logger.py:64 |
FORCE_envs.py:871 | bool, False | De-facto standard flag for forcing ANSI color codes (e.g. non-tty case) | 1: logger.py:66 |
VLLM_envs.py:874 | float, 10.0 | If set, vllm will log stats at this interval in seconds If not set, vllm will log stats every 10 seconds. | 3: entrypoints/launchers/grpc_server.py:139, entrypoints/launchers/utils/server_utils.py:83, v1/engine/llm_engine.py:465 |
VLLM_envs.py:882 | int, 0 | Trace function calls If set to 1, vllm will trace function calls Useful for debugging | 1: config/vllm.py:880 |
VLLM_envs.py:1445 | float, -1 | (no comment of its own) | 2: forward_context.py:22, forward_context.py:25 |
VLLM_envs.py:2153 | bool, False | Log model inspection after loading. If enabled, logs a transformers-style hierarchical view of the model with quantization methods and attention backends. | 1: model_executor/model_loader/base_loader.py:120 |
VLLM_envs.py:2182 | bool, False | Disable logging of vLLM logo at server startup time. | 1: entrypoints/common/startup.py:17 |
VLLM_envs.py:2282 | str, "DEBUG" | Logging level for request JSON body. | 2: entrypoints/serve/utils/request_logger.py:75, entrypoints/serve/utils/request_logger.py:80 |
Debugging and profiling (10)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:782 | str | None, None | Debug pattern matching inside custom passes. Should be set to the fx.Node name (e.g. 'getitem_34' or 'scaled_mm_3'). | 1: compilation/passes/pass_manager.py:79 |
VLLM_envs.py:787 | str | None, None | Dump fx graphs to the given directory. It will override CompilationConfig.debug_dump_path if set. | 2: config/vllm.py:2289, config/vllm.py:2290 |
VLLM_envs.py:1118 | not in TYPE_CHECKING; parse default "dummy" | (no comment of its own) | no envs.* use; named in tools/pre_commit/check_test_tethering.py, .buildkite/intel_jobs/quantization_intel.yaml, .buildkite/test-amd.yaml |
VLLM_envs.py:1892 | bool, False | Enable checking whether the generated logits contain NaNs, indicating corrupted output. Useful for debugging low level bugs or bad hardware but it may add compute overhead. | 6: v1/metrics/loggers.py:325, v1/metrics/loggers.py:629, v1/metrics/loggers.py:1244, v1/metrics/stats.py:482, v1/worker/gpu/sample/sampler.py:58 (+1 more) |
VLLM_envs.py:1898 | bool, False | Raise an exception when generated logits contain NaNs. Enabling this also enables the NaN computation required to detect them. | 3: v1/worker/gpu/async_utils.py:195, v1/worker/gpu_model_runner.py:352, v1/worker/gpu_model_runner.py:5358 |
VLLM_envs.py:2013 | bool, False | Add optional custom scopes for profiling, disable to avoid overheads | 1: v1/utils.py:792 |
VLLM_envs.py:2017 | bool, False | Add optional nvtx scopes for profiling, disable to avoid overheads | 1: v1/utils.py:794 |
VLLM_envs.py:2098 | str, "" | GC debug config - VLLM_GC_DEBUG=0: disable GC debugger - VLLM_GC_DEBUG=1: enable GC debugger with gc.collect elpased times - VLLM_GC_DEBUG='{"top_objects":5}': enable GC debugger with top 5 collected objects | 2: utils/gc_utils.py:38, utils/gc_utils.py:136 |
VLLM_envs.py:2101 | bool, False | Debug workspace allocations. logging of workspace resize operations. | 3: v1/worker/workspace.py:92, v1/worker/workspace.py:109, v1/worker/workspace.py:269 |
VLLM_envs.py:2157 | bool, False | Debug logging for --enable-mfu-metrics | 2: v1/metrics/perf.py:1581, v1/metrics/perf.py:1679 |
torch.compile and CUDA graphs (13)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:764 | bool, True | Feature flag to enable/disable Inductor standalone compile. In torch <= 2.7 we ignore this flag; in torch >= 2.9 this is enabled by default. | 2: compilation/backends.py:102, compilation/backends.py:108 |
VLLM_envs.py:773 | bool, True | Inductor's pre-grad passes don't do anything for vLLM. The pre-grad passes get run even on cache-hit and negatively impact vllm cold compile times by O(1s) Can remove this after the following issue gets fixed TODO(luka): maybe_inplace requires this https://github.com/pytorch/pytorch/issues/174502 | 1: compilation/compiler_interface.py:357 |
VLLM_envs.py:777 | bool, False | Experimental: breakable cudagraph does not rely on torch.compile | 3: compilation/breakable_cudagraph.py:55, config/vllm.py:2152, v1/worker/gpu/model_runner.py:747 |
VLLM_envs.py:791 | bool, False | Feature flag to enable/disable AOT compilation. This will ensure compilation is done in warmup phase and the compilation will be reused in subsequent calls. | 4: compilation/decorators.py:556, compilation/decorators.py:609, compilation/decorators.py:692, compilation/wrapper.py:159 |
VLLM_envs.py:794 | bool, True | Feature flag to enable/disable bytecode in TorchCompileWithNoGuardsWrapper. | 3: compilation/wrapper.py:129, compilation/wrapper.py:177, compilation/wrapper.py:193 |
VLLM_envs.py:800 | bool, False | Force vllm to always load AOT compiled models from disk. Failure to load will result in a hard error when this is enabled. Will be ignored when VLLM_USE_AOT_COMPILE is disabled. | 1: compilation/decorators.py:346 |
VLLM_envs.py:804 | bool, False | Enable loading compiled models directly from cached standalone compile artifacts without re-splitting graph modules. This reduces overhead during model loading by using reconstruct_serializable_fn_from_mega_artifact. | 7: compilation/backends.py:101, compilation/backends.py:882, compilation/caching.py:326, compilation/caching.py:585, compilation/compiler_interface.py:176 (+2 more) |
VLLM_envs.py:1448 | bool, False | (no comment of its own) | 3: compilation/compiler_interface.py:215, compilation/decorators.py:595, compilation/decorators.py:732 |
VLLM_envs.py:1913 | bool, False | Controls garbage collection during CUDA graph capture. If set to 0 (default), enables GC freezing to speed up capture time. If set to 1, allows GC to run during capture. | 1: utils/gc_utils.py:102 |
VLLM_envs.py:2079 | bool, True | Enable max_autotune & coordinate_descent_tuning in inductor_config to compile static shapes passed from compile_sizes in compilation_config If set to 1, enable max_autotune; By default, this is enabled (1) | 1: compilation/compiler_interface.py:773 |
VLLM_envs.py:2084 | bool, True | If set to 1, enable coordinate_descent_tuning; By default, this is enabled (1) | 1: compilation/compiler_interface.py:775 |
VLLM_envs.py:2143 | Literal["binary", "unpacked"], "binary"choices: binary, unpacked | Format for saving torch.compile cache artifacts - "binary": saves as binary file Safe for multiple vllm serve processes accessing the same torch compile cache. - "unpacked": saves as directory structure (for inspection/debugging) NOT multiprocess safe - race conditions may occur with multiple processes. Allows viewing and setting breakpoints in Inductor's … | 1: config/compilation.py:453 |
VLLM_envs.py:2217 | bool, True | If set to 1, enable CUDA graph memory estimation during memory profiling. This profiles CUDA graph memory usage to provide more accurate KV cache memory allocation. Enabled by default as of v0.21.0 | 2: v1/worker/gpu_worker.py:713, v1/worker/gpu_worker.py:772 |
KV transfer, offload and disaggregation (23)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:1719 | str, "localhost" | IP address used for NIXL handshake between remote agents. | 1: distributed/kv_transfer/kv_connector/v1/nixl/base_scheduler.py:76 |
VLLM_envs.py:1723 | int, 5600 | Port used for NIXL handshake between remote agents. | 1: distributed/kv_transfer/kv_connector/v1/nixl/base_scheduler.py:78 |
VLLM_envs.py:1729 | str, "localhost" | Address the P2P KV-offload control socket binds to. Defaults to ``localhost`` (loopback only); must be set to the node IP for cross-host P2P so remote peers can reach the socket. | 1: v1/kv_offload/tiering/p2p/manager.py:331 |
VLLM_envs.py:1733 | int, 5710 | Port the P2P KV-offload control socket binds to. | 1: v1/kv_offload/tiering/p2p/manager.py:333 |
VLLM_envs.py:1739 | int, 128 | Maximum number of concurrent P2P peer sessions. Limits ZMQ socket consumption to prevent denial-of-service via unbounded peer creation from client-supplied kv_transfer_params. Default: 128. | 3: v1/kv_offload/tiering/p2p/manager.py:736, v1/kv_offload/tiering/p2p/manager.py:773, v1/kv_offload/tiering/p2p/manager.py:966 |
VLLM_envs.py:1743 | int, 30 | Seconds to wait for a P2P peer handshake to complete (connected but not yet ready). Sessions exceeding this deadline are reaped. Prevents never-responding peers from accumulating indefinitely. | 2: v1/kv_offload/tiering/p2p/session/session.py:340, v1/kv_offload/tiering/p2p/session/session.py:346 |
VLLM_envs.py:1750 | int, 300 | Seconds a P2P session may remain idle (no pending work, no messages) before it is eligible for eviction. Idle eviction runs only when remaining peer slots are within 8 of VLLM_P2P_MAX_PEERS. Default: 300. Set to 0 to disable. | 1: v1/kv_offload/tiering/p2p/manager.py:963 |
VLLM_envs.py:1753 | str, "localhost" | IP address used for the EC connector's ZMQ side channel (producer ROUTER bind, consumer DEALER dial). | 1: distributed/ec_transfer/ec_connector/cpu/scheduler/__init__.py:167 |
VLLM_envs.py:1758 | int, 5601 | Port for the EC connector's ZMQ side channel; advertised to peers via `ec_transfer_params.peer_port` on the producer's response. | 1: distributed/ec_transfer/ec_connector/cpu/scheduler/__init__.py:168 |
VLLM_envs.py:1763 | float, 30.0 | Per-request timeout (seconds) when a prefiller worker registers with the Mooncake bootstrap server. | 3: distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:1448, distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:2263, distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:2559 |
VLLM_envs.py:1767 | int, 8998 | Port used for Mooncake handshake between remote agents. | 2: distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:3029, distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:3088 |
VLLM_envs.py:1771 | bool, False | Log per-batch memory/disk tier breakdown on external GETs. | 1: distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py:1257 |
VLLM_envs.py:1779 | int, 1 | Number of parallel KV-load receive threads per worker rank. Lets the per-request control overhead (Python prep + master key lookup) of one request overlap with the RDMA transfer of another, keeping the transfer engine's queue pairs busy. Helps when that overhead is significant or per-request batches are too small to saturate the link on their own. | 1: distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py:1493 |
VLLM_envs.py:1783 | float, 0.9 | Fraction of the owner's DirectIO staging buffer to fill per GET batch. | 1: distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py:160 |
MOONCAKE_envs.py:1787 | str | None, None | Pin this rank to a specific owner segment ("host:port"). | 1: distributed/kv_transfer/kv_connector/v1/mooncake/rdma_utils.py:39 |
MOONCAKE_envs.py:1789 | str | None, None | Override the hostname the rank registers as a Mooncake requester. | 1: distributed/kv_transfer/kv_connector/v1/mooncake/rdma_utils.py:22 |
VLLM_envs.py:1902 | int, 480 | Timeout (in seconds) for MooncakeConnector in PD disaggregated setup. | 4: distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:1654, distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:2326, distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:2430, distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py:2680 |
VLLM_envs.py:2022 | bool, True | Represent block hashes in KV cache events as 64-bit integers instead of raw bytes. Defaults to True for backward compatibility. | 1: v1/core/kv_cache_utils.py:83 |
VLLM_envs.py:2029 | str, "VLLM_OBJECT_STORAGE_SHM_BUFFER" | Name of the shared memory buffer used for object storage. Only effective when mm_config.mm_processor_cache_type == "shm". Automatically generates a unique UUID-based name per process tree if not explicitly set. | 2: multimodal/cache/shm.py:83, multimodal/cache/shm.py:269 |
VLLM_envs.py:2171 | int, 0 | Max descriptors per CPU-KV-offload batch-memcpy call. 0 = platform default (ROCm chunks at 8192, since hipMemcpyBatchAsync faults above that on rocm 7.14/7.15 when batch copy is optimized; CUDA uncapped). Set >0 to override. | 1: v1/simple_kv_offload/cuda_mem_ops.py:83 |
VLLM_envs.py:2239 | not in TYPE_CHECKING; parse default "0" | Enable simple KV offload. | 1: config/vllm.py:1150 |
VLLM_envs.py:2263 | str, "" | Comma-separated GPU_BDF=NIC_BDF pairs for RDMA NIC selection. Must be set together with VLLM_NIC_SELECTION_VARS. | 2: v1/executor/vllm_net_devices.py:144, v1/executor/vllm_net_devices.py:200 |
VLLM_envs.py:2267 | str, "" | Comma-separated list of env vars to set from the GPU-NIC mapping. Each entry is VAR_NAME or VAR_NAME:<suffix> (suffix appended to RDMA device name). Must be set together with VLLM_GPU_NIC_PCIE_MAPPING. | 2: v1/executor/vllm_net_devices.py:147, v1/executor/vllm_net_devices.py:201 |
MoE and expert parallelism (28)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:1578 | Literal["indexed", "grouped", "auto"] | None, None | Whether to use indexed gemm for humming moe if 1, force use indexed gemm if 0, force use grouped gemm if None, choose better gemm type automatically | 1: model_executor/layers/fused_moe/experts/fused_humming_moe.py:113 |
VLLM_envs.py:1584 | bool, False | Whether to use DeepEPLL kernels for NVFP4 quantization and dispatch method only supported on Blackwell GPUs and with https://github.com/deepseek-ai/DeepEP/pull/341 | 3: model_executor/layers/fused_moe/experts/flashinfer_cutedsl_batched_moe.py:53, model_executor/layers/fused_moe/prepare_finalize/deepep_ll.py:180, model_executor/layers/fused_moe/prepare_finalize/deepep_ll.py:257 |
VLLM_envs.py:1598 | bool, True | Allow use of DeepGemm kernels for fused moe ops. | 4: model_executor/layers/fused_moe/oracle/fp8.py:484, model_executor/layers/fused_moe/oracle/fp8.py:485, model_executor/warmup/deep_gemm_warmup.py:135, utils/deep_gemm.py:118 |
VLLM_envs.py:1600 | bool, True | Allow use of DeepGemm specifically for MoE fused ops (overrides only MoE). | 3: model_executor/layers/fused_moe/oracle/fp8.py:484, model_executor/layers/fused_moe/oracle/fp8.py:485, model_executor/warmup/deep_gemm_warmup.py:135 |
VLLM_envs.py:1604 | bool, True | Whether to use E8M0 scaling when DeepGEMM is used on Blackwell GPUs. | 4: transformers_utils/config.py:963, transformers_utils/config.py:972, utils/deep_gemm.py:76, utils/deep_gemm.py:138 |
VLLM_envs.py:1608 | bool, True | Whether to create TMA-aligned scale tensor when DeepGEMM is used. | 1: model_executor/kernels/linear/scaled_mm/deep_gemm.py:42 |
VLLM_envs.py:1624 | Literal[
"skip",
"full",
"relax",
], "relax"choices: skip, full, relax | DeepGemm JITs the kernels on-demand. The warmup attempts to make DeepGemm JIT all the required kernels before model execution so there is no JIT'ing in the hot-path. However, this warmup increases the engine startup time by a couple of minutes. Available options: - "skip" : Skip warmup. - "full" : Warmup deepgemm by running all possible gemm shapes the … | 4: model_executor/warmup/deep_gemm_warmup.py:185, model_executor/warmup/deep_gemm_warmup.py:188, model_executor/warmup/deep_gemm_warmup.py:191, model_executor/warmup/kernel_warmup.py:243 |
VLLM_envs.py:1634 | bool, True | Whether to use fused grouped_topk used for MoE expert selection. | 1: model_executor/layers/fused_moe/router/grouped_topk_router.py:93 |
VLLM_envs.py:1640 | bool, True | Skip cudagraph/DP padding tokens in the MoE path by forcing their expert ids to -1 so the dispatch and experts drop them. Requires a MoE kernel that treats topk_id == -1 as a skip sentinel | 21: model_executor/layers/fused_moe/deep_gemm_mega_moe.py:757, model_executor/layers/fused_moe/router/fused_topk_bias_router.py:29, model_executor/layers/fused_moe/router/fused_topk_router.py:20, model_executor/layers/fused_moe/router/grouped_topk_router.py:353, model_executor/warmup/deep_gemm_warmup.py:401 (+16 more) |
VLLM_envs.py:1643 | bool, False | Step5 SP dense/shared MLPs: opt into TP-sharded weights with AG/RS instead of replicated weights and local-token computation. | 1: models/step5/nvidia/model.py:796 |
VLLM_envs.py:1655 | bool, False | Kimi-K3 only. Under sequence-parallel MoE the dense and shared-expert MLPs are replicated on every rank, so each rank streams the whole weight to serve its own token shard. Shard them across TP instead: the MLP then all-gathers the full token set, computes this rank's partial, and reduce-scatters (which both sums across TP and restores the sequence … | 1: models/kimi_k3/nvidia/model.py:153 |
VLLM_envs.py:1679 | bool, False | Force b12x FP4 MoE to use BF16 activations. | 2: model_executor/layers/fused_moe/oracle/mxfp4.py:608, model_executor/layers/fused_moe/oracle/nvfp4.py:187 |
VLLM_envs.py:1683 | bool, False | Allow use of FlashInfer MxInt4 MoE kernels for fused moe ops. | 1: model_executor/layers/quantization/utils/flashinfer_mxint4_moe.py:27 |
VLLM_envs.py:1821 | bool, False | Transmit MoE all-to-all combine (expert-output) payloads in FP8 instead of BF16, halving NVLink traffic on the combine leg. Only takes effect when the installed FlashInfer MoeAlltoAll kernel supports it. | 1: distributed/device_communicators/all2all.py:802 |
VLLM_envs.py:1828 | int, 163840 | Control the maximum number of tokens per expert supported by the NVFP4 MoE CUTLASS Kernel. This value is used to create a buffer for the blockscale tensor of activations NVFP4 Quantization. This is used to prevent the kernel from running out of memory. | 4: _custom_ops.py:1634, _custom_ops.py:1697, _custom_ops.py:1758, _custom_ops.py:1805 |
VLLM_envs.py:1837 | not in TYPE_CHECKING; parse default "" | MoE routing strategy selector. See `RoutingSimulator.get_available_strategies()` # for available strategies. Custom routing strategies can be registered by RoutingSimulator.register_strategy() Note: custom strategies may not produce correct model outputs | 2: model_executor/layers/fused_moe/router/router_factory.py:268, model_executor/layers/fused_moe/router/routing_simulator_router.py:348 |
VLLM_envs.py:2034 | int, 1024 | The size in MB of the buffers (NVL and RDMA) used by DeepEP | 3: distributed/device_communicators/all2all.py:275, distributed/device_communicators/all2all.py:280, distributed/device_communicators/all2all.py:357 |
VLLM_envs.py:2040 | bool, False | Force DeepEP to use intranode kernel for inter-node communication in high throughput mode. This is useful archive higher prefill throughput on system supports multi-node nvlink (e.g GB200). | 1: distributed/device_communicators/all2all.py:279 |
VLLM_envs.py:2045 | bool, False | Allow DeepEP to use MNNVL (multi-node nvlink) for internode_ll kernel, turn this for better latency on GB200 like system | 1: distributed/device_communicators/all2all.py:376 |
VLLM_envs.py:2053 | bool, True | DeepEP v2: use NVLink+RDMA hybrid communication across NVLink domains. * hybrid mode = multi-node RDMA * non hybrid mode = nvlink Set to 1 (the default) to allow DeepEP to autoselect hybrid vs non-hybrid. Set to 0 to disable hybrid mode. | 2: distributed/device_communicators/all2all.py:1141, distributed/device_communicators/all2all.py:1160 |
VLLM_envs.py:2057 | bool, False | DeepEP v2: use fewer SMs at slight throughput cost | 1: distributed/device_communicators/all2all.py:1142 |
VLLM_envs.py:2061 | bool, False | DeepEP v2: trade precision for transfer size in combine | 1: distributed/device_communicators/all2all.py:1143 |
VLLM_envs.py:2103 | bool, False | Disables parallel execution of shared_experts via separate cuda stream | 3: model_executor/layers/fused_moe/runner/shared_experts.py:74, models/deepseek_v4/amd/model.py:735, models/kimi_k3/nvidia/latent_moe_runner.py:208 |
VLLM_envs.py:2109 | bool, False | Emergency rollback for the DeepSeek-V4 NVIDIA MegaMoE path. By default, DeepGEMM computes replicated FP8 shared experts in the same persistent SM100 kernel as the routed FP4 experts. | 1: models/deepseek_v4/nvidia/model.py:376 |
VLLM_envs.py:2116 | int, 256 | Limits when we run shared_experts in a separate stream. We found out that for large batch sizes, the separate stream execution is not beneficial (most likely because of the input clone) TODO(alexm-redhat): Tune to be more dynamic based on GPU type | 6: model_executor/layers/fused_moe/runner/shared_experts.py:134, models/deepseek_v4/amd/model.py:814, models/inkling/amd/moe.py:543, models/inkling/nvidia/moe.py:525, models/kimi_k3/nvidia/latent_moe_runner.py:207 (+1 more) |
VLLM_envs.py:2134 | int, 256 | Cohere2 MoE runs the MLP/MoE of its parallel blocks on a side CUDA stream, overlapping it with attention, for batches of at most this many tokens. Larger batches and piecewise CUDA graphs (prefill / mixed batches) run the MLP inline. Set to 0 to disable the dual stream. | 2: model_executor/models/cohere2_moe.py:386, model_executor/models/cohere2_moe.py:476 |
VLLM_envs.py:2206 | bool, False | Whether it is a scale up launch engine for elastic EP, Should only be set by EngineCoreClient. | 7: distributed/parallel_state.py:2050, v1/engine/core.py:154, v1/engine/core.py:290, v1/engine/core.py:378, v1/engine/core.py:1417 (+2 more) |
VLLM_envs.py:2211 | bool, False | Whether to wait for all requests to drain before sending the scaling command in elastic EP. | 1: v1/engine/async_llm.py:1330 |
CUDA and library paths (8)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
CUDA_envs.py:750 | not in TYPE_CHECKING; parse default None | path to cudatoolkit home directory, under which should be bin, include, and lib directories. | no envs.* use; named in vllm/distributed/kv_transfer/kv_connector/v1/hf3fs/hf3fs_client.py, vllm/utils/flashinfer.py, setup.py |
VLLM_envs.py:753 | str | None, None | Path to the NCCL library file. It is needed because nccl>=2.19 brought by PyTorch contains a bug: https://github.com/NVIDIA/nccl/issues/1234 | 1: utils/nccl.py:25 |
LD_envs.py:756 | str | None, None | when `VLLM_NCCL_SO_PATH` is not set, vllm will try to find the nccl library file in the locations specified by `LD_LIBRARY_PATH` | no envs.* use; named in vllm/distributed/weight_transfer/sharded_rdt_trainer.py, vllm/env_override.py, cmake/cpu_extension.cmake |
VLLM_envs.py:1492 | str | None, None | In some system, find_loaded_library() may not work. So we allow users to specify the path through environment variable VLLM_CUDART_SO_PATH. | 1: distributed/device_communicators/cuda_wrapper.py:124 |
VLLM_envs.py:1907 | bool, False | If set, it means we pre-downloaded cubin files and flashinfer will read the cubin files directly. | 2: utils/flashinfer.py:79, utils/flashinfer.py:134 |
VLLM_envs.py:2092 | str | None, None | NCCL header path | 1: utils/nccl.py:47 |
VLLM_envs.py:2188 | bool, False | Enable CUDA compatibility mode for datacenter GPUs with older driver versions than the CUDA toolkit major version of vLLM. | no envs.* use; named in vllm/env_override.py, docker/Dockerfile, docs/getting_started/installation/gpu.cuda.inc.md |
VLLM_envs.py:2193 | str | None, None | Path to the CUDA compatibility libraries when CUDA compatibility is enabled. | no envs.* use; named in vllm/env_override.py, docs/usage/troubleshooting.md, tests/cuda/test_cuda_compatibility_path.py |
Engine core and model runner (10)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:812 | int, 600 | Timeout in seconds for waiting for engine cores to become ready during startup. Default is 600 seconds (10 minutes). | 2: v1/engine/core_client.py:29, v1/utils.py:362 |
VLLM_envs.py:1107 | bool, False | If set, the OpenAI API server will stay alive even after the underlying AsyncLLMEngine errors and stops serving requests | 1: entrypoints/launchers/launcher.py:334 |
VLLM_envs.py:1114 | bool, False | If the env var VLLM_ALLOW_LONG_MAX_MODEL_LEN is set, it allows the user to specify a max sequence length greater than the max length derived from the model's config.json. To enable this, set VLLM_ALLOW_LONG_MAX_MODEL_LEN=1. | 1: config/model.py:2677 |
VLLM_envs.py:1442 | bool, True | If set, enable multiprocessing in LLM for the V1 code path. | 4: engine/arg_utils.py:1973, v1/engine/llm_engine.py:170, v1/engine/llm_engine.py:186, v1/executor/uniproc_executor.py:180 |
VLLM_envs.py:1474 | int, 128 | Controls the maximum number of requests to handle in a single asyncio task when processing per-token outputs in the V1 AsyncLLM interface. It is applicable when handling a high concurrency of streaming requests. Setting this too high can result in a higher variance of inter-message latencies. Setting it too low can negatively impact TTFT and overall … | 1: v1/engine/async_llm.py:874 |
VLLM_envs.py:1861 | int, 300 | Timeout in seconds for execute_model RPC calls in multiprocessing executor (only applies when TP > 1). | 4: v1/executor/multiproc_executor.py:350, v1/executor/multiproc_executor.py:363, v1/executor/multiproc_executor.py:372, v1/executor/multiproc_executor.py:380 |
VLLM_envs.py:1865 | int, 5 | Timeout in seconds for engine and worker process shutdown | 3: model_executor/model_loader/tensorizer.py:709, v1/engine/core_client.py:526, v1/executor/multiproc_executor.py:485 |
VLLM_envs.py:1984 | bool, False | Opt-in persistence of the startup plan. When enabled, each worker saves the memory-profiling result (the suggested --kv-cache-memory value and the free-memory baseline) under VLLM_CACHE_ROOT/startup_plan/, keyed by a hardware+config fingerprint, and later boots auto-apply it -- skipping memory profiling -- when the fingerprint matches and current free … | 2: v1/worker/startup_plan.py:139, v1/worker/startup_plan.py:171 |
VLLM_envs.py:2147 | bool | None, None | Flag to control the v2 model runner. If unset, use config defaults. | 4: config/vllm.py:715, config/vllm.py:723, config/vllm.py:730, config/vllm.py:3191 |
VLLM_envs.py:2260 | not in TYPE_CHECKING; parse default "0" | If set to 1, use Python spinloop extension to poll in a more efficient way when using the mp backend. | 1: distributed/device_communicators/shm_broadcast.py:49 |
Distributed and parallel execution (35)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:723 | str, "" | used in distributed environment to determine the ip address of the current node, when the node has multiple network interfaces. If you are using multi-node inference, you should set this differently on each node. | 1: utils/network_utils.py:53 |
VLLM_envs.py:728 | int | None, None | used in distributed environment to manually set the communication port Note: if VLLM_PORT is set, and some code asks for multiple ports, the VLLM_PORT will be used as the first port, and the rest will be generated by incrementing the VLLM_PORT value. | 3: utils/network_utils.py:214, utils/network_utils.py:216, utils/network_utils.py:237 |
VLLM_envs.py:731 | str, tempfile.gettempdir() | path used for ipc when the frontend api server is running in multi-processing mode to communicate with the backend engine process. | 2: distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py:2471, utils/network_utils.py:176 |
VLLM_envs.py:745 | int, 60 | Interval in seconds to log a warning message when the ring buffer is full | 1: distributed/device_communicators/shm_broadcast.py:67 |
LOCAL_envs.py:807 | int, 0 | local rank of the process in the distributed setting, used to determine the GPU device id | 4: distributed/parallel_state.py:1960, distributed/parallel_state.py:2004, distributed/parallel_state.py:2722, distributed/parallel_state.py:2724 |
CUDA_envs.py:809 | str | None, None | used to control the visible devices in the distributed setting | 3: distributed/device_communicators/all_reduce_utils.py:278, distributed/device_communicators/all_reduce_utils.py:364, platforms/cuda.py:635 |
VLLM_envs.py:892 | str | None, None | Pipeline stage partition strategy | 1: distributed/utils.py:206 |
VLLM_envs.py:933 | bool, False | When True, GroupCoordinator constructs its CPU/device subgroups via ``torch.distributed.split_group(backend=...)`` and ``init_distributed_environment`` initializes the default PG with mixed ``cpu:gloo,cuda:nccl`` backend + eager ``device_id`` binding. | 3: distributed/parallel_state.py:482, distributed/parallel_state.py:1954, distributed/parallel_state.py:1995 |
VLLM_envs.py:938 | Literal["fork", "spawn"], "fork"choices: spawn, fork | Use dedicated multiprocess context for workers. Both spawn and fork work | 2: utils/numa_utils.py:551, utils/system_utils.py:197 |
VLLM_envs.py:1207 | bool, Falsebut the read falls back to "1" | We assume drivers can report p2p status correctly. If the program hangs when using custom allreduce, potantially caused by a bug in the driver (535 series), if might be helpful to set VLLM_SKIP_P2P_CHECK=0 so that vLLM can verify if p2p is actually working. See … | 1: distributed/device_communicators/custom_all_reduce.py:90 |
VLLM_envs.py:1234 | bool, False | Disable pynccl (using torch.distributed instead) | 3: distributed/device_communicators/pynccl.py:127, distributed/device_communicators/pynccl.py:229, v1/attention/backends/mla/indexer.py:256 |
VLLM_envs.py:1483 | float, 1.0 | If set, vLLM will pick up the provided Flash Attention MLA Number of GPUs per worker in Ray, if it is set to be a fraction, it allows ray to schedule multiple actors on a single GPU, so that users can colocate other actors on the same GPUs as vLLM. | 1: v1/executor/ray_executor_v2.py:278 |
VLLM_envs.py:1489 | str, "" | Bundle indices for Ray, if it is set, it can control precisely which indices are used for the Ray bundle, for every worker. Format: comma-separated list of integers, e.g. "0,1,2,3" | 2: v1/executor/ray_executor_v2.py:308, v1/executor/ray_executor_v2.py:311 |
VLLM_envs.py:1494 | int, 0 | Rank of the process in the data parallel setting | 1: config/parallel.py:1026 |
VLLM_envs.py:1497 | int, -1 | Rank of the process in the data parallel setting. Defaults to VLLM_DP_RANK when not set. | 1: config/parallel.py:1027 |
VLLM_envs.py:1501 | int, 1 | World size of the data parallel setting | 1: config/parallel.py:1025 |
VLLM_envs.py:1503 | str, ""but the read falls back to "127.0.0.1" | IP address of the master node in the data parallel setting | 1: config/parallel.py:1028 |
VLLM_envs.py:1505 | int, 0 | Port of the master node in the data parallel setting | 2: config/parallel.py:1029, utils/network_utils.py:188 |
VLLM_envs.py:1507 | bool, False | Randomize inputs during dummy runs when using Data Parallel | 2: v1/worker/gpu_model_runner.py:5381, v1/worker/gpu_worker.py:1450 |
VLLM_envs.py:1521 | Literal["strict", "fill", "span"], "strict" | Strategy to pack the data parallel ranks for Ray. Available options: - "fill": for DP master node, allocate exactly data-parallel-size-local DP ranks, for non-master nodes, allocate as many DP ranks as can fit; - "strict": allocate exactly data-parallel-size-local DP ranks to each picked node; - "span": Should be used only when a single DP rank requires … | 3: engine/arg_utils.py:2517, v1/engine/utils.py:701, v1/engine/utils.py:705 |
VLLM_envs.py:1528 | str, "" | Optional comma-separated list of node IPs that Ray data-parallel placement groups may use. When set, create_dp_placement_groups only considers these nodes (the DP master node is always included). This environment variable is ignored if data-parallel-backend is not Ray. | 1: v1/engine/utils.py:670 |
VLLM_envs.py:1534 | str, "" | Comma-separated *additional* prefixes of env vars to copy from the driver to Ray workers. These are merged with the built-in defaults defined in ``vllm.ray.ray_env`` (VLLM_, etc.). Example: "MYLIB_,OTHER_" | 1: ray/ray_env.py:85 |
VLLM_envs.py:1541 | str, "" | Comma-separated *additional* individual env var names to copy from the driver to Ray workers. Merged with the built-in defaults defined in ``vllm.ray.ray_env`` (PYTHONHASHSEED). Example: "MY_SECRET,MY_FLAG" | 1: ray/ray_env.py:94 |
VLLM_envs.py:1612 | bool, False | Opt-in MLA DCP query replication: skip the decode query all-gather. | 3: model_executor/models/deepseek_v2.py:1069, model_executor/models/deepseek_v2.py:1070, models/dots3_note/nvidia/model.py:382 |
VLLM_envs.py:1809 | Literal["auto", "trtllm", "mnnvl"], "auto"choices: auto, trtllm, mnnvl | Flashinfer fused allreduce backend. | 1: distributed/device_communicators/flashinfer_all_reduce.py:152 |
VLLM_envs.py:1856 | int, 16 | Control the max chunk bytes (in MB) for the rpc message queue. Object larger than this threshold will be broadcast to worker processes via zmq. | 2: v1/executor/multiproc_executor.py:152, v1/executor/ray_executor_v2.py:331 |
VLLM_envs.py:1917 | str, "" | Used to force set up loopback IP | 1: utils/network_utils.py:105 |
VLLM_envs.py:1955 | bool, True | Whether to use pytorch symmetric memory for allreduce | 1: distributed/device_communicators/cuda_communicator.py:68 |
VLLM_envs.py:1959 | bool, True | Whether to use FlashInfer allreduce | 2: distributed/device_communicators/cuda_communicator.py:71, distributed/device_communicators/flashinfer_all_reduce.py:211 |
VLLM_envs.py:1965 | bool, False | Whether to use FlashInfer's single-node PCIe CUDA-IPC all-reduce. This backend has a strict single-stream contract and is opt-in while its integration is being qualified. | 2: distributed/device_communicators/cuda_communicator.py:74, model_executor/warmup/kernel_warmup.py:258 |
VLLM_envs.py:2067 | int, 20 | The number of SMs/CUs to allocate for communication kernels when running DBO; the rest will be allocated to compute. Default: 20 on CUDA (SMs), 64 on ROCm (CUs). | 1: v1/worker/ubatch_utils.py:87 |
VLLM_envs.py:2088 | bool, False | Flag to enable NCCL symmetric memory allocation and registration | 3: distributed/device_communicators/pynccl_allocator.py:51, distributed/device_communicators/pynccl_wrapper.py:413, v1/attention/backends/mla/indexer.py:257 |
VLLM_envs.py:2243 | bool | None, None | Direct DCP ops default on when applicable; set to 1 to enforce or 0 to disable. | 1: v1/attention/ops/dcp.py:1139 |
VLLM_envs.py:2246 | bool | None, None | (no comment of its own) | 1: v1/attention/ops/dcp.py:1298 |
VLLM_envs.py:2249 | bool | None, None | (no comment of its own) | 1: v1/attention/ops/dcp.py:1418 |
Multimodal and media (22)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:942 | str, os.path.join(VLLM_CACHE_ROOT, "assets") | Path to the cache for storing downloaded assets | 1: assets/base.py:15 |
VLLM_envs.py:950 | bool, False | If the env var is set, we will clean model file in this path $VLLM_ASSETS_CACHE/model_streamer/$model_name | 1: transformers_utils/runai_utils.py:57 |
VLLM_envs.py:955 | int, 5 | Timeout for fetching images when serving multimodal models Default is 5 seconds | 3: assets/base.py:36, multimodal/media/connector.py:542, multimodal/media/connector.py:566 |
VLLM_envs.py:958 | int, 30 | Timeout for fetching videos when serving multimodal models Default is 30 seconds | 5: entrypoints/openai/decisions/strategies.py:952, entrypoints/openai/decisions/strategies.py:1157, entrypoints/openai/decisions/strategies.py:1324, multimodal/media/connector.py:591, multimodal/media/connector.py:618 |
VLLM_envs.py:963 | int, 10 | Timeout for fetching audio when serving multimodal models Default is 10 seconds | 2: multimodal/media/connector.py:506, multimodal/media/connector.py:521 |
VLLM_envs.py:968 | str, "" | Directory for caching media downloads (images, video, audio fetched from URLs during inference). Empty string disables caching. | 1: multimodal/media/connector.py:217 |
VLLM_envs.py:971 | int, 5120 | Maximum cache size in MB. When exceeded, least-recently-used entries are evicted. Default is 5120 (5 GB). | 2: multimodal/media/connector.py:226, multimodal/media/connector.py:232 |
VLLM_envs.py:976 | float, 24 | Time-to-live in hours for cached media files. Entries older than this are evicted regardless of cache size. Default is 24 hours. | 2: multimodal/media/connector.py:228, multimodal/media/connector.py:233 |
VLLM_envs.py:981 | int, 3 | Maximum number of retries for fetching media (images, audio, video) from URLs. Each retry quadruples the timeout. Default is 3. | 2: connections.py:293, connections.py:339 |
VLLM_envs.py:987 | int, 256 | Maximum size in MB for a single remote media download. The limit is enforced while streaming the response body so oversized or infinite responses cannot grow the API server heap without bound. Default is 256. | 1: connections.py:92 |
VLLM_envs.py:992 | bool, True | Whether to allow HTTP redirects when fetching from media URLs. Default to True | 3: entrypoints/launchers/run_batch.py:573, multimodal/media/connector.py:411, multimodal/media/connector.py:470 |
VLLM_envs.py:998 | int, 8 | Max number of workers for the thread pool handling media bytes loading. Set to 1 to disable parallel processing. Default is 8 | 1: multimodal/media/connector.py:47 |
VLLM_envs.py:1005 | int, 25 | Maximum filesize in MB for a single audio file. Enforced on all audio inputs (multimodal chat, speech-to-text uploads, data: URLs, and local file:// paths). Files larger than this will be rejected before decoding. Default is 25 MB. | 5: entrypoints/launchers/run_batch.py:82, entrypoints/speech_to_text/base/utils.py:29, entrypoints/speech_to_text/base/utils.py:39, entrypoints/speech_to_text/realtime/connection.py:57, multimodal/media/audio.py:559 |
VLLM_envs.py:1012 | int, 600 | Maximum decoded audio duration in seconds. Compressed audio files (e.g. OPUS at very low bitrate) can expand into gigabytes of float32 PCM. This limit is enforced *during* decoding so the memory is never allocated. Default is 600s (10 minutes). | 4: entrypoints/speech_to_text/base/serving.py:126, model_executor/models/nano_nemotron_vl.py:666, multimodal/media/audio.py:580, multimodal/media/audio.py:593 |
VLLM_envs.py:1020 | int, 268_435_456 | Maximum float32 PCM bytes that audio decoding may allocate. Guards against sample-rate forgery where an attacker inflates the header sample rate to bypass the duration guard while the actual frame count still causes a multi-GiB allocation. Default is 256 MiB (sufficient for 600s mono 48 kHz float32). | 3: entrypoints/speech_to_text/base/serving.py:127, multimodal/media/audio.py:581, multimodal/media/audio.py:585 |
VLLM_envs.py:1030 | int, 2_147_483_648 | Maximum bytes a client-supplied embedding payload (`prompt_embeds`, `image_embeds`, `audio_embeds`, `video_embeds`) may allocate once it is densified. A sparse tensor carries its own declared shape, so a payload of a few hundred bytes can expand into hundreds of GiB. The limit is checked before `to_dense()` so the memory is never allocated. Set to 0 to … | 1: utils/sparse_utils.py:58 |
VLLM_envs.py:1036 | int, max(1, min(os.cpu_count() or 1, 2)) | Maximum number of worker threads used for STT preprocessing. The default intentionally caps at 2 because that performed best in profiling. https://github.com/vllm-project/vllm/pull/44612#issuecomment-4662757781 | 1: entrypoints/speech_to_text/base/serving.py:147 |
VLLM_envs.py:1046 | int, 178_956_970 | Maximum decoded image size in pixels. Small compressed images can expand into gigabytes of raster memory. This limit is enforced before decoding so the memory is never allocated. Default matches PIL's built-in 2x decompression-bomb threshold (~179M pixels, ~680 MB RGB). | 2: multimodal/media/image.py:85, multimodal/video_decoders/base.py:30 |
VLLM_envs.py:1052 | int, 715_827_880 | Maximum aggregate decoded bytes across media in one request. The default allows one image at the per-image pixel limit at 4 bytes per pixel. Set to 0 to disable. | 3: multimodal/media/base.py:28, multimodal/media/base.py:48, multimodal/media/base.py:66 |
VLLM_envs.py:1055 | int, 256 | (no comment of its own) | 1: connections.py:76 |
VLLM_envs.py:1066 | str, "opencv" | Backend for Video IO — selects the frame-sampling algorithm. - "opencv": uniform sampling. - "opencv_dynamic": duration-aware dynamic sampling. | 3: config/multimodal.py:743, multimodal/gpu_ipc_memory.py:210, multimodal/media/video.py:116 |
VLLM_envs.py:1076 | str, "http" | Media connector implementation. - "http": Default connector that supports fetching media via HTTP. | 3: entrypoints/openai/decisions/strategies.py:160, renderers/chat_utils/content_parser.py:145, renderers/chat_utils/content_parser.py:335 |
LoRA (5)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:1171 | str | None, None | a local directory to look in for unrecognized LoRA adapters. only works if plugins are enabled and VLLM_ALLOW_RUNTIME_LORA_UPDATING is enabled. | 1: plugins/lora_resolvers/filesystem_resolver.py:51 |
VLLM_envs.py:1178 | str | None, None | A remote HF repo(s) containing one or more LoRA adapters, which may be downloaded and leveraged as needed. Only works if plugins are enabled and VLLM_ALLOW_RUNTIME_LORA_UPDATING is enabled. Values should be comma separated. | 1: plugins/lora_resolvers/hf_hub_resolver.py:131 |
VLLM_envs.py:1197 | bool, False | If set, allow loading or unloading lora adapters in runtime, | 4: entrypoints/cli/serve.py:315, entrypoints/pooling/base/serving.py:228, entrypoints/serve/engine/serving.py:63, entrypoints/serve/lora/api_router.py:30 |
VLLM_envs.py:2185 | bool, False | Disable PDL for LoRA, as enabling PDL with LoRA on SM100 causes Triton compilation to fail. | 1: lora/ops/triton_ops/utils.py:323 |
VLLM_envs.py:2255 | bool, False | Whether to enable dual cuda streams for LoRA computation (used by both BaseLinearLayerWithLoRA and FusedMoEWithLoRA to overlap the base layer compute with the LoRA fast path). | 10: config/lora.py:127, config/lora.py:129, config/lora.py:134, lora/layers/base_linear.py:31, lora/layers/base_linear.py:78 (+5 more) |
Structured output and tool calling (9)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:1590 | bool, False | Whether to turn on the outlines cache for V1 This cache is unbounded and on disk, so it's not safe to use in an environment with potentially malicious users. | 1: v1/structured_output/utils.py:303 |
VLLM_envs.py:1689 | int, 0but the read falls back to "512" | Control the cache sized used by the xgrammar compiler. The default of 512 MB should be enough for roughly 1000 JSON schemas. It can be changed with this variable if needed for some reason. | 1: v1/structured_output/backend_xgrammar.py:223 |
VLLM_envs.py:1694 | int, 5 | Maximum time in seconds allowed for regex compilation in structured output backends (xgrammar, outlines). Prevents ReDoS attacks where adversarial patterns cause exponential DFA state-space explosion. Set to 0 to disable the timeout (not recommended in production). | 1: v1/structured_output/utils.py:79 |
VLLM_envs.py:1841 | int, 1 | Regex timeout for use by the vLLM tool parsing plugins. | 5: tool_parsers/lfm2_tool_parser.py:176, tool_parsers/llama4_pythonic_tool_parser.py:80, tool_parsers/llama_tool_parser.py:96, tool_parsers/olmo3_tool_parser.py:91, tool_parsers/pythonic_tool_parser.py:76 |
VLLM_envs.py:1845 | bool, True | Enforce function parameter schemas in structural-tag based tool calling. | 4: parser/beam.py:165, tool_parsers/abstract_tool_parser.py:72, tool_parsers/abstract_tool_parser.py:189, tool_parsers/hy_v4_tool_parser.py:1017 |
VLLM_envs.py:1850 | bool, True | Constrain every `beam` output to its response template's format, also without tool or structured output constraints. | 1: parser/beam.py:194 |
VLLM_envs.py:1969 | bool, False | Experimental: use this to enable MCP tool calling for non harmony models | 1: entrypoints/openai/responses/serving.py:472 |
VLLM_envs.py:1991 | set[str], set() | Valid values are container,code_interpreter,web_search_preview ex VLLM_GPT_OSS_SYSTEM_TOOL_MCP_LABELS=container,code_interpreter If the server_label of your mcp tool is not in this list it will be completely ignored. | 2: entrypoints/openai/responses/utils.py:481, entrypoints/openai/responses/utils.py:482 |
VLLM_envs.py:2009 | bool, False | Enable automatic retry when tool call JSON parsing fails If enabled, returns an error message to the model to retry If disabled (default), raises an exception and fails the request | 4: entrypoints/openai/responses/context.py:481, entrypoints/openai/responses/context.py:525, entrypoints/openai/responses/context.py:857, entrypoints/openai/responses/context.py:946 |
API server and frontend (22)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:817 | float, 30.0 | Maximum wall-clock seconds allowed for a single chat template render. Set to 0 to disable the timeout. | 1: renderers/hf.py:1044 |
VLLM_envs.py:824 | int, 500000 | Maximum template instructions (MiniJinja fuel) for rendering a request-supplied chat template (--trust-request-chat-template) in the Rust frontend; the server's own template has no limit. Set to 0 to disable the limit. | no envs.* use; named in rust/src/chat/src/renderer/hf/error.rs, rust/src/chat/src/renderer/hf/mod.rs, rust/src/chat/src/renderer/hf/template.rs |
VLLM_envs.py:828 | str | None, None | API key for vLLM API server | 1: entrypoints/serve/middleware/register.py:33 |
VLLM_envs.py:1134 | int, 5 | Timeout in seconds for keeping HTTP connections alive in API server | 3: entrypoints/launchers/api_server/entry.py:152, entrypoints/launchers/render/entry.py:53, v1/utils.py:363 |
VLLM_envs.py:1140 | int, 16384 | Maximum allowed value for the `n` sampling parameter (number of output sequences per request). Limits resource consumption to prevent denial-of-service via excessively large fan-out. Default: 16384. | 2: entrypoints/scale_out/derender/serving.py:72, sampling_params.py:56 |
VLLM_envs.py:1146 | int, 1024 | Maximum number of prompts allowed in a single /v1/completions request when the prompt field is a list. Prevents unbounded fan-out of engine requests from a single API call. Default: 1024. | 1: entrypoints/openai/completion/protocol.py:638 |
VLLM_envs.py:1150 | int, 4 | Maximum number of stop strings allowed in a single request. | 3: entrypoints/anthropic/protocol.py:225, entrypoints/cohere/protocol.py:157, entrypoints/generate/base/protocol.py:27 |
VLLM_envs.py:1152 | int, 128 | Maximum number of bad-word token sequences generated per request. | 3: sampling_params.py:809, v1/worker/gpu/sample/bad_words.py:28, v1/worker/gpu/sample/bad_words.py:47 |
VLLM_envs.py:1157 | int, 1024 | Maximum total number of bad-word tokens (summed across all bad words) allowed per request. Bounds the per-request GPU buffer width. | 2: v1/worker/gpu/sample/bad_words.py:27, v1/worker/gpu/sample/bad_words.py:61 |
VLLM_envs.py:1454 | bool, False | If set, use the Rust frontend binary instead of the Python API server process(es). | 6: config/model.py:1088, config/model.py:1104, entrypoints/cli/serve.py:66, entrypoints/cli/serve.py:272, entrypoints/common/cli_args.py:482 (+1 more) |
VLLM_envs.py:1458 | bool, False | If set, use the packaged Rust client for `vllm bench serve`. | 1: entrypoints/cli/benchmark/main.py:24 |
VLLM_envs.py:1462 | str | None, "auto" | Path to the vllm-rs binary. Defaults to "auto" which discovers the binary installed with the vllm package. Used when VLLM_USE_RUST_FRONTEND=1 or VLLM_USE_RUST_BENCH=1. | 4: entrypoints/cli/benchmark/main.py:27, entrypoints/cli/serve.py:66, entrypoints/cli/serve.py:272, entrypoints/launchers/dp_supervisor.py:263 |
VLLM_envs.py:1466 | bool, False | If set, vllm will run in development mode, which will enable some additional endpoints for developing and debugging, e.g. `/reset_prefix_cache` | 2: entrypoints/common/cli_args.py:201, entrypoints/launchers/api_server/routers.py:46 |
VLLM_envs.py:1704 | int, 256 | Control the threshold for msgspec to use 'zero copy' for serialization/deserialization of tensors. Tensors below this limit will be encoded into the msgpack buffer, and tensors above will instead be sent via a separate message. While the sending side still actually copies the tensor in all cases, on the receiving side, tensors above this limit will actually … | 1: v1/serial_utils.py:154 |
VLLM_envs.py:1710 | bool, False | If set, allow insecure serialization using pickle. This is useful for environments where it is deemed safe to use the insecure method and it is needed for some reason. | 7: distributed/weight_transfer/ipc_engine.py:86, v1/serial_utils.py:162, v1/serial_utils.py:213, v1/serial_utils.py:220, v1/serial_utils.py:336 (+2 more) |
VLLM_envs.py:1715 | bool, False | Temporary: skip adding random suffix to internal request IDs. May be needed for KV connectors that match request IDs across instances. | 1: v1/engine/input_processor.py:364 |
VLLM_envs.py:1921 | not in TYPE_CHECKING; parse default "VLLM" | Used to set the process name prefix for vLLM processes. This is useful for debugging and monitoring purposes. The default value is "VLLM". | 1: utils/system_utils.py:206 |
VLLM_envs.py:1941 | bool, False | Enables support for the "store" option in the OpenAI Responses API. When set to 1, vLLM's OpenAI server will retain the input and output messages for those requests in memory. By default, this is disabled (0), and the "store" option is ignored. NOTE/WARNING: 1. Messages are kept in memory only (not persisted to disk) and will be lost when the vLLM server … | 1: entrypoints/openai/responses/serving.py:167 |
VLLM_envs.py:1947 | bool, False | If set to 1, expose the Cohere Chat v2 API at ``POST /cohere/v2/chat`` and its render endpoint at ``POST /cohere/v2/chat/render``. Default off | 2: entrypoints/cohere/api_router.py:296, entrypoints/generate/api_router.py:76 |
VLLM_envs.py:1997 | bool, False | Allows harmony instructions to be injected on system messages | 4: entrypoints/openai/parser/harmony_utils.py:117, entrypoints/openai/parser/harmony_utils.py:170, entrypoints/openai/parser/harmony_utils.py:205, entrypoints/openai/parser/harmony_utils.py:327 |
VLLM_envs.py:2005 | str | None, None | Pin the conversation start date injected into the Harmony system message. When unset the current date is used, which introduces non-determinism (different tokens -> different model behaviour at temperature=0). Set to an ISO date string, e.g. "2023-09-12", for reproducible inference or testing. | 1: entrypoints/openai/parser/harmony_utils.py:137 |
VLLM_envs.py:2200 | bool, False | Skip model name validation in OpenAI API requests. When set to 1, any model name will be accepted in the 'model' field of API requests. This is useful for proxy/gateway scenarios where the actual model is served but different names may be used in requests. | 1: entrypoints/serve/engine/serving.py:89 |
Model loading, storage and caches (13)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:713 | str, os.path.expanduser("~/.cache/vllm") | Root directory for vLLM cache files Defaults to `~/.cache/vllm` unless `XDG_CACHE_HOME` is set | 11: compilation/backends.py:1096, compilation/caching.py:481, compilation/decorators.py:575, distributed/device_communicators/all_reduce_utils.py:368, model_executor/models/registry.py:997 (+6 more) |
VLLM_envs.py:735 | bool, False | If true, will load models from ModelScope instead of Hugging Face Hub. | 13: lora/utils.py:371, model_executor/model_loader/weight_utils.py:172, tokenizers/registry.py:114, tokenizers/registry.py:280, transformers_utils/__init__.py:6 (+8 more) |
VLLM_envs.py:743 | bool, False | If true, replace the Rust BPE backend that powers HF fast tokenizers with the `fastokens` (https://github.com/crusoecloud/fastokens) shim. Applies to any tokenizer mode that loads an HF fast tokenizer (`hf`, `deepseek_v32`, `deepseek_v4`, …). The `fastokens` Python package must be installed. | 1: tokenizers/registry.py:218 |
S3_envs.py:834 | str | None, None | S3 access information, used for tensorizer to load model from S3 | 1: model_executor/model_loader/tensorizer.py:351 |
S3_envs.py:835 | str | None, None | (no comment of its own) | 1: model_executor/model_loader/tensorizer.py:354 |
S3_envs.py:836 | str | None, None | (no comment of its own) | 1: model_executor/model_loader/tensorizer.py:356 |
VLLM_envs.py:1130 | int, 0 | Queue size for fastsafetensors ParallelLoader pipelined weight loading. Peak load-time VRAM is roughly model_weights + (1 + queue_size) * shard_size. Default 0 preserves the non-pipelined memory footprint so this change does not shrink the loadable-model envelope. Set to 1 (or higher) to overlap producing the next shard's device buffer with the consumer … | 1: model_executor/model_loader/weight_utils.py:1345 |
VLLM_envs.py:1163 | list[str] | None, None | a list of plugin names to load, separated by commas. if this is not set, it means all plugins will be loaded if this is set to an empty string, no plugins will be loaded | 3: plugins/__init__.py:40, plugins/__init__.py:122, plugins/lora_resolvers/hf_hub_resolver.py:133 |
VLLM_envs.py:1550 | str | None, None | Use model_redirect to redirect the model name to a local folder. `model_redirect` can be a json file mapping the model between repo_id and local folder: {"meta-llama/Llama-3.2-1B": "/tmp/Llama-3.2-1B"} or a space separated values table file: meta-llama/Llama-3.2-1B /tmp/Llama-3.2-1B | 1: transformers_utils/utils.py:92 |
VLLM_envs.py:1976 | str | None, None | User override folder for tuned Triton-kernel configs. Shared by MoE, Mamba SSU, and LoRA. Filenames are distinct so one folder can hold all. Each component first checks this folder, then the configs shipped with vLLM (if any). If no JSON matches, it uses a hard-coded heuristic. | 4: lora/layers/fused_moe.py:156, lora/ops/triton_ops/utils.py:163, model_executor/layers/fused_moe/fused_moe.py:1135, model_executor/layers/mamba/ops/mamba_ssm.py:84 |
VLLM_envs.py:2161 | bool, False | Disable using pytorch's pin memory for CPU offloading. | 2: model_executor/model_loader/utils.py:243, model_executor/offloader/base.py:31 |
VLLM_envs.py:2165 | bool, False | Disable using UVA (Unified Virtual Addressing) for CPU offloading. | 2: model_executor/offloader/uva.py:53, platforms/xpu.py:435 |
VLLM_envs.py:2178 | bool, False | On WSL2 with a compatible kernel (>= 4.19.121), pinned memory is supported but disabled by default due to a small performance regression. Set to 1 when pinned memory or UVA is required (e.g. CPU offloading or v2 model runner). | 1: platforms/cuda.py:322 |
Kernels, attention and quantization (32)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:886 | bool, True | Whether to use the FlashInfer top-k / top-p sampler on CUDA. Enabled by default when the hardware supports it — set to 0 to opt out explicitly, which forces the PyTorch-native (Triton for bs>=8) path. | 2: v1/sample/ops/topk_topp_sampler.py:120, v1/sample/ops/topk_topp_sampler.py:151 |
VLLM_envs.py:1094 | int, 512 | Maximum size (in MB) for logits tensor in sparse MLA indexer prefill chunks. Bounds the [M, N] float32 logits tensor to prevent CUDA OOM. Default: 512 MB | 9: model_executor/layers/sparse_attn_indexer.py:503, model_executor/layers/sparse_mqa_indexer.py:124, models/glm5next/amd/sparse_indexer.py:207, models/glm5next/nvidia/sparse_indexer.py:177, models/qwen4_exp/nvidia/ops/qsa_indexer.py:620 (+4 more) |
VLLM_envs.py:1102 | int, 8192 | KV context length each adaptive-verification profiling request pretends to carry, so the profiled step reads a realistic amount of cache. Raise it for long-context deployments, where step cost is dominated by attention over a much larger KV cache than the default assumes. Clamped to max_model_len - query_len. Default: 8192 tokens | 1: v1/worker/gpu/spec_decode/adaptive_verification.py:209 |
VLLM_envs.py:1182 | bool, False | If set, vLLM will use Triton implementations of AWQ. | 3: _custom_ops.py:574, _custom_ops.py:607, platforms/rocm.py:1180 |
VLLM_envs.py:1187 | bool, False | If set, monkey-patch triton.runtime.autotuner.Autotuner.run to skip benchmarking and select the first valid config (walking past invalid ones). Used to eliminate autotuning variability when measuring kernel performance and applied before running any kernel. | no envs.* use; named in vllm/env_override.py, vllm/triton_utils/force_first_config.py, tests/test_force_first_config.py |
VLLM_envs.py:1193 | int, 4 | Maximum compiler threads per worker for registered CUDA Triton JIT warmup. Set to 1 for serial warmup. Does not affect runtime JIT or autotuning. | 2: model_executor/warmup/jit_warmup_triton_helper.py:217, model_executor/warmup/jit_warmup_triton_helper.py:265 |
VLLM_envs.py:1212 | list[str], [] | List of quantization kernels that should be disabled, used for testing and performance comparisons. Currently only affects MPLinearKernel selection (kernels: MacheteLinearKernel, MarlinLinearKernel, ExllamaLinearKernel) | 7: model_executor/kernels/linear/__init__.py:644, model_executor/kernels/linear/__init__.py:916, model_executor/kernels/linear/__init__.py:977, model_executor/kernels/linear/__init__.py:1023, model_executor/kernels/linear/__init__.py:1076 (+2 more) |
VLLM_envs.py:1218 | bool, False | Selects hw-agnostic layers for HF transformer backend | 2: model_executor/models/transformers/layers.py:26, model_executor/models/transformers/layers.py:48 |
VLLM_envs.py:1221 | bool, True | (no comment of its own) | 1: model_executor/layers/mamba/gdn/qwen_gdn_linear_attn.py:687 |
VLLM_envs.py:1227 | Literal["cuda", "triton"], "cuda"choices: cuda, triton | Select the GDN MTP decode implementation. "cuda" uses the fused decode kernel where supported and falls back to "triton" otherwise; setting it explicitly to "cuda" raises when unsupported. | 1: model_executor/layers/mamba/gdn/qwen_gdn_linear_attn.py:689 |
VLLM_envs.py:1239 | bool, False | Optional: enable external Oink custom ops (e.g., Blackwell RMSNorm). Disabled by default. | 1: platforms/cuda.py:726 |
VLLM_envs.py:1247 | bool, False | Disable aiter ops unless specifically enabled. Acts as a parent switch to enable the rest of the other operations. Set to 1 to dequantize MXFP4 weights to BF16 once at load time and run as a BF16 checkpoint (no per-step weight dequant). This improves emulation latency at the cost of additional device memory. Default off. | 1: model_executor/kernels/linear/mxfp4/emulation.py:104 |
VLLM_envs.py:1256 | bool, True | On hardware without a native MXFP8 kernel (e.g. ROCm gfx942 / MI300), the MXFP8 emulation path dequantizes weights MXFP8->BF16 once at load time and runs as a BF16 checkpoint (no per-step dequant). Set to 0 to fall back to per-step dequant: keeps the 1-byte MXFP8 weights (~half the weight memory) at the cost of dequantizing every forward step (much slower). … | 2: model_executor/kernels/linear/mxfp8/emulation.py:47, model_executor/layers/quantization/modelopt.py:1485 |
VLLM_envs.py:1451 | bool, True | If set to "0", disable LayerName opaque type for layer_name parameters in custom ops. Defaults to enabled on torch >= 2.11. | 1: utils/torch_utils.py:995 |
VLLM_envs.py:1478 | bool, False | If set, vLLM will disable the MLA attention optimizations. | 2: config/model.py:2069, transformers_utils/model_arch_config_convertor.py:97 |
VLLM_envs.py:1554 | bool, False | Whether to use atomicAdd reduce in gptq/awq marlin kernel. | 2: model_executor/layers/quantization/utils/marlin_utils.py:677, model_executor/layers/quantization/utils/marlin_utils.py:697 |
VLLM_envs.py:1558 | Literal["int8", "fp8"] | None, Nonechoices: int8, fp8 | The activation dtype for marlin kernel | 3: model_executor/layers/quantization/utils/marlin_utils.py:721, model_executor/layers/quantization/utils/marlin_utils.py:723, model_executor/layers/quantization/utils/marlin_utils.py:725 |
VLLM_envs.py:1562 | dict[str, Any] | None, None | The online quantization dtype for humming kernel | 1: model_executor/layers/quantization/humming.py:268 |
VLLM_envs.py:1567 | dict[str, Any] | None, None | The activation dtype config for humming kernel. Explicit schemas disable fallback unless the config includes "allow_fallback": true. | 4: model_executor/layers/fused_moe/oracle/mxfp4.py:1598, model_executor/layers/quantization/humming.py:291, model_executor/layers/quantization/humming.py:292, model_executor/layers/quantization/utils/humming/moe.py:571 |
VLLM_envs.py:1571 | bool, False | Whether to use fp16 accumulator mma | 4: model_executor/layers/fused_moe/experts/fused_humming_moe.py:165, model_executor/layers/fused_moe/experts/fused_humming_moe.py:170, model_executor/layers/fused_moe/experts/fused_humming_moe.py:176, model_executor/layers/quantization/utils/humming/linear.py:164 |
VLLM_envs.py:1662 | bool, False | Kimi K3 only, and unrelated to the MoE flags above. Tap the pre-norm AttnRes mixture, rather than the post-mixture sum, as the auxiliary hidden state handed to a DFlash drafter. This changes the numerics the speculator sees, so it is off by default while the effect is measured. | 2: models/kimi_k3/nvidia/model.py:1070, models/kimi_k3/nvidia/specialized_decode/runtime/__init__.py:131 |
VLLM_envs.py:1667 | bool, True | Use the SM100 BF16 GEMM-AR kernel for eligible Kimi-K3 row-parallel attention projections. All TP ranks must belong to one NVLink domain. | 1: models/kimi_k3/nvidia/model.py:181 |
VLLM_envs.py:1672 | bool, False | Fuse eligible sequence-parallel row-parallel projections with their TP reduce-scatter using the SM100 BF16/MXFP8 GEMM-RS kernel (Kimi-K3 attention/shared-expert projections, DeepSeek-V4.1 ``wo_b``). All TP ranks must belong to one NVLink domain. | 2: models/deepseek_v41/nvidia/model.py:298, models/kimi_k3/nvidia/model.py:181 |
VLLM_envs.py:1675 | bool, True | Allow use of FlashInfer FP8 block-scale GEMM for linear layers. This uses TensorRT-LLM kernels and requires SM90+ (Hopper). | 1: utils/flashinfer.py:1186 |
VLLM_envs.py:1793 | str | None, None | Override the directory for the FlashInfer autotune config cache. | 2: model_executor/warmup/flashinfer_autotune_cache.py:42, model_executor/warmup/flashinfer_autotune_cache.py:104 |
VLLM_envs.py:1799 | list[str] | None, None | Comma-separated FlashInfer op names to exclude from autotuning, using the heuristic fallback tactic instead. Unset: skip "fp4_gemm" when the CuTe-DSL NVFP4 linear kernel is selected. Empty: skip nothing. | 2: model_executor/warmup/kernel_warmup.py:300, model_executor/warmup/kernel_warmup.py:301 |
VLLM_envs.py:1815 | int, 394 * 1024 * 1024 | Control the workspace buffer size for the FlashInfer backend. | 7: v1/attention/backends/flashinfer.py:144, v1/attention/backends/flashinfer.py:1218, v1/attention/backends/mla/flashinfer_mla_sparse.py:395, v1/attention/backends/mla/flashinfer_mla_sparse.py:397, v1/attention/backends/mla/flashinfer_mla_sparse.py:423 (+2 more) |
VLLM_envs.py:1877 | Literal["LBNHC", "LBHNC", "LHBNC", "NHD", "HND", "BLHNC", "BLNHC", "BHLNC"]
| None, Nonechoices: LBNHC, LBHNC, LHBNC, NHD, HND, BLHNC, BLNHC, BHLNC | KV Cache layout used throughout vllm. Some common values are: - LBNHC - LBHNC Where N=num_states, H=num_heads and C=state_content. The default value will leave the layout choice to the backend. Mind that backends may only implement and support a subset of all possible layouts. LHBNC hoists the head dim outside the block dim; backends must opt in via … | 1: v1/attention/backends/utils.py:361 |
VLLM_envs.py:1886 | Literal["SD", "DS"] | None, Nonechoices: SD, DS | SSM conv state layout used for Mamba models. - SD: (state_len, dim) — dim contiguous (default) - DS: (dim, state_len) — TP-sharded dim on dim1, consistent with SSM temporal state and LBHNC KV cache layout. | 1: model_executor/layers/mamba/mamba_utils.py:36 |
VLLM_envs.py:1929 | bool, True | Allow chunked local attention with hybrid kv cache manager. Currently using the Hybrid KV cache manager with chunked local attention in the Llama4 models (the only models currently using chunked local attn) causes a latency regression. For this reason, we disable it by default. This flag is used to allow users to enable it if they want to (to save on … | 1: config/vllm.py:2225 |
VLLM_envs.py:2127 | int, 1024 | Token-count cutoff for multi-stream overlap of the attention input GEMM with auxiliary GEMMs (e.g. fused_wqa_wkv overlapped with indexer weights / kv-score projections in DeepSeek-V4). At or below this many tokens the FP8 main GEMM has idle SMs to share with the bf16 aux GEMMs and overlap is a 5-45% win; above it the FP8 GEMM saturates the device and the … | 3: models/deepseek_v4/attention.py:727, models/deepseek_v41/attention.py:1017, models/deepseek_v41/nvidia/specialized_decode/runtime/decode.py:108 |
VLLM_envs.py:2276 | bool, False | If set to 1, enable the HPC fused kernels (requires the hpc package (.so) and an sm100/sm103 device). Covers: * the HY V4 iHC ops -- each of the eager HYV4HCPreLayer / HYV4HCPostLayer / HYV4HCHeadLayer bodies becomes one kernel launch; * the gated-MLA output gating (attn_out * sigmoid(gate projection)), fused into gated_mla_gemm; elementwise gating only. … | 2: model_executor/layers/hpc/gated_mla.py:37, model_executor/layers/hpc/hpc_ihc.py:50 |
Build and packaging (1)#
| Variable | Type and default | Description (code comment) | Used in vllm/ |
|---|---|---|---|
VLLM_envs.py:2278 | not in TYPE_CHECKING; parse default "0" | Whether to skip version suffix when building package | no envs.* use; named in setup.py |
Check yourself#
- 1You starteasy
vllm servewithVLLM_DEBUG_LOG_API_SERVER_RESPONSE=1. Does the API server log its responses?Show answer
No. The lambda compares the lower-case text with
"true", so"1"givesFalse(vllm/envs.py:830-832). Usetruefor this variable. Other booleans need1, so check the lambda of each variable. - 2A test changesmedium
os.environ["VLLM_LOG_STATS_INTERVAL"]while the server runs. Which processes see the new value?Show answer
Only the front-end process, and only at the next read. The front end never calls
enable_envs_cache(), so eachenvs.Xread runs the lambda again (vllm/envs.py:2297-2298). The engine core and the workers are other processes with their own copy of the environment. They cache their values at the end of start-up (vllm/v1/engine/core.py:241-243,vllm/v1/executor/multiproc_executor.py:708-710). - 3You sethard
VLLM_ENABLE_V1_MULTIPROCESSING=0to run the engine core inside the API server process ofvllm serve. Does it work? And what doesVLLM_ENABLE_V1_MULTIPROCESSING=truedo?Show answer
It does not work. Only
LLMEnginereads the variable (vllm/v1/engine/llm_engine.py:170,vllm/v1/engine/llm_engine.py:186).AsyncLLMalways callsEngineCoreClient.make_async_mp_client, which starts the engine core in a background process (vllm/v1/engine/async_llm.py:188-193). The texttrueraisesValueErrorat the first read, because the lambda callsint()on it (vllm/envs.py:1442-1444).