__init__.py 2.17 KB
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
"""vLLM: a high-throughput and memory-efficient inference engine for LLMs"""
3
4
5
6
# The version.py should be independent library, and we always import the
# version library first.  Such assumption is critical for some customization.
from .version import __version__, __version_tuple__  # isort:skip

7
8
9
import os

import torch
10

11
12
13
14
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
15
from vllm.executor.ray_utils import initialize_ray_cluster
16
from vllm.inputs import PromptType, TextPrompt, TokensPrompt
17
from vllm.model_executor.models import ModelRegistry
18
19
20
21
22
from vllm.outputs import (ClassificationOutput, ClassificationRequestOutput,
                          CompletionOutput, EmbeddingOutput,
                          EmbeddingRequestOutput, PoolingOutput,
                          PoolingRequestOutput, RequestOutput, ScoringOutput,
                          ScoringRequestOutput)
23
from vllm.pooling_params import PoolingParams
24
from vllm.sampling_params import SamplingParams
Woosuk Kwon's avatar
Woosuk Kwon committed
25

26
27
28
29
# set some common config/environment variables that should be set
# for all processes created by vllm and all processes
# that interact with vllm workers.
# they are executed whenever `import vllm` is called.
30

31
32
# see https://github.com/NVIDIA/nccl/issues/1234
os.environ['NCCL_CUMEM_ENABLE'] = '0'
33

34
35
36
37
# see https://github.com/vllm-project/vllm/issues/10480
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1'
# see https://github.com/vllm-project/vllm/issues/10619
torch._inductor.config.compile_threads = 1
38

Woosuk Kwon's avatar
Woosuk Kwon committed
39
__all__ = [
40
    "__version__",
41
    "__version_tuple__",
Woosuk Kwon's avatar
Woosuk Kwon committed
42
    "LLM",
43
    "ModelRegistry",
44
    "PromptType",
45
46
    "TextPrompt",
    "TokensPrompt",
Woosuk Kwon's avatar
Woosuk Kwon committed
47
48
49
    "SamplingParams",
    "RequestOutput",
    "CompletionOutput",
50
51
    "PoolingOutput",
    "PoolingRequestOutput",
52
53
54
55
56
57
    "EmbeddingOutput",
    "EmbeddingRequestOutput",
    "ClassificationOutput",
    "ClassificationRequestOutput",
    "ScoringOutput",
    "ScoringRequestOutput",
Woosuk Kwon's avatar
Woosuk Kwon committed
58
59
60
61
    "LLMEngine",
    "EngineArgs",
    "AsyncLLMEngine",
    "AsyncEngineArgs",
62
    "initialize_ray_cluster",
63
    "PoolingParams",
Woosuk Kwon's avatar
Woosuk Kwon committed
64
]