Skip to content

fix(vllm): accept --disable-log-requests as no-op for vLLM 0.17+ compat#783

Open
lilyz-ai wants to merge 1 commit intomainfrom
lilyzhu/vllm-disable-log-requests-compat
Open

fix(vllm): accept --disable-log-requests as no-op for vLLM 0.17+ compat#783
lilyz-ai wants to merge 1 commit intomainfrom
lilyzhu/vllm-disable-log-requests-compat

Conversation

@lilyz-ai
Copy link
Collaborator

@lilyz-ai lilyz-ai commented Mar 19, 2026

Summary

  • --disable-log-requests was removed from vLLM's arg parser in v0.17+
  • model-engine hardcodes this flag when launching vllm_server.py, causing startup failures with unrecognized arguments: --disable-log-requests
  • Fix: check if the flag already exists before adding it, so this is a no-op when vLLM already handles it and a backward-compat shim when it doesn't

Test plan

  • Deployed qwen3-5-27b and qwen3-5-0-8b endpoints with vLLM 0.17.0-rc1 image — both confirmed 3/3 Running

🤖 Generated with Claude Code

Greptile Summary

This PR adds a backward-compatibility shim in vllm_server.py so that the --disable-log-requests CLI flag (hardcoded by model-engine when sensitive_log_mode is enabled) is silently accepted rather than causing an unrecognized arguments startup failure in vLLM 0.17+, where the flag was removed from the arg parser.

Key points:

  • The fix correctly uses parser._actions to check whether --disable-log-requests is already registered before adding a no-op handler, so pre-0.17 behavior is fully preserved.
  • The main concern is that --disable-log-requests is not merely a legacy artifact — it is still emitted by the current llm_model_endpoint_use_cases.py whenever hmi_config.sensitive_log_mode is True. With this shim in place, vLLM 0.17+ will silently ignore the flag, meaning request logging will not be suppressed for sensitive_log_mode endpoints. If this mode carries privacy or compliance expectations, this is a behavioral regression that should be explicitly acknowledged and tracked.
  • The comment describing the shim attributes the flag to "older model-engine versions", which is inaccurate and may mislead future maintainers.

Confidence Score: 3/5

  • Safe to merge for startup reliability, but carries an unaddressed behavioral regression for sensitive_log_mode endpoints on vLLM 0.17+.
  • The mechanical fix (preventing startup crashes) is correct and tested. However, the PR silently converts an active feature (sensitive_log_mode--disable-log-requests) into a no-op for vLLM 0.17+ without documenting an alternative or confirming vLLM 0.17+ still suppresses request logs through another mechanism. This warrants attention before merging in compliance-sensitive environments.
  • model-engine/model_engine_server/inference/vllm/vllm_server.py — the shim comment is misleading, and the interaction with sensitive_log_mode in llm_model_endpoint_use_cases.py should be explicitly addressed.

Important Files Changed

Filename Overview
model-engine/model_engine_server/inference/vllm/vllm_server.py Adds a backward-compat no-op shim for --disable-log-requests removed in vLLM 0.17+. The approach is technically sound but silently disables the behavior of sensitive_log_mode (which relies on this flag to suppress request logs) without a documented replacement path.

Sequence Diagram

sequenceDiagram
    participant ME as model-engine<br/>(llm_model_endpoint_use_cases.py)
    participant SH as Shell
    participant VS as vllm_server.py
    participant PA as FlexibleArgumentParser

    ME->>SH: python -m vllm_server ... --disable-log-requests
    note over ME: sensitive_log_mode=True<br/>→ disable_log_requests=True<br/>→ appends --disable-log-requests to cmd

    SH->>VS: launch with --disable-log-requests in sys.argv

    VS->>PA: make_arg_parser(parser)
    note over PA: vLLM < 0.17: --disable-log-requests registered<br/>vLLM ≥ 0.17: flag NOT registered

    VS->>PA: check parser._actions for --disable-log-requests

    alt vLLM < 0.17 (flag already exists)
        PA-->>VS: flag found → skip add_argument
        PA->>PA: parse_args() — flag works as intended
    else vLLM ≥ 0.17 (flag missing)
        VS->>PA: add_argument("--disable-log-requests", no-op)
        PA->>PA: parse_args() — flag accepted but ignored
        note over PA: ⚠️ request logs NOT suppressed
    end
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: model-engine/model_engine_server/inference/vllm/vllm_server.py
Line: 26-36

Comment:
**Silent no-op may break `sensitive_log_mode` compliance guarantees**

The comment says "older model-engine versions pass `--disable-log-requests`", but the *current* model-engine code (`llm_model_endpoint_use_cases.py:996-997`) still hardcodes this flag whenever `hmi_config.sensitive_log_mode` is `True`:

```python
if hmi_config.sensitive_log_mode:
    vllm_args.disable_log_requests = True
```

