fix(security): bound completion prompt list to prevent unbounded engine fan-out (#47845)

Signed-off-by: jperezde <jperezde@redhat.com>
This commit is contained in:
Juan Pérez de Algaba
2026-07-07 22:48:20 +00:00
committed by GitHub
parent d99adcebdc
commit 675f4295cd
3 changed files with 177 additions and 0 deletions
+7
View File
@@ -101,6 +101,7 @@ if TYPE_CHECKING:
VLLM_ALLOW_LONG_MAX_MODEL_LEN: bool = False
VLLM_HTTP_TIMEOUT_KEEP_ALIVE: int = 5 # seconds
VLLM_MAX_N_SEQUENCES: int = 16384
VLLM_MAX_COMPLETION_PROMPTS: 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
@@ -1058,6 +1059,12 @@ environment_variables: dict[str, Callable[[], Any]] = {
"VLLM_MAX_N_SEQUENCES": lambda: int(
os.environ.get("VLLM_MAX_N_SEQUENCES", "16384")
),
# Maximum number of prompts allowed in a single /v1/completions request
# when the prompt field is a list. Prevents unbounded fan-out of engine
# requests from a single API call. Default: 1024.
"VLLM_MAX_COMPLETION_PROMPTS": lambda: int(
os.environ.get("VLLM_MAX_COMPLETION_PROMPTS", "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