__init__.py 2.33 KB
Newer Older
1
2
3
4
5
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

from fastapi import FastAPI

6
7
8
9
10
import vllm.envs as envs
from vllm.logger import init_logger

logger = init_logger(__name__)

11
12

def register_vllm_serve_api_routers(app: FastAPI):
13
14
15
16
17
18
    if envs.VLLM_SERVER_DEV_MODE:
        logger.warning(
            "SECURITY WARNING: Development endpoints are enabled! "
            "This should NOT be used in production!"
        )

19
20
21
22
23
    from vllm.entrypoints.serve.lora.api_router import (
        attach_router as attach_lora_router,
    )

    attach_lora_router(app)
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    from vllm.entrypoints.serve.elastic_ep.api_router import (
        attach_router as attach_elastic_ep_router,
    )

    attach_elastic_ep_router(app)

    from vllm.entrypoints.serve.profile.api_router import (
        attach_router as attach_profile_router,
    )

    attach_profile_router(app)

    from vllm.entrypoints.serve.sleep.api_router import (
        attach_router as attach_sleep_router,
    )

    attach_sleep_router(app)

43
44
45
46
47
48
49
50
51
52
53
54
    from vllm.entrypoints.serve.rpc.api_router import (
        attach_router as attach_rpc_router,
    )

    attach_rpc_router(app)

    from vllm.entrypoints.serve.cache.api_router import (
        attach_router as attach_cache_router,
    )

    attach_cache_router(app)

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    from vllm.entrypoints.serve.tokenize.api_router import (
        attach_router as attach_tokenize_router,
    )

    attach_tokenize_router(app)

    from vllm.entrypoints.serve.disagg.api_router import (
        attach_router as attach_disagg_router,
    )

    attach_disagg_router(app)

    from vllm.entrypoints.serve.rlhf.api_router import (
        attach_router as attach_rlhf_router,
    )

    attach_rlhf_router(app)

    from vllm.entrypoints.serve.instrumentator.metrics import (
        attach_router as attach_metrics_router,
    )

    attach_metrics_router(app)

    from vllm.entrypoints.serve.instrumentator.health import (
        attach_router as attach_health_router,
    )

    attach_health_router(app)
84

85
86
87
88
89
    from vllm.entrypoints.serve.instrumentator.offline_docs import (
        attach_router as attach_offline_docs_router,
    )

    attach_offline_docs_router(app)
90
91
92
93
94
    from vllm.entrypoints.serve.instrumentator.server_info import (
        attach_router as attach_server_info_router,
    )

    attach_server_info_router(app)