[Feature] Add first-class KV hints request envelope for programmatic KV management (#53423)

Signed-off-by: Karen Chung <karenc@nvidia.com>
This commit is contained in:
Karen Chung
2026-09-21 09:56:11 -07:00
committed by GitHub
parent 4f14516790
commit 986e217158
30 changed files with 340 additions and 18 deletions
+3
View File
@@ -34,6 +34,7 @@ from vllm.v1.engine.input_processor import InputProcessor
from vllm.v1.engine.output_processor import OutputProcessor
from vllm.v1.engine.parallel_sampling import ParentRequest
from vllm.v1.executor import Executor
from vllm.v1.kv_hints import KvHintsEnvelope
from vllm.v1.metrics.loggers import StatLoggerFactory, StatLoggerManager
from vllm.v1.metrics.reader import Metric, get_metrics_snapshot
from vllm.v1.metrics.stats import IterationStats
@@ -230,6 +231,7 @@ class LLMEngine:
priority: int = 0,
session_id: str | None = None,
prompt_text: str | None = None,
kv_hints: KvHintsEnvelope | None = None,
) -> str:
# Validate the request_id type.
if not isinstance(request_id, str):
@@ -263,6 +265,7 @@ class LLMEngine:
trace_headers=trace_headers,
priority=priority,
session_id=session_id,
kv_hints=kv_hints,
)
prompt_text, _, _ = extract_prompt_components(self.model_config, prompt)