From e8162412d154eee172ca613bb0cacee3cbfc2141 Mon Sep 17 00:00:00 2001 From: linhongyu510 Date: Mon, 5 Oct 2026 14:39:47 +0800 Subject: [PATCH] fix(proxy): restore click decorator chain on run_server The _value_type_name helper was inserted between the last @click.option decorator and def run_server, which hijacked the entire click decorator stack onto the helper and left run_server as a bare 51-arg function. That broke: - the litellm console entry point (TypeError: run_server() missing 51 args) - python-310-import-smoke, Core checks on all Pythons - proxy-infra-root / All Other Providers tests that access run_server.main/.name - the basedpyright type-check budget (3 extra reportCallIssue) Move the helper above @click.command() so the decorators re-attach to run_server as on main. --- litellm/proxy/proxy_cli.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py index 5e8d37cd7b3..9652ff0f925 100644 --- a/litellm/proxy/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -702,6 +702,16 @@ class ProxyInitializationHelpers: return multiproc_dir +def _value_type_name(value: object) -> str: + """Return the runtime class name of an arbitrary config value. + + The value read from YAML is untyped; annotate the parameter as ``object`` + so ``type()`` receives a known-typed argument and the strict type gate does + not count a ``reportUnknownArgumentType`` error on the error path. + """ + return type(value).__name__ + + @click.command() @click.argument("cli_args", nargs=-1) @click.option("--host", default="0.0.0.0", help="Host for the server to listen on.", envvar="HOST") @@ -1014,16 +1024,6 @@ class ProxyInitializationHelpers: ), envvar="PROMETHEUS_METRICS_PORT", ) -def _value_type_name(value: object) -> str: - """Return the runtime class name of an arbitrary config value. - - The value read from YAML is untyped; annotate the parameter as ``object`` - so ``type()`` receives a known-typed argument and the strict type gate does - not count a ``reportUnknownArgumentType`` error on the error path. - """ - return type(value).__name__ - - def run_server( cli_args, host,