main
py 21 lines 790 Bytes
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 from vllm.exceptions import VLLMServerError
4
5
6 class EngineGenerateError(VLLMServerError):
7 """Raised when a AsyncLLM.generate() fails. Recoverable."""
8
9 pass
10
11
12 class EngineDeadError(VLLMServerError):
13 """Raised when the EngineCore dies. Unrecoverable."""
14
15 def __init__(self, *args, suppress_context: bool = False, **kwargs):
16 ENGINE_DEAD_MESSAGE = "EngineCore encountered an issue. See stack trace (above) for the root cause." # noqa: E501
17
18 super().__init__(ENGINE_DEAD_MESSAGE, *args, **kwargs)
19 # Make stack trace clearer when using with LLMEngine by
20 # silencing irrelevant ZMQError.
21 self.__suppress_context__ = suppress_context