A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 6, 12:00 UTC
Add API docs link if the CLI arg is a config class (#37432)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Harry Mellor committed
Mar 18, 2026 at 17:19 UTC
39bfb57b7c89c2ae64d7d9b895e94c05ea9e965c
1 file changed
+10
vllm/engine/arg_utils.py
+10
@@ -108,6 +108,7 @@ from vllm.utils.network_utils import get_ip
108
from vllm.utils.torch_utils import resolve_kv_cache_dtype_string
109
from vllm.v1.attention.backends.registry import AttentionBackendEnum
110
from vllm.v1.sample.logits_processor import LogitsProcessor
111
+from vllm.version import __version__ as VLLM_VERSION
112
113
if TYPE_CHECKING:
114
from vllm.model_executor.layers.quantization import QuantizationMethods
@@ -243,6 +244,14 @@ NEEDS_HELP = (
244
)
245
246
247
+def _maybe_add_docs_url(cls: Any) -> str:
248
+ """Generate API docs URL for a vllm config class."""
249
+ if not cls.__module__.startswith("vllm.config"):
250
+ return ""
251
+ version = f"v{VLLM_VERSION}" if "dev" not in VLLM_VERSION else "latest"
252
+ return f"\n\nAPI docs: https://docs.vllm.ai/en/{version}/api/vllm/config/#vllm.config.{cls.__name__}"
253
+
254
+
255
@functools.lru_cache(maxsize=30)
256
def _compute_kwargs(cls: ConfigType) -> dict[str, dict[str, Any]]:
257
# Save time only getting attr docs if we're generating help text
@@ -293,6 +302,7 @@ def _compute_kwargs(cls: ConfigType) -> dict[str, dict[str, Any]]:
302
raise argparse.ArgumentTypeError(repr(e)) from e
303
304
kwargs[name]["type"] = parse_dataclass
305
+ kwargs[name]["help"] += _maybe_add_docs_url(dataclass_cls)
306
kwargs[name]["help"] += f"\n\n{json_tip}"
307
elif contains_type(type_hints, bool):
308
# Creates --no-<name> and --<name> flags