Skip to content

Commit 1db19aa

Browse files
committed
only start the ZMQ task if the routing logic is RoutingLogic.DISAGGREGATED_PREFILL
Signed-off-by: Kobe Chen <[email protected]>
1 parent b92826e commit 1db19aa

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/vllm_router/app.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from vllm_router.routers.routing_logic import (
3636
get_routing_logic,
3737
initialize_routing_logic,
38+
DisaggregatedPrefillRouter,
3839
)
3940
from vllm_router.service_discovery import (
4041
ServiceDiscoveryType,
@@ -97,13 +98,16 @@ async def lifespan(app: FastAPI):
9798

9899
app.state.event_loop = asyncio.get_event_loop()
99100

100-
# Start the ZMQ task
101-
await start_zmq_task()
101+
# only start the ZMQ task if the routing logic is RoutingLogic.DISAGGREGATED_PREFILL
102+
if isinstance(app.state.router, DisaggregatedPrefillRouter):
103+
logger.info("Starting ZMQ task because the routing logic is RoutingLogic.DISAGGREGATED_PREFILL")
104+
# Start the ZMQ task
105+
await start_zmq_task()
102106

103-
yield
107+
yield
104108

105-
# Stop the ZMQ task
106-
await stop_zmq_task()
109+
# Stop the ZMQ task
110+
await stop_zmq_task()
107111

108112
await app.state.aiohttp_client_wrapper.stop()
109113

0 commit comments

Comments
 (0)