[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:
@@ -0,0 +1,26 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from typing import Any
|
||||
|
||||
import msgspec
|
||||
|
||||
|
||||
class KvHintAction(msgspec.Struct, frozen=True): # type: ignore[call-arg]
|
||||
"""A versioned orchestrator-provided KV hint action."""
|
||||
|
||||
action_id: str
|
||||
action_type: str
|
||||
action_version: str
|
||||
# `payload` must contain JSON-compatible values. Action-specific schemas are
|
||||
# validated by the component implementing the action.
|
||||
payload: dict[str, Any]
|
||||
|
||||
|
||||
class KvHintsEnvelope(msgspec.Struct, frozen=True): # type: ignore[call-arg]
|
||||
"""Orchestrator-provided KV hints optionally attached to one inference request.
|
||||
A KV hint envelope is a collection of KV hint action(s)."""
|
||||
|
||||
protocol_version: str
|
||||
message_id: str
|
||||
actions: list[KvHintAction]
|
||||
Reference in New Issue
Block a user