__init__.py 1.79 KB
Newer Older
1
2
"""vLLM: a high-throughput and memory-efficient inference engine for LLMs"""

3
4
5
6
from vllm.engine.arg_utils import AsyncEngineArgs, EngineArgs
from vllm.engine.async_llm_engine import AsyncLLMEngine
from vllm.engine.llm_engine import LLMEngine
from vllm.entrypoints.llm import LLM
7
from vllm.executor.ray_utils import initialize_ray_cluster
8
from vllm.inputs import PromptType, TextPrompt, TokensPrompt
9
from vllm.model_executor.models import ModelRegistry
10
11
from vllm.outputs import (CompletionOutput, PoolingOutput,
                          PoolingRequestOutput, RequestOutput)
12
from vllm.pooling_params import PoolingParams
13
from vllm.sampling_params import SamplingParams
Woosuk Kwon's avatar
Woosuk Kwon committed
14

15
from .version import __version__, __version_tuple__
Woosuk Kwon's avatar
Woosuk Kwon committed
16
17

__all__ = [
18
    "__version__",
19
    "__version_tuple__",
Woosuk Kwon's avatar
Woosuk Kwon committed
20
    "LLM",
21
    "ModelRegistry",
22
    "PromptType",
23
24
    "TextPrompt",
    "TokensPrompt",
Woosuk Kwon's avatar
Woosuk Kwon committed
25
26
27
    "SamplingParams",
    "RequestOutput",
    "CompletionOutput",
28
29
    "PoolingOutput",
    "PoolingRequestOutput",
Woosuk Kwon's avatar
Woosuk Kwon committed
30
31
32
33
    "LLMEngine",
    "EngineArgs",
    "AsyncLLMEngine",
    "AsyncEngineArgs",
34
    "initialize_ray_cluster",
35
    "PoolingParams",
Woosuk Kwon's avatar
Woosuk Kwon committed
36
]
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59


def __getattr__(name: str):
    import warnings

    if name == "EmbeddingOutput":
        msg = ("EmbeddingOutput has been renamed to PoolingOutput. "
               "The original name will be removed in an upcoming version.")

        warnings.warn(DeprecationWarning(msg), stacklevel=2)

        return PoolingOutput

    if name == "EmbeddingRequestOutput":
        msg = ("EmbeddingRequestOutput has been renamed to "
               "PoolingRequestOutput. "
               "The original name will be removed in an upcoming version.")

        warnings.warn(DeprecationWarning(msg), stacklevel=2)

        return PoolingRequestOutput

    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")