Skip to content

Commit ccc8c62

Browse files
authored
feat: Support python -m dynamo.frontend --version (#2449)
1 parent 24a935e commit ccc8c62

File tree

21 files changed

+173
-69
lines changed

21 files changed

+173
-69
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,15 @@ __pycache__/
7979
*.so
8080
*.egg-info
8181

82+
# Hatch build artifact
83+
components/**/_version.py
84+
8285
### Helm ###
8386
*.tgz
8487
Chart.lock
8588
generated-values.yaml
8689

90+
# Local build artifacts for devcontainer
8791
.build/
8892
**/.devcontainer/.env
8993
TensorRT-LLM
90-
91-
# Local build artifacts for devcontainer
92-
.build/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
try:
5+
from ._version import __version__
6+
except Exception:
7+
try:
8+
from importlib.metadata import version as _pkg_version
9+
10+
__version__ = _pkg_version("ai-dynamo")
11+
except Exception:
12+
__version__ = "0.0.0+unknown"

components/backends/llama_cpp/src/dynamo/llama_cpp/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from dynamo.runtime import DistributedRuntime, dynamo_worker
1616
from dynamo.runtime.logging import configure_dynamo_logging
1717

18+
from . import __version__
19+
1820
DEFAULT_ENDPOINT = "dyn://dynamo.backend.generate"
1921

2022
configure_dynamo_logging()
@@ -83,6 +85,9 @@ def cmd_line_args():
8385
parser = argparse.ArgumentParser(
8486
description="llama.cpp server integrated with Dynamo LLM."
8587
)
88+
parser.add_argument(
89+
"--version", action="version", version=f"Dynamo Backend llama.cpp {__version__}"
90+
)
8691
parser.add_argument(
8792
"--model-path",
8893
type=str,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
try:
5+
from ._version import __version__
6+
except Exception:
7+
try:
8+
from importlib.metadata import version as _pkg_version
9+
10+
__version__ = _pkg_version("ai-dynamo")
11+
except Exception:
12+
__version__ = "0.0.0+unknown"

components/backends/mocker/src/dynamo/mocker/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from dynamo.runtime import DistributedRuntime, dynamo_worker
1313
from dynamo.runtime.logging import configure_dynamo_logging
1414

15+
from . import __version__
16+
1517
DEFAULT_ENDPOINT = "dyn://dynamo.backend.generate"
1618

1719
configure_dynamo_logging()
@@ -41,6 +43,9 @@ def cmd_line_args():
4143
description="Mocker engine for testing Dynamo LLM infrastructure.",
4244
formatter_class=argparse.RawDescriptionHelpFormatter,
4345
)
46+
parser.add_argument(
47+
"--version", action="version", version=f"Dynamo Mocker {__version__}"
48+
)
4449
parser.add_argument(
4550
"--model-path",
4651
type=str,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
try:
5+
from ._version import __version__
6+
except Exception:
7+
try:
8+
from importlib.metadata import version as _pkg_version
9+
10+
__version__ = _pkg_version("ai-dynamo")
11+
except Exception:
12+
__version__ = "0.0.0+unknown"
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2-
# SPDX-License-Identifier: Apache-2.0
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
try:
5+
from ._version import __version__
6+
except Exception:
7+
try:
8+
from importlib.metadata import version as _pkg_version
9+
10+
__version__ = _pkg_version("ai-dynamo")
11+
except Exception:
12+
__version__ = "0.0.0+unknown"

components/backends/trtllm/src/dynamo/trtllm/utils/trtllm_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from tensorrt_llm.llmapi import BuildConfig
88

9+
from dynamo.trtllm import __version__
910
from dynamo.trtllm.request_handlers.handler_base import (
1011
DisaggregationMode,
1112
DisaggregationStrategy,
@@ -109,6 +110,9 @@ def cmd_line_args():
109110
parser = argparse.ArgumentParser(
110111
description="TensorRT-LLM server integrated with Dynamo LLM."
111112
)
113+
parser.add_argument(
114+
"--version", action="version", version=f"Dynamo Backend TRTLLM {__version__}"
115+
)
112116
parser.add_argument(
113117
"--endpoint",
114118
type=str,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
try:
5+
from ._version import __version__
6+
except Exception:
7+
try:
8+
from importlib.metadata import version as _pkg_version
9+
10+
__version__ = _pkg_version("ai-dynamo")
11+
except Exception:
12+
__version__ = "0.0.0+unknown"

components/backends/vllm/src/dynamo/vllm/args.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from vllm.engine.arg_utils import AsyncEngineArgs
1313
from vllm.utils import FlexibleArgumentParser
1414

15+
from . import __version__
1516
from .ports import (
1617
DEFAULT_DYNAMO_PORT_MAX,
1718
DEFAULT_DYNAMO_PORT_MIN,
@@ -58,6 +59,9 @@ def parse_args() -> Config:
5859
parser = FlexibleArgumentParser(
5960
description="vLLM server integrated with Dynamo LLM."
6061
)
62+
parser.add_argument(
63+
"--version", action="version", version=f"Dynamo Backend VLLM {__version__}"
64+
)
6165
parser.add_argument(
6266
"--endpoint",
6367
type=str,

0 commit comments

Comments
 (0)