Bound generation inputs before expensive work (#51447)

Signed-off-by: Clinton Thomas <1033162+KernelClint@users.noreply.github.com>
Co-authored-by: Lucas Bourtoule <35483370+dhalf@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Clinton Thomas
2026-08-11 22:03:50 +08:00
committed by GitHub
co-authored by Lucas Bourtoule mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 5b184f775a
commit b64a2708b0
11 changed files with 421 additions and 37 deletions
+14
View File
@@ -108,6 +108,9 @@ if TYPE_CHECKING:
VLLM_HTTP_TIMEOUT_KEEP_ALIVE: int = 5 # seconds
VLLM_MAX_N_SEQUENCES: int = 16384
VLLM_MAX_COMPLETION_PROMPTS: int = 1024
VLLM_MAX_STOP_STRINGS: int = 4
VLLM_MAX_NUM_BAD_WORDS: int = 128
VLLM_MAX_BAD_WORDS_TOTAL_TOKENS: int = 1024
VLLM_PLUGINS: list[str] | None = None
VLLM_LORA_RESOLVER_CACHE_DIR: str | None = None
VLLM_LORA_RESOLVER_HF_REPO_LIST: str | None = None
@@ -1114,6 +1117,17 @@ environment_variables: dict[str, Callable[[], Any]] = {
"VLLM_MAX_COMPLETION_PROMPTS": lambda: int(
os.environ.get("VLLM_MAX_COMPLETION_PROMPTS", "1024")
),
# Maximum number of stop strings allowed in a single request.
"VLLM_MAX_STOP_STRINGS": lambda: int(os.environ.get("VLLM_MAX_STOP_STRINGS", "4")),
# Maximum number of bad-word token sequences generated per request.
"VLLM_MAX_NUM_BAD_WORDS": lambda: int(
os.environ.get("VLLM_MAX_NUM_BAD_WORDS", "128")
),
# Maximum total number of bad-word tokens (summed across all bad words)
# allowed per request. Bounds the per-request GPU buffer width.
"VLLM_MAX_BAD_WORDS_TOTAL_TOKENS": lambda: int(
os.environ.get("VLLM_MAX_BAD_WORDS_TOTAL_TOKENS", "1024")
),
# a list of plugin names to load, separated by commas.
# if this is not set, it means all plugins will be loaded
# if this is set to an empty string, no plugins will be loaded