Initialize high-performance ZMQ connections
(self)
| 308 | main_process_metrics.set_cache_config_info(obj=self.cfg.cache_config) |
| 309 | |
| 310 | async def init_connections(self): |
| 311 | """Initialize high-performance ZMQ connections""" |
| 312 | try: |
| 313 | # Create ZMQ client for sending requests |
| 314 | self.request_client = ZmqIpcClient(name=self.engine_pid, mode=zmq.PUSH) |
| 315 | self.request_client.connect() |
| 316 | |
| 317 | # Create high-performance async connection manager for receiving responses |
| 318 | self.connection_manager = DealerConnectionManager( |
| 319 | pid=self.engine_pid, max_connections=int(os.getenv("FD_DEALER_CONNECTIONS", 50)) |
| 320 | ) |
| 321 | |
| 322 | if not self.connection_manager.running: |
| 323 | await self.connection_manager.initialize() |
| 324 | |
| 325 | llm_logger.info("High-performance ZMQ connections initialized successfully") |
| 326 | except Exception as e: |
| 327 | llm_logger.error(f"Failed to initialize ZMQ connections: {e}") |
| 328 | raise |
| 329 | |
| 330 | async def get_model_config(self): |
| 331 | """Get model configuration""" |