vLLM Explained

Environment variables

Referenceabout 72 min read

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.

  1. 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
  2. For the run time. The dict environment_variables maps each name to a function with no arguments, mostly a lambda (vllm/envs.py:618). The function reads os.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_LEVEL falls back to "INFO". VLLM_LOG_STATS_INTERVAL falls 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 lambdaExampletrue1yes
bool(int(os.getenv(...)))VLLM_ENABLE_V1_MULTIPROCESSING (vllm/envs.py:1442-1444)ValueErrorTrueValueError
os.getenv(...) == "1"VLLM_SKIP_P2P_CHECK (vllm/envs.py:1207)FalseTrueFalse
.lower() == "true"VLLM_DEBUG_LOG_API_SERVER_RESPONSE (vllm/envs.py:830-832)TrueFalseFalse
.lower() in ("1", "true")VLLM_USE_MODELSCOPE (vllm/envs.py:735-737)TrueTrueFalse
maybe_convert_bool: unset gives None (vllm/envs.py:359-362)VLLM_USE_V2_MODEL_RUNNER (vllm/envs.py:2147-2149)ValueErrorTrueValueError

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:

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:

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.py has 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_CHECKING block. When the lambda falls back to another value, the row says so (but the read falls back to). A few variables have no TYPE_CHECKING line; 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 read envs.NAME, from vllm.envs import NAME or envs.is_set("NAME"), and links the first five. "No envs.* use" means that no Python file in vllm/ reads the variable through envs. The row then names other files that mention it, for example setup.py or 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.

