A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Feature] publisher default set zmq in kv_event config (#26915)
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
rongfu.leng committed
Oct 23, 2025 at 03:19 UTC
8669c69afa948b12bd466d770c30d8e0334d73c9
2 files changed
+10
-3
vllm/config/kv_events.py
+8
-1
@@ -2,6 +2,9 @@
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
5
+from typing import Literal
6
+
7
+from pydantic import Field
8
from pydantic.dataclasses import dataclass
9
10
from vllm.config.utils import config
@@ -17,7 +20,7 @@ class KVEventsConfig:
20
Events can be published externally by zmq using the event publisher config.
21
"""
22
20
- publisher: str = "null"
23
+ publisher: Literal["null", "zmq"] = Field(default=None)
24
"""The publisher to use for publishing kv events. Can be "null", "zmq".
25
"""
26
@@ -47,3 +50,7 @@ class KVEventsConfig:
50
"""The topic to use for the event publisher. Consumers can subscribe to
51
this topic to receive events.
52
"""
53
+
54
+ def __post_init__(self):
55
+ if self.publisher is None:
56
+ self.publisher = "zmq" if self.enable_kv_cache_events else "null"
vllm/distributed/kv_events.py
+2
-2
@@ -353,12 +353,12 @@ class EventPublisherFactory:
353
cls, config: KVEventsConfig | None, data_parallel_rank: int = 0
354
) -> EventPublisher:
355
"""Create publisher from a config mapping."""
356
- if not config:
356
+ if config is None or config.publisher == "null":
357
return NullEventPublisher()
358
359
config_dict = asdict(config)
360
361
- kind = config_dict.pop("publisher", "null")
361
+ kind = config_dict.pop("publisher")
362
config_dict.pop("enable_kv_cache_events")
363
try:
364
constructor = cls._registry[kind]