vllm.distributed.kv_transfer.kv_connector.v1.nixl.metadata ¶
Metadata dataclasses and helpers for the NIXL connector.
NixlHandshakePayload dataclass ¶
Bases: KVConnectorHandshakeMetadata
Wrapper for NIXL handshake sent over the wire.
Enables two-phase decoding for graceful compatibility checking: 1. Decode NixlHandshakePayload to get compatibility_hash 2. Compute local hash and compare 3. Only if hashes match, decode agent_metadata_bytes
This prevents decoder errors when NixlAgentMetadata schema is incompatible, allowing graceful failure with clear error message.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/nixl/metadata.py
compute_nixl_compatibility_hash ¶
compute_nixl_compatibility_hash(
vllm_config: VllmConfig,
attn_backend_name: str,
cross_layers_blocks: bool,
) -> str
Compute compatibility hash for NIXL KV transfer.
Hash only the factors that affect whether two NIXL instances can successfully transfer KV cache data.
Factors included: - vLLM version and NIXL connector version - Model architecture (name, dtype, KV heads, layers) - KV cache format (dtype, sliding window) - Attention backend
Note: Factors like tensor_parallel_size, block_size, and kv_cache_layout are validated at runtime in _validate_remote_agent_handshake and are not included in this hash to support heterogeneous deployments.
Note - the set of factors are likely to evolve significantly over time to be more or less permissive.
Returns:
| Type | Description |
|---|---|
str | SHA-256 hex digest |