VariableDefaultWhat it does in vllm serve
VLLM_LOGGING_LEVELINFO, 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_PLUGINSnot 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_RUNNERnot 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_INTERVAL10. 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_MULTIPROCESSING1 (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_METHODfork 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_TIMEOUT30 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_IPempty (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_PORTnot 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_KEYnot 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_S600 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_MODE0 (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_DEATH0 (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_ALIVE5 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.

VariableTYPE_CHECKING saysThe lambda falls back toEffect of the real default
VLLM_SKIP_P2P_CHECKFalse (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_MB0 (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_SIZE is read with getenv in csrc/cumem_allocator.cpp (csrc/cumem_allocator.cpp:26). The lambda and the envs cache do not apply.
  • Rust: VLLM_CHAT_TEMPLATE_FUEL is read by the experimental Rust front end (rust/src/chat/src/renderer/hf/mod.rs:106). No Python file outside envs.py reads it, so the Python front end does not use it.
  • Python, with os.environ: VLLM_ENABLE_CUDA_COMPATIBILITY and VLLM_CUDA_COMPATIBILITY_PATH (vllm/env_override.py:62-69), and VLLM_TRITON_FORCE_FIRST_CONFIG (vllm/env_override.py:976). These reads skip the lambda and the envs cache.
  • Build time only: MAX_JOBS, NVCC_THREADS, VLLM_USE_PRECOMPILED and other variables of the "Installation time" group have no reader in vllm/. setup.py loads vllm/envs.py as 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_TARGET_DEVICE
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_MAIN_CUDA_VERSION
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_FLOAT32_MATMUL_PRECISION
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_precision1: v1/worker/gpu_worker.py:214
VLLM_BATCH_INVARIANT
envs.py:637
bool, FalseEnable 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_REPLICATE_EMBED
envs.py:638
bool, False(no comment of its own)1: model_executor/layers/fused_embed_norm.py:58
VLLM_TRITON_USE_TD
envs.py:648
bool | None, NoneUse 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_GPU_SYNC_CHECK
envs.py:657
Literal["warn", "error"] | None, None
choices: 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_JOBS
envs.py:662
str | None, NoneMaximum number of compilation jobs to run in parallel. By default this is the number of CPUsno envs.* use; named in setup.py, tools/build_nixl_with_torch215_for_rubin.py, tools/build_triton_from_source.sh
NVCC_THREADS
envs.py:666
str | None, NoneNumber 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_USE_PRECOMPILED
envs.py:668
bool, FalseIf set, vllm will use precompiled native binaries (*.so and vllm-rs).no envs.* use; named in setup.py, docker/Dockerfile, docker/Dockerfile.rocm
VLLM_USE_PRECOMPILED_RUST
envs.py:673
bool, FalseIf set, vllm will use the precompiled Rust frontend binary (vllm-rs).no envs.* use; named in setup.py, tests/test_envs.py
VLLM_SKIP_PRECOMPILED_VERSION_SUFFIX
envs.py:677
bool, FalseIf set, skip adding +precompiled suffix to version stringno envs.* use; named in setup.py, docker/Dockerfile
VLLM_DOCKER_BUILD_CONTEXT
envs.py:682
bool, FalseUsed 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_BUILD_COMMIT
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_BUILD_PIPELINE
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_BUILD_URL
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_IMAGE_TAG
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_BUILD_TYPE
envs.py:694
Literal["Debug", "Release", "RelWithDebInfo"] | None, None
choices: 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
VERBOSE
envs.py:698
bool, FalseIf set, vllm will print verbose logs during installationno envs.* use; named in setup.py
VLLM_CONFIG_ROOT
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_ROCM_SLEEP_MEM_CHUNK_SIZE
envs.py:758
int, 256flag to control the chunk size (in MB) for sleeping memory allocations under ROCmno envs.* use; named in csrc/cumem_allocator.cpp, docs/features/sleep_mode.md
VLLM_ROCM_USE_AITER
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_ROCM_USE_AITER_CUSTOM_AR
envs.py:1265
bool, TrueUse 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_ROCM_MUSE_MOE_REDUCE_DTYPE
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_ROCM_USE_AITER_LINEAR
envs.py:1276
bool, Trueuse 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 gemms3: _aiter_ops.py:2189, _aiter_ops.py:2220, platforms/rocm.py:402
VLLM_ROCM_USE_AITER_LINEAR_HIPBMM
envs.py:1279
bool, False(no comment of its own)3: _aiter_ops.py:2198, _aiter_ops.py:2228, platforms/rocm.py:403
VLLM_ROCM_USE_AITER_MOE
envs.py:1284
bool, TrueWhether 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_ROCM_USE_AITER_MOE_SITUV2
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_ROCM_USE_AITER_MOE_A4W4_DSV4
envs.py:1299
bool | None, NoneOpt-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_ROCM_AITER_MOE_DISPATCH_POLICY
envs.py:1310
int, 0MoE 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_ROCM_USE_AITER_RMSNORM
envs.py:1314
bool, Trueuse aiter rms norm op if aiter ops are enabled.1: platforms/rocm.py:1379
VLLM_ROCM_USE_AITER_MLA
envs.py:1319
bool, TrueWhether to use aiter mla ops. By default is enabled.2: _aiter_ops.py:2191, _aiter_ops.py:2222
VLLM_ROCM_AITER_MLA_DCP_VERIFY
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_ROCM_AITER_MLA_ASM_PADDING
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_ROCM_USE_AITER_MHA
envs.py:1348
bool, TrueWhether to use aiter mha ops. By default is enabled.2: _aiter_ops.py:2192, _aiter_ops.py:2223
VLLM_ROCM_USE_AITER_TRITON_SPARSE_MLA
envs.py:1355
bool, FalseWhether 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_ROCM_USE_AITER_TRITON_ROPE
envs.py:1361
bool, FalseWhether to use aiter rope. By default is disabled.2: _aiter_ops.py:2200, _aiter_ops.py:2229
VLLM_ROCM_USE_AITER_FP8BMM
envs.py:1367
bool, FalseWhether 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_ROCM_USE_AITER_FP4BMM
envs.py:1372
bool, FalseWhether 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_ROCM_USE_AITER_UNIFIED_ATTENTION
envs.py:1376
bool, FalseUse AITER triton unified attention for V1 attention2: _aiter_ops.py:2194, _aiter_ops.py:2225
VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS
envs.py:1382
bool, FalseWhether 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_ROCM_USE_AITER_TRITON_GEMM
envs.py:1388
bool, TrueWhether to use aiter triton kernels for gemm ops. By default is enabled.2: _aiter_ops.py:2205, _aiter_ops.py:2234
VLLM_ROCM_USE_SKINNY_GEMM
envs.py:1392
bool, Trueuse rocm skinny gemms3: model_executor/kernels/linear/scaled_mm/rocm.py:92, model_executor/layers/utils.py:356, model_executor/layers/utils.py:380
VLLM_ROCM_FP8_PADDING
envs.py:1396
bool, TruePad the fp8 weights to 256 bytes for ROCm1: model_executor/layers/quantization/utils/fp8_utils.py:1283
VLLM_ROCM_MOE_PADDING
envs.py:1398
bool, TruePad the weights for the moe kernel2: model_executor/layers/fused_moe/oracle/unquantized.py:497, model_executor/layers/fused_moe/unquantized_fused_moe_method.py:154
VLLM_ROCM_SHUFFLE_KV_CACHE_LAYOUT
envs.py:1400
bool, FalseWhether to use the shuffled kv cache layout2: _aiter_ops.py:2193, _aiter_ops.py:2224
VLLM_ROCM_QUICK_REDUCE_QUANTIZATION
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 allreduce1: distributed/device_communicators/quick_all_reduce.py:173
VLLM_ROCM_QUICK_REDUCE_CAST_BF16_TO_FP16
envs.py:1415
bool, TrueCustom 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 fp163: _aiter_ops.py:99, distributed/device_communicators/quick_all_reduce.py:172, distributed/device_communicators/quick_all_reduce.py:228
VLLM_ROCM_QUICK_REDUCE_MAX_SIZE_BYTES_MB
envs.py:1425
int | None, NoneCustom 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_ROCM_QUICK_REDUCE_MIN_SIZE_BYTES_MB
envs.py:1432
int | None, NoneCustom 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_ROCM_QUICK_REDUCE_QUANTIZATION_MIN_SIZE_KB
envs.py:1438
int | None, NoneControls 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_ROCM_FP8_MFMA_PAGE_ATTN
envs.py:1951
bool, FalseIf set, use the fp8 mfma in rocm paged attention.1: _custom_ops.py:124

CPU backend (7)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_CPU_KVCACHE_SPACE
envs.py:895
int | None, 0(CPU backend only) CPU key-value cache space. default is None and will be set as 4 GB1: entrypoints/launchers/render/entry.py:88
VLLM_CPU_OMP_THREADS_BIND
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_CPU_NUM_OF_RESERVED_CPU
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_CPU_CI_ENV
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_CPU_ATTN_SPLIT_KV
envs.py:913
bool, True(CPU backend only) whether to enable attention spilt KV.1: v1/attention/backends/cpu_attn.py:273
VLLM_ZENTORCH_WEIGHT_PREPACK
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_CPU_INT4_W4A8
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_XPU_PP_MICROBATCH
envs.py:926
bool, TrueUsing 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_XPU_FORCE_N_CONTIG_WEIGHT
envs.py:2221
bool, FalseForce N-contiguous weight layout for all XPU unquantized linears.1: model_executor/layers/linear.py:224
VLLM_XPU_USE_SAMPLER_KERNEL
envs.py:2225
bool, Truewhether use xpu specific sample kernel1: v1/sample/ops/topk_topp_sampler.py:176
VLLM_XPU_INC_WNA16_BACKEND
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_XLA_CACHE_PATH
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_XLA_CHECK_RECOMPILATION
envs.py:1086
bool, FalseIf set, assert on XLA recompilation after each execution step.no envs.* use
VLLM_XLA_USE_SPMD
envs.py:1090
bool, FalseEnable SPMD mode for TPU backend.1: config/parallel.py:1063
VLLM_TPU_USING_PATHWAYS
envs.py:1594
bool, FalseWhether using Pathways1: platforms/__init__.py:37

Logging and usage statistics (19)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_DEBUG_LOG_API_SERVER_RESPONSE
envs.py:830
bool, FalseWhether to log responses from API Server for debugging1: entrypoints/serve/middleware/register.py:57
VLLM_USAGE_STATS_SERVER
envs.py:838
str, "https://stats.vllm.ai"Usage stats collection1: usage/usage_lib.py:32
VLLM_NO_USAGE_STATS
envs.py:841
bool, False(no comment of its own)1: usage/usage_lib.py:64
VLLM_DO_NOT_TRACK
envs.py:842
bool, False(no comment of its own)1: usage/usage_lib.py:63
VLLM_USAGE_SOURCE
envs.py:850
str, "production"(no comment of its own)1: usage/usage_lib.py:239
VLLM_CONFIGURE_LOGGING
envs.py:855
bool, TrueLogging 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_PATH2: config/logging.py:34, logger.py:211
VLLM_LOGGING_CONFIG_PATH
envs.py:858
str | None, None(no comment of its own)2: config/logging.py:43, logger.py:213
VLLM_LOGGING_LEVEL
envs.py:860
str, "INFO"this is used for configuring the default logging level7: config/compilation.py:939, config/logging.py:27, logger.py:82, logger.py:88, logger.py:96 (+2 more)
VLLM_LOGGING_STREAM
envs.py:862
str, "ext://sys.stdout"this is used for configuring the default logging stream4: logger.py:68, logger.py:70, logger.py:97, logger.py:237
VLLM_LOGGING_PREFIX
envs.py:864
str, ""if set, VLLM_LOGGING_PREFIX will be prepended to all log messages1: logger.py:29
VLLM_LOGGING_COLOR
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_COLOR
envs.py:869
bool, FalseStandard unix flag for disabling ANSI color codes1: logger.py:64
FORCE_COLOR
envs.py:871
bool, FalseDe-facto standard flag for forcing ANSI color codes (e.g. non-tty case)1: logger.py:66
VLLM_LOG_STATS_INTERVAL
envs.py:874
float, 10.0If 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_TRACE_FUNCTION
envs.py:882
int, 0Trace function calls If set to 1, vllm will trace function calls Useful for debugging1: config/vllm.py:880
VLLM_LOG_BATCHSIZE_INTERVAL
envs.py:1445
float, -1(no comment of its own)2: forward_context.py:22, forward_context.py:25
VLLM_LOG_MODEL_INSPECTION
envs.py:2153
bool, FalseLog 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

envs.py:2182
bool, FalseDisable logging of vLLM logo at server startup time.1: entrypoints/common/startup.py:17
VLLM_REQUEST_BODY_LOG_LEVEL
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_PATTERN_MATCH_DEBUG
envs.py:782
str | None, NoneDebug 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_DEBUG_DUMP_PATH
envs.py:787
str | None, NoneDump 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_TEST_FORCE_LOAD_FORMAT
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_COMPUTE_NANS_IN_LOGITS
envs.py:1892
bool, FalseEnable 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_RAISE_ON_LOGIT_NANS
envs.py:1898
bool, FalseRaise 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_CUSTOM_SCOPES_FOR_PROFILING
envs.py:2013
bool, FalseAdd optional custom scopes for profiling, disable to avoid overheads1: v1/utils.py:792
VLLM_NVTX_SCOPES_FOR_PROFILING
envs.py:2017
bool, FalseAdd optional nvtx scopes for profiling, disable to avoid overheads1: v1/utils.py:794
VLLM_GC_DEBUG
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 objects2: utils/gc_utils.py:38, utils/gc_utils.py:136
VLLM_DEBUG_WORKSPACE
envs.py:2101
bool, FalseDebug workspace allocations. logging of workspace resize operations.3: v1/worker/workspace.py:92, v1/worker/workspace.py:109, v1/worker/workspace.py:269
VLLM_DEBUG_MFU_METRICS
envs.py:2157
bool, FalseDebug logging for --enable-mfu-metrics2: v1/metrics/perf.py:1581, v1/metrics/perf.py:1679

torch.compile and CUDA graphs (13)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_USE_STANDALONE_COMPILE
envs.py:764
bool, TrueFeature 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_ENABLE_PREGRAD_PASSES
envs.py:773
bool, TrueInductor'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/1745021: compilation/compiler_interface.py:357
VLLM_USE_BREAKABLE_CUDAGRAPH
envs.py:777
bool, FalseExperimental: breakable cudagraph does not rely on torch.compile3: compilation/breakable_cudagraph.py:55, config/vllm.py:2152, v1/worker/gpu/model_runner.py:747
VLLM_USE_AOT_COMPILE
envs.py:791
bool, FalseFeature 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_USE_BYTECODE_HOOK
envs.py:794
bool, TrueFeature flag to enable/disable bytecode in TorchCompileWithNoGuardsWrapper.3: compilation/wrapper.py:129, compilation/wrapper.py:177, compilation/wrapper.py:193
VLLM_FORCE_AOT_LOAD
envs.py:800
bool, FalseForce 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_USE_MEGA_AOT_ARTIFACT
envs.py:804
bool, FalseEnable 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_DISABLE_COMPILE_CACHE
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_ENABLE_CUDAGRAPH_GC
envs.py:1913
bool, FalseControls 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_ENABLE_INDUCTOR_MAX_AUTOTUNE
envs.py:2079
bool, TrueEnable 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_ENABLE_INDUCTOR_COORDINATE_DESCENT_TUNING
envs.py:2084
bool, TrueIf set to 1, enable coordinate_descent_tuning; By default, this is enabled (1)1: compilation/compiler_interface.py:775
VLLM_COMPILE_CACHE_SAVE_FORMAT
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_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS
envs.py:2217
bool, TrueIf 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.02: v1/worker/gpu_worker.py:713, v1/worker/gpu_worker.py:772

KV transfer, offload and disaggregation (23)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_NIXL_SIDE_CHANNEL_HOST
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_NIXL_SIDE_CHANNEL_PORT
envs.py:1723
int, 5600Port used for NIXL handshake between remote agents.1: distributed/kv_transfer/kv_connector/v1/nixl/base_scheduler.py:78
VLLM_P2P_SIDE_CHANNEL_HOST
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_P2P_SIDE_CHANNEL_PORT
envs.py:1733
int, 5710Port the P2P KV-offload control socket binds to.1: v1/kv_offload/tiering/p2p/manager.py:333
VLLM_P2P_MAX_PEERS
envs.py:1739
int, 128Maximum 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_P2P_HANDSHAKE_TIMEOUT_S
envs.py:1743
int, 30Seconds 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_P2P_IDLE_TIMEOUT_S
envs.py:1750
int, 300Seconds 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_EC_SIDE_CHANNEL_HOST
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_EC_SIDE_CHANNEL_PORT
envs.py:1758
int, 5601Port 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_MOONCAKE_CONNECTOR_TIMEOUT
envs.py:1763
float, 30.0Per-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_MOONCAKE_BOOTSTRAP_PORT
envs.py:1767
int, 8998Port 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_MOONCAKE_STORE_TIER_LOG
envs.py:1771
bool, FalseLog per-batch memory/disk tier breakdown on external GETs.1: distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py:1257
VLLM_MOONCAKE_LOAD_RECV_THREADS
envs.py:1779
int, 1Number 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_MOONCAKE_DISK_STAGING_USABLE_RATIO
envs.py:1783
float, 0.9Fraction 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_PREFERRED_SEGMENT
envs.py:1787
str | None, NonePin this rank to a specific owner segment ("host:port").1: distributed/kv_transfer/kv_connector/v1/mooncake/rdma_utils.py:39
MOONCAKE_REQUESTER_LOCAL_HOSTNAME
envs.py:1789
str | None, NoneOverride the hostname the rank registers as a Mooncake requester.1: distributed/kv_transfer/kv_connector/v1/mooncake/rdma_utils.py:22
VLLM_MOONCAKE_ABORT_REQUEST_TIMEOUT
envs.py:1902
int, 480Timeout (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_KV_EVENTS_USE_INT_BLOCK_HASHES
envs.py:2022
bool, TrueRepresent 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_OBJECT_STORAGE_SHM_BUFFER_NAME
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_KV_OFFLOAD_MAX_BATCH_DESCRIPTORS
envs.py:2171
int, 0Max 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_USE_SIMPLE_KV_OFFLOAD
envs.py:2239
not in TYPE_CHECKING; parse default "0"Enable simple KV offload.1: config/vllm.py:1150
VLLM_GPU_NIC_PCIE_MAPPING
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_NIC_SELECTION_VARS
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_HUMMING_MOE_GEMM_TYPE
envs.py:1578
Literal["indexed", "grouped", "auto"] | None, NoneWhether 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 automatically1: model_executor/layers/fused_moe/experts/fused_humming_moe.py:113
VLLM_DEEPEPLL_NVFP4_DISPATCH
envs.py:1584
bool, FalseWhether to use DeepEPLL kernels for NVFP4 quantization and dispatch method only supported on Blackwell GPUs and with https://github.com/deepseek-ai/DeepEP/pull/3413: 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_USE_DEEP_GEMM
envs.py:1598
bool, TrueAllow 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_MOE_USE_DEEP_GEMM
envs.py:1600
bool, TrueAllow 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_USE_DEEP_GEMM_E8M0
envs.py:1604
bool, TrueWhether 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_USE_DEEP_GEMM_TMA_ALIGNED_SCALES
envs.py:1608
bool, TrueWhether to create TMA-aligned scale tensor when DeepGEMM is used.1: model_executor/kernels/linear/scaled_mm/deep_gemm.py:42
VLLM_DEEP_GEMM_WARMUP
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_USE_FUSED_MOE_GROUPED_TOPK
envs.py:1634
bool, TrueWhether to use fused grouped_topk used for MoE expert selection.1: model_executor/layers/fused_moe/router/grouped_topk_router.py:93
VLLM_MOE_SKIP_PADDING
envs.py:1640
bool, TrueSkip 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 sentinel21: 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_STEP5_SHARD_SP_SHARED_EXPERT
envs.py:1643
bool, FalseStep5 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_KIMI_K3_SHARD_SP_SHARED_EXPERT
envs.py:1655
bool, FalseKimi-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_B12X_MOE_FP4_FORCE_A16
envs.py:1679
bool, FalseForce 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_USE_FLASHINFER_MOE_INT4
envs.py:1683
bool, FalseAllow use of FlashInfer MxInt4 MoE kernels for fused moe ops.1: model_executor/layers/quantization/utils/flashinfer_mxint4_moe.py:27
VLLM_FLASHINFER_MOE_A2A_LOW_PRECISION_COMBINE
envs.py:1821
bool, FalseTransmit 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_MAX_TOKENS_PER_EXPERT_FP4_MOE
envs.py:1828
int, 163840Control 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_MOE_ROUTING_SIMULATION_STRATEGY
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 outputs2: model_executor/layers/fused_moe/router/router_factory.py:268, model_executor/layers/fused_moe/router/routing_simulator_router.py:348
VLLM_DEEPEP_BUFFER_SIZE_MB
envs.py:2034
int, 1024The size in MB of the buffers (NVL and RDMA) used by DeepEP3: distributed/device_communicators/all2all.py:275, distributed/device_communicators/all2all.py:280, distributed/device_communicators/all2all.py:357
VLLM_DEEPEP_HIGH_THROUGHPUT_FORCE_INTRA_NODE
envs.py:2040
bool, FalseForce 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_DEEPEP_LOW_LATENCY_USE_MNNVL
envs.py:2045
bool, FalseAllow DeepEP to use MNNVL (multi-node nvlink) for internode_ll kernel, turn this for better latency on GB200 like system1: distributed/device_communicators/all2all.py:376
VLLM_DEEPEP_V2_ALLOW_HYBRID_MODE
envs.py:2053
bool, TrueDeepEP 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_DEEPEP_V2_PREFER_OVERLAP
envs.py:2057
bool, FalseDeepEP v2: use fewer SMs at slight throughput cost1: distributed/device_communicators/all2all.py:1142
VLLM_DEEPEP_V2_ALLOW_MULTIPLE_REDUCTION
envs.py:2061
bool, FalseDeepEP v2: trade precision for transfer size in combine1: distributed/device_communicators/all2all.py:1143
VLLM_DISABLE_SHARED_EXPERTS_STREAM
envs.py:2103
bool, FalseDisables parallel execution of shared_experts via separate cuda stream3: 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_DISABLE_DSV4_MEGAMOE_SHARED_EXPERT_FUSION
envs.py:2109
bool, FalseEmergency 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_SHARED_EXPERTS_STREAM_TOKEN_THRESHOLD
envs.py:2116
int, 256Limits 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 type6: 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_COHERE2_ATTN_MOE_DUAL_STREAM_TOKEN_THRESHOLD
envs.py:2134
int, 256Cohere2 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_ELASTIC_EP_SCALE_UP_LAUNCH
envs.py:2206
bool, FalseWhether 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_ELASTIC_EP_DRAIN_REQUESTS
envs.py:2211
bool, FalseWhether 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)#

VariableType and defaultDescription (code comment)Used in vllm/
CUDA_HOME
envs.py:750
not in TYPE_CHECKING; parse default Nonepath 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_NCCL_SO_PATH
envs.py:753
str | None, NonePath to the NCCL library file. It is needed because nccl>=2.19 brought by PyTorch contains a bug: https://github.com/NVIDIA/nccl/issues/12341: utils/nccl.py:25
LD_LIBRARY_PATH
envs.py:756
str | None, Nonewhen `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_CUDART_SO_PATH
envs.py:1492
str | None, NoneIn 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_HAS_FLASHINFER_CUBIN
envs.py:1907
bool, FalseIf 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_NCCL_INCLUDE_PATH
envs.py:2092
str | None, NoneNCCL header path1: utils/nccl.py:47
VLLM_ENABLE_CUDA_COMPATIBILITY
envs.py:2188
bool, FalseEnable 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_CUDA_COMPATIBILITY_PATH
envs.py:2193
str | None, NonePath 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_ENGINE_READY_TIMEOUT_S
envs.py:812
int, 600Timeout 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_KEEP_ALIVE_ON_ENGINE_DEATH
envs.py:1107
bool, FalseIf set, the OpenAI API server will stay alive even after the underlying AsyncLLMEngine errors and stops serving requests1: entrypoints/launchers/launcher.py:334
VLLM_ALLOW_LONG_MAX_MODEL_LEN
envs.py:1114
bool, FalseIf 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_ENABLE_V1_MULTIPROCESSING
envs.py:1442
bool, TrueIf 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_V1_OUTPUT_PROC_CHUNK_SIZE
envs.py:1474
int, 128Controls 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_EXECUTE_MODEL_TIMEOUT_SECONDS
envs.py:1861
int, 300Timeout 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_WORKER_SHUTDOWN_TIMEOUT_SECONDS
envs.py:1865
int, 5Timeout in seconds for engine and worker process shutdown3: model_executor/model_loader/tensorizer.py:709, v1/engine/core_client.py:526, v1/executor/multiproc_executor.py:485
VLLM_ENABLE_STARTUP_PLAN
envs.py:1984
bool, FalseOpt-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_USE_V2_MODEL_RUNNER
envs.py:2147
bool | None, NoneFlag 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_USE_SPINLOOP_EXT
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_HOST_IP
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_PORT
envs.py:728
int | None, Noneused 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_RPC_BASE_PATH
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_RINGBUFFER_WARNING_INTERVAL
envs.py:745
int, 60Interval in seconds to log a warning message when the ring buffer is full1: distributed/device_communicators/shm_broadcast.py:67
LOCAL_RANK
envs.py:807
int, 0local rank of the process in the distributed setting, used to determine the GPU device id4: distributed/parallel_state.py:1960, distributed/parallel_state.py:2004, distributed/parallel_state.py:2722, distributed/parallel_state.py:2724
CUDA_VISIBLE_DEVICES
envs.py:809
str | None, Noneused to control the visible devices in the distributed setting3: distributed/device_communicators/all_reduce_utils.py:278, distributed/device_communicators/all_reduce_utils.py:364, platforms/cuda.py:635
VLLM_PP_LAYER_PARTITION
envs.py:892
str | None, NonePipeline stage partition strategy1: distributed/utils.py:206
VLLM_DISTRIBUTED_USE_SPLIT_GROUP
envs.py:933
bool, FalseWhen 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_WORKER_MULTIPROC_METHOD
envs.py:938
Literal["fork", "spawn"], "fork"
choices: spawn, fork
Use dedicated multiprocess context for workers. Both spawn and fork work2: utils/numa_utils.py:551, utils/system_utils.py:197
VLLM_SKIP_P2P_CHECK
envs.py:1207
bool, False
but 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_DISABLE_PYNCCL
envs.py:1234
bool, FalseDisable 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_RAY_PER_WORKER_GPUS
envs.py:1483
float, 1.0If 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_RAY_BUNDLE_INDICES
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_DP_RANK
envs.py:1494
int, 0Rank of the process in the data parallel setting1: config/parallel.py:1026
VLLM_DP_RANK_LOCAL
envs.py:1497
int, -1Rank of the process in the data parallel setting. Defaults to VLLM_DP_RANK when not set.1: config/parallel.py:1027
VLLM_DP_SIZE
envs.py:1501
int, 1World size of the data parallel setting1: config/parallel.py:1025
VLLM_DP_MASTER_IP
envs.py:1503
str, ""
but the read falls back to "127.0.0.1"
IP address of the master node in the data parallel setting1: config/parallel.py:1028
VLLM_DP_MASTER_PORT
envs.py:1505
int, 0Port of the master node in the data parallel setting2: config/parallel.py:1029, utils/network_utils.py:188
VLLM_RANDOMIZE_DP_DUMMY_INPUTS
envs.py:1507
bool, FalseRandomize inputs during dummy runs when using Data Parallel2: v1/worker/gpu_model_runner.py:5381, v1/worker/gpu_worker.py:1450
VLLM_RAY_DP_PACK_STRATEGY
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_RAY_DP_PLACEMENT_NODE_IPS
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_RAY_EXTRA_ENV_VAR_PREFIXES_TO_COPY
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_RAY_EXTRA_ENV_VARS_TO_COPY
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_DCP_Q_REPLICATE
envs.py:1612
bool, FalseOpt-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_FLASHINFER_ALLREDUCE_BACKEND
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_MQ_MAX_CHUNK_BYTES_MB
envs.py:1856
int, 16Control 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_LOOPBACK_IP
envs.py:1917
str, ""Used to force set up loopback IP1: utils/network_utils.py:105
VLLM_ALLREDUCE_USE_SYMM_MEM
envs.py:1955
bool, TrueWhether to use pytorch symmetric memory for allreduce1: distributed/device_communicators/cuda_communicator.py:68
VLLM_ALLREDUCE_USE_FLASHINFER
envs.py:1959
bool, TrueWhether to use FlashInfer allreduce2: distributed/device_communicators/cuda_communicator.py:71, distributed/device_communicators/flashinfer_all_reduce.py:211
VLLM_ALLREDUCE_USE_FLASHINFER_PCIE_IPC
envs.py:1965
bool, FalseWhether 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_DBO_COMM_SMS
envs.py:2067
int, 20The 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_USE_NCCL_SYMM_MEM
envs.py:2088
bool, FalseFlag to enable NCCL symmetric memory allocation and registration3: distributed/device_communicators/pynccl_allocator.py:51, distributed/device_communicators/pynccl_wrapper.py:413, v1/attention/backends/mla/indexer.py:257
VLLM_USE_DIRECT_DCP_A2A
envs.py:2243
bool | None, NoneDirect DCP ops default on when applicable; set to 1 to enforce or 0 to disable.1: v1/attention/ops/dcp.py:1139
VLLM_USE_DIRECT_DCP_Q_GATHER
envs.py:2246
bool | None, None(no comment of its own)1: v1/attention/ops/dcp.py:1298
VLLM_USE_DIRECT_DCP_KV_GATHER
envs.py:2249
bool | None, None(no comment of its own)1: v1/attention/ops/dcp.py:1418

Multimodal and media (22)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_ASSETS_CACHE
envs.py:942
str, os.path.join(VLLM_CACHE_ROOT, "assets")Path to the cache for storing downloaded assets1: assets/base.py:15
VLLM_ASSETS_CACHE_MODEL_CLEAN
envs.py:950
bool, FalseIf the env var is set, we will clean model file in this path $VLLM_ASSETS_CACHE/model_streamer/$model_name1: transformers_utils/runai_utils.py:57
VLLM_IMAGE_FETCH_TIMEOUT
envs.py:955
int, 5Timeout for fetching images when serving multimodal models Default is 5 seconds3: assets/base.py:36, multimodal/media/connector.py:542, multimodal/media/connector.py:566
VLLM_VIDEO_FETCH_TIMEOUT
envs.py:958
int, 30Timeout for fetching videos when serving multimodal models Default is 30 seconds5: 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_AUDIO_FETCH_TIMEOUT
envs.py:963
int, 10Timeout for fetching audio when serving multimodal models Default is 10 seconds2: multimodal/media/connector.py:506, multimodal/media/connector.py:521
VLLM_MEDIA_CACHE
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_MEDIA_CACHE_MAX_SIZE_MB
envs.py:971
int, 5120Maximum 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_MEDIA_CACHE_TTL_HOURS
envs.py:976
float, 24Time-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_MEDIA_FETCH_MAX_RETRIES
envs.py:981
int, 3Maximum 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_MAX_MEDIA_DOWNLOAD_SIZE_MB
envs.py:987
int, 256Maximum 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_MEDIA_URL_ALLOW_REDIRECTS
envs.py:992
bool, TrueWhether to allow HTTP redirects when fetching from media URLs. Default to True3: entrypoints/launchers/run_batch.py:573, multimodal/media/connector.py:411, multimodal/media/connector.py:470
VLLM_MEDIA_LOADING_THREAD_COUNT
envs.py:998
int, 8Max number of workers for the thread pool handling media bytes loading. Set to 1 to disable parallel processing. Default is 81: multimodal/media/connector.py:47
VLLM_MAX_AUDIO_CLIP_FILESIZE_MB
envs.py:1005
int, 25Maximum 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_MAX_AUDIO_DECODE_DURATION_S
envs.py:1012
int, 600Maximum 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_MAX_AUDIO_DECODE_BYTES
envs.py:1020
int, 268_435_456Maximum 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_MAX_EMBED_DECODE_BYTES
envs.py:1030
int, 2_147_483_648Maximum 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_MAX_AUDIO_PREPROCESS_WORKERS
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-46627577811: entrypoints/speech_to_text/base/serving.py:147
VLLM_MAX_IMAGE_PIXELS
envs.py:1046
int, 178_956_970Maximum 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_MAX_MEDIA_REQUEST_DECODE_BYTES
envs.py:1052
int, 715_827_880Maximum 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_MAX_MEDIA_REQUEST_DOWNLOAD_SIZE_MB
envs.py:1055
int, 256(no comment of its own)1: connections.py:76
VLLM_VIDEO_LOADER_BACKEND
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_MEDIA_CONNECTOR
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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_LORA_RESOLVER_CACHE_DIR
envs.py:1171
str | None, Nonea 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_LORA_RESOLVER_HF_REPO_LIST
envs.py:1178
str | None, NoneA 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_ALLOW_RUNTIME_LORA_UPDATING
envs.py:1197
bool, FalseIf 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_LORA_DISABLE_PDL
envs.py:2185
bool, FalseDisable PDL for LoRA, as enabling PDL with LoRA on SM100 causes Triton compilation to fail.1: lora/ops/triton_ops/utils.py:323
VLLM_LORA_ENABLE_DUAL_STREAM
envs.py:2255
bool, FalseWhether 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_V1_USE_OUTLINES_CACHE
envs.py:1590
bool, FalseWhether 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_XGRAMMAR_CACHE_MB
envs.py:1689
int, 0
but 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_REGEX_COMPILATION_TIMEOUT_S
envs.py:1694
int, 5Maximum 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_TOOL_PARSE_REGEX_TIMEOUT_SECONDS
envs.py:1841
int, 1Regex 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_ENFORCE_STRICT_TOOL_CALLING
envs.py:1845
bool, TrueEnforce 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_BEAM_ALWAYS_CONSTRAIN_OUTPUT
envs.py:1850
bool, TrueConstrain every `beam` output to its response template's format, also without tool or structured output constraints.1: parser/beam.py:194
VLLM_USE_EXPERIMENTAL_PARSER_CONTEXT
envs.py:1969
bool, FalseExperimental: use this to enable MCP tool calling for non harmony models1: entrypoints/openai/responses/serving.py:472
VLLM_GPT_OSS_SYSTEM_TOOL_MCP_LABELS
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_TOOL_JSON_ERROR_AUTOMATIC_RETRY
envs.py:2009
bool, FalseEnable 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 request4: 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_CHAT_TEMPLATE_RENDER_TIMEOUT
envs.py:817
float, 30.0Maximum wall-clock seconds allowed for a single chat template render. Set to 0 to disable the timeout.1: renderers/hf.py:1044
VLLM_CHAT_TEMPLATE_FUEL
envs.py:824
int, 500000Maximum 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_API_KEY
envs.py:828
str | None, NoneAPI key for vLLM API server1: entrypoints/serve/middleware/register.py:33
VLLM_HTTP_TIMEOUT_KEEP_ALIVE
envs.py:1134
int, 5Timeout in seconds for keeping HTTP connections alive in API server3: entrypoints/launchers/api_server/entry.py:152, entrypoints/launchers/render/entry.py:53, v1/utils.py:363
VLLM_MAX_N_SEQUENCES
envs.py:1140
int, 16384Maximum 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_MAX_COMPLETION_PROMPTS
envs.py:1146
int, 1024Maximum 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_MAX_STOP_STRINGS
envs.py:1150
int, 4Maximum 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_MAX_NUM_BAD_WORDS
envs.py:1152
int, 128Maximum 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_MAX_BAD_WORDS_TOTAL_TOKENS
envs.py:1157
int, 1024Maximum 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_USE_RUST_FRONTEND
envs.py:1454
bool, FalseIf 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_USE_RUST_BENCH
envs.py:1458
bool, FalseIf set, use the packaged Rust client for `vllm bench serve`.1: entrypoints/cli/benchmark/main.py:24
VLLM_RUST_FRONTEND_PATH
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_SERVER_DEV_MODE
envs.py:1466
bool, FalseIf 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_MSGPACK_ZERO_COPY_THRESHOLD
envs.py:1704
int, 256Control 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_ALLOW_INSECURE_SERIALIZATION
envs.py:1710
bool, FalseIf 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_DISABLE_REQUEST_ID_RANDOMIZATION
envs.py:1715
bool, FalseTemporary: 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_PROCESS_NAME_PREFIX
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_ENABLE_RESPONSES_API_STORE
envs.py:1941
bool, FalseEnables 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_ENABLE_COHERE_API
envs.py:1947
bool, FalseIf 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 off2: entrypoints/cohere/api_router.py:296, entrypoints/generate/api_router.py:76
VLLM_GPT_OSS_HARMONY_SYSTEM_INSTRUCTIONS
envs.py:1997
bool, FalseAllows harmony instructions to be injected on system messages4: 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_SYSTEM_START_DATE
envs.py:2005
str | None, NonePin 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_SKIP_MODEL_NAME_VALIDATION
envs.py:2200
bool, FalseSkip 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_CACHE_ROOT
envs.py:713
str, os.path.expanduser("~/.cache/vllm")Root directory for vLLM cache files Defaults to `~/.cache/vllm` unless `XDG_CACHE_HOME` is set11: 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_USE_MODELSCOPE
envs.py:735
bool, FalseIf 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_USE_FASTOKENS
envs.py:743
bool, FalseIf 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_ACCESS_KEY_ID
envs.py:834
str | None, NoneS3 access information, used for tensorizer to load model from S31: model_executor/model_loader/tensorizer.py:351
S3_SECRET_ACCESS_KEY
envs.py:835
str | None, None(no comment of its own)1: model_executor/model_loader/tensorizer.py:354
S3_ENDPOINT_URL
envs.py:836
str | None, None(no comment of its own)1: model_executor/model_loader/tensorizer.py:356
VLLM_FASTSAFETENSORS_QUEUE_SIZE
envs.py:1130
int, 0Queue 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_PLUGINS
envs.py:1163
list[str] | None, Nonea 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 loaded3: plugins/__init__.py:40, plugins/__init__.py:122, plugins/lora_resolvers/hf_hub_resolver.py:133
VLLM_MODEL_REDIRECT_PATH
envs.py:1550
str | None, NoneUse 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-1B1: transformers_utils/utils.py:92
VLLM_TUNED_CONFIG_FOLDER
envs.py:1976
str | None, NoneUser 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_WEIGHT_OFFLOADING_DISABLE_PIN_MEMORY
envs.py:2161
bool, FalseDisable using pytorch's pin memory for CPU offloading.2: model_executor/model_loader/utils.py:243, model_executor/offloader/base.py:31
VLLM_WEIGHT_OFFLOADING_DISABLE_UVA
envs.py:2165
bool, FalseDisable using UVA (Unified Virtual Addressing) for CPU offloading.2: model_executor/offloader/uva.py:53, platforms/xpu.py:435
VLLM_WSL2_ENABLE_PIN_MEMORY
envs.py:2178
bool, FalseOn 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_USE_FLASHINFER_SAMPLER
envs.py:886
bool, TrueWhether 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_SPARSE_INDEXER_MAX_LOGITS_MB
envs.py:1094
int, 512Maximum 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 MB9: 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_ADAPTIVE_VERIFICATION_PROFILE_CONTEXT_LEN
envs.py:1102
int, 8192KV 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 tokens1: v1/worker/gpu/spec_decode/adaptive_verification.py:209
VLLM_USE_TRITON_AWQ
envs.py:1182
bool, FalseIf set, vLLM will use Triton implementations of AWQ.3: _custom_ops.py:574, _custom_ops.py:607, platforms/rocm.py:1180
VLLM_TRITON_FORCE_FIRST_CONFIG
envs.py:1187
bool, FalseIf 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_TRITON_JIT_WARMUP_NUM_THREADS
envs.py:1193
int, 4Maximum 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_DISABLED_KERNELS
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_USE_HW_AGNOSTIC
envs.py:1218
bool, FalseSelects hw-agnostic layers for HF transformer backend2: model_executor/models/transformers/layers.py:26, model_executor/models/transformers/layers.py:48
VLLM_ENABLE_FLA_PACKED_RECURRENT_DECODE
envs.py:1221
bool, True(no comment of its own)1: model_executor/layers/mamba/gdn/qwen_gdn_linear_attn.py:687
VLLM_GDN_DECODE_KERNEL
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_USE_OINK_OPS
envs.py:1239
bool, FalseOptional: enable external Oink custom ops (e.g., Blackwell RMSNorm). Disabled by default.1: platforms/cuda.py:726
VLLM_MXFP4_EMULATION_DEQUANT_AT_LOAD
envs.py:1247
bool, FalseDisable 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_MXFP8_EMULATION_DEQUANT_AT_LOAD
envs.py:1256
bool, TrueOn 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_USE_LAYERNAME
envs.py:1451
bool, TrueIf 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_MLA_DISABLE
envs.py:1478
bool, FalseIf set, vLLM will disable the MLA attention optimizations.2: config/model.py:2069, transformers_utils/model_arch_config_convertor.py:97
VLLM_MARLIN_USE_ATOMIC_ADD
envs.py:1554
bool, FalseWhether 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_MARLIN_INPUT_DTYPE
envs.py:1558
Literal["int8", "fp8"] | None, None
choices: int8, fp8
The activation dtype for marlin kernel3: 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_HUMMING_ONLINE_QUANT_CONFIG
envs.py:1562
dict[str, Any] | None, NoneThe online quantization dtype for humming kernel1: model_executor/layers/quantization/humming.py:268
VLLM_HUMMING_INPUT_QUANT_CONFIG
envs.py:1567
dict[str, Any] | None, NoneThe 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_HUMMING_USE_F16_ACCUM
envs.py:1571
bool, FalseWhether to use fp16 accumulator mma4: 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_KIMI_K3_AUX_ATTN_RES_STREAM
envs.py:1662
bool, FalseKimi 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_KIMI_K3_GEMM_AR
envs.py:1667
bool, TrueUse 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_ENABLE_GEMM_RS
envs.py:1672
bool, FalseFuse 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_BLOCKSCALE_FP8_GEMM_FLASHINFER
envs.py:1675
bool, TrueAllow 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_FLASHINFER_AUTOTUNE_CACHE_DIR
envs.py:1793
str | None, NoneOverride 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_FLASHINFER_AUTOTUNE_SKIP_OPS
envs.py:1799
list[str] | None, NoneComma-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_FLASHINFER_WORKSPACE_BUFFER_SIZE
envs.py:1815
int, 394 * 1024 * 1024Control 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_KV_CACHE_LAYOUT
envs.py:1877
Literal["LBNHC", "LBHNC", "LHBNC", "NHD", "HND", "BLHNC", "BLNHC", "BHLNC"] | None, None
choices: 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_SSM_CONV_STATE_LAYOUT
envs.py:1886
Literal["SD", "DS"] | None, None
choices: 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_ALLOW_CHUNKED_LOCAL_ATTN_WITH_HYBRID_KV_CACHE
envs.py:1929
bool, TrueAllow 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_MULTI_STREAM_GEMM_TOKEN_THRESHOLD
envs.py:2127
int, 1024Token-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_ENABLE_HPC_OPS
envs.py:2276
bool, FalseIf 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)#

VariableType and defaultDescription (code comment)Used in vllm/
VLLM_SKIP_VERSION_SUFFIX
envs.py:2278
not in TYPE_CHECKING; parse default "0"Whether to skip version suffix when building packageno envs.* use; named in setup.py

Check yourself#

  1. 1
    You start vllm serve with VLLM_DEBUG_LOG_API_SERVER_RESPONSE=1. Does the API server log its responses?
    easy
    Show answer

    No. The lambda compares the lower-case text with "true", so "1" gives False (vllm/envs.py:830-832). Use true for this variable. Other booleans need 1, so check the lambda of each variable.

  2. 2
    A test changes os.environ["VLLM_LOG_STATS_INTERVAL"] while the server runs. Which processes see the new value?
    medium
    Show answer

    Only the front-end process, and only at the next read. The front end never calls enable_envs_cache(), so each envs.X read 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).

  3. 3
    You set VLLM_ENABLE_V1_MULTIPROCESSING=0 to run the engine core inside the API server process of vllm serve. Does it work? And what does VLLM_ENABLE_V1_MULTIPROCESSING=true do?
    hard
    Show answer

    It does not work. Only LLMEngine reads the variable (vllm/v1/engine/llm_engine.py:170, vllm/v1/engine/llm_engine.py:186). AsyncLLM always calls EngineCoreClient.make_async_mp_client, which starts the engine core in a background process (vllm/v1/engine/async_llm.py:188-193). The text true raises ValueError at the first read, because the lambda calls int() on it (vllm/envs.py:1442-1444).