By silently accepting `--disable-log-requests` as a no-op in vLLM 0.17+, request logging will **not** be disabled for endpoints that have `sensitive_log_mode` set. If `sensitive_log_mode` is used for privacy or compliance reasons, this silent behavioral regression could expose request-level logs that were previously suppressed.

It would be worth either:
1. Confirming that vLLM 0.17+ disables request logging by default (or via a different mechanism) and documenting that here, or
2. Identifying the replacement mechanism in vLLM 0.17+ (e.g., a new flag or `VLLM_CONFIGURE_LOGGING` env var) and wiring `sensitive_log_mode` through that path alongside this no-op shim.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: model-engine/model_engine_server/inference/vllm/vllm_server.py
Line: 26-27

Comment:
**Misleading comment — this is current code, not legacy**

The comment attributes the flag to "older model-engine versions", but `--disable-log-requests` is passed by the **current** model-engine code in `llm_model_endpoint_use_cases.py` (conditionally, when `sensitive_log_mode` is enabled). Calling it "older" could mislead future developers into treating this shim as safe to remove once the old caller is gone, when in fact the caller is still active.

```suggestion
    # Compatibility shim: model-engine passes --disable-log-requests (controlled by
    # sensitive_log_mode) which was removed from vLLM's arg parser in v0.17+.
    # Accept it as a no-op to avoid "unrecognized arguments" startup failures.
    # TODO: Investigate whether vLLM 0.17+ exposes an alternative mechanism for
    # suppressing request logs and update llm_model_endpoint_use_cases.py accordingly.
```

**Rule Used:** Add comments to explain complex or non-obvious log... ([source](https://app.greptile.com/review/custom-context?memory=928586f9-9432-435e-a385-026fa49318a2))

**Learnt From**
[scaleapi/scaleapi#126958](https://github.com/scaleapi/scaleapi/pull/126958)

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "fix(vllm): add --dis..."

Greptile also left 1 inline comment on this PR.

Context used:

  • Rule used - Add comments to explain complex or non-obvious log... (source)

Learnt From
scaleapi/scaleapi#126958

…d compat

vLLM 0.17.0 removed --disable-log-requests from its arg parser, but
model-engine hardcodes this flag when launching vllm_server. Accept
the flag as a no-op when it's not present in the vLLM parser to avoid
startup failures with newer vLLM images.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lilyz-ai lilyz-ai requested a review from a team March 19, 2026 02:31
Comment on lines +26 to +36
# Backward compatibility: older model-engine versions pass --disable-log-requests
# which was removed from vLLM's arg parser in v0.17+. Accept it as a no-op.
if not any(
"--disable-log-requests" in getattr(a, "option_strings", []) for a in parser._actions
):
parser.add_argument(
"--disable-log-requests",
action="store_true",
default=False,
help="(deprecated, no-op) Kept for backward compatibility with older model-engine versions.",
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Silent no-op may break sensitive_log_mode compliance guarantees

The comment says "older model-engine versions pass --disable-log-requests", but the current model-engine code (llm_model_endpoint_use_cases.py:996-997) still hardcodes this flag whenever hmi_config.sensitive_log_mode is True:

if hmi_config.sensitive_log_mode:
    vllm_args.disable_log_requests = True

By silently accepting --disable-log-requests as a no-op in vLLM 0.17+, request logging will not be disabled for endpoints that have sensitive_log_mode set. If sensitive_log_mode is used for privacy or compliance reasons, this silent behavioral regression could expose request-level logs that were previously suppressed.

It would be worth either:

  1. Confirming that vLLM 0.17+ disables request logging by default (or via a different mechanism) and documenting that here, or
  2. Identifying the replacement mechanism in vLLM 0.17+ (e.g., a new flag or VLLM_CONFIGURE_LOGGING env var) and wiring sensitive_log_mode through that path alongside this no-op shim.
Prompt To Fix With AI
This is a comment left during a code review.
Path: model-engine/model_engine_server/inference/vllm/vllm_server.py
Line: 26-36

Comment:
**Silent no-op may break `sensitive_log_mode` compliance guarantees**

The comment says "older model-engine versions pass `--disable-log-requests`", but the *current* model-engine code (`llm_model_endpoint_use_cases.py:996-997`) still hardcodes this flag whenever `hmi_config.sensitive_log_mode` is `True`:

```python
if hmi_config.sensitive_log_mode:
    vllm_args.disable_log_requests = True
```

By silently accepting `--disable-log-requests` as a no-op in vLLM 0.17+, request logging will **not** be disabled for endpoints that have `sensitive_log_mode` set. If `sensitive_log_mode` is used for privacy or compliance reasons, this silent behavioral regression could expose request-level logs that were previously suppressed.

It would be worth either:
1. Confirming that vLLM 0.17+ disables request logging by default (or via a different mechanism) and documenting that here, or
2. Identifying the replacement mechanism in vLLM 0.17+ (e.g., a new flag or `VLLM_CONFIGURE_LOGGING` env var) and wiring `sensitive_log_mode` through that path alongside this no-op shim.

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant