Skip to content

[Serve LLM] Fix enable_log_requests=False not being forwarded to vLLM AsyncLLM#60824

Open
kouroshHakha wants to merge 4 commits intoray-project:masterfrom
kouroshHakha:kh/fix-all-logs
Open

[Serve LLM] Fix enable_log_requests=False not being forwarded to vLLM AsyncLLM#60824
kouroshHakha wants to merge 4 commits intoray-project:masterfrom
kouroshHakha:kh/fix-all-logs

Conversation

@kouroshHakha
Copy link
Contributor

@kouroshHakha kouroshHakha commented Feb 7, 2026

Summary

Forward enable_log_requests from engine args to the AsyncLLM constructor so that enable_log_requests=False actually suppresses per-request log messages.

Pre-requisit:

Reproduction

from ray.serve.llm import LLMConfig

config = LLMConfig(
    model_loading_config={"model_id": "my-model", "model_source": "org/model"},
    engine_kwargs={
        "tensor_parallel_size": 4,
        "enable_log_requests": False,
    },
)

Expected: No Added request cmpl-... lines in stderr.

Actual:

INFO ... [async_llm.py:428] Added request cmpl-bench-174196d2-1487-0-afeeac71.

Root Cause

In _start_async_llm_engine() (vllm_engine.py), log_requests is never passed to AsyncLLM, so it defaults to True:

# Before (bug)
engine_client = AsyncLLM(
    vllm_config=vllm_engine_config,
    executor_class=executor_class,
    log_stats=not vllm_engine_args.disable_log_stats,
    stat_loggers=custom_stat_loggers,
)

Fix

# After
engine_client = AsyncLLM(
    vllm_config=vllm_engine_config,
    executor_class=executor_class,
    log_requests=vllm_engine_args.enable_log_requests,
    log_stats=not vllm_engine_args.disable_log_stats,
    stat_loggers=custom_stat_loggers,
)

Also removes the deprecated disable_log_requests compat shim in vllm_models.py since vLLM has fully dropped that flag.

Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
@kouroshHakha kouroshHakha requested review from a team as code owners February 7, 2026 04:36
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two important logging-related fixes. The primary change correctly forwards the enable_log_requests argument to the vLLM engine, allowing users to suppress per-request logs as intended. This also includes a cleanup to remove a deprecated compatibility shim for disable_log_requests. Additionally, a secondary fix ensures that setting enable_access_log=False in Ray Serve's logging configuration correctly suppresses access logs in stderr, not just in log files. A new regression test has been added to verify this behavior. The changes are well-implemented and improve the logging control and consistency. The code looks good.

stream_handler.setFormatter(serve_formatter)
stream_handler.addFilter(log_to_stderr_filter)
stream_handler.addFilter(ServeContextFilter())
if logging_config.enable_access_log is False:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this meant for this PR?

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.

2 participants