Skip to content

Commit 4dc64b5

Browse files
committed
[V1][Metrics] Fix docs build
``` docs/source/serving/engine_args.md:14: ERROR: Failed to import "_engine_args_parser" from "vllm.engine.arg_utils". No module named 'prometheus_client' ``` Signed-off-by: Mark McLoughlin <[email protected]>
1 parent c3ab98b commit 4dc64b5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

vllm/entrypoints/llm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import warnings
55
from collections.abc import Sequence
66
from contextlib import contextmanager
7-
from typing import Any, Callable, ClassVar, Optional, Union, cast, overload
7+
from typing import (TYPE_CHECKING, Any, Callable, ClassVar, Optional, Union,
8+
cast, overload)
89

910
import cloudpickle
1011
import torch.nn as nn
@@ -46,7 +47,9 @@
4647
from vllm.usage.usage_lib import UsageContext
4748
from vllm.utils import (Counter, Device, deprecate_args, deprecate_kwargs,
4849
is_list_of)
49-
from vllm.v1.metrics.reader import Metric
50+
51+
if TYPE_CHECKING:
52+
from vllm.v1.metrics.reader import Metric
5053

5154
logger = init_logger(__name__)
5255

@@ -1296,7 +1299,7 @@ def wake_up(self, tags: Optional[list[str]] = None):
12961299
"""
12971300
self.llm_engine.wake_up(tags)
12981301

1299-
def get_metrics(self) -> list[Metric]:
1302+
def get_metrics(self) -> list["Metric"]:
13001303
"""Return a snapshot of aggregated metrics from Prometheus.
13011304
13021305
Returns:

0 commit comments

Comments
 (0)