Vllm serve拉起推理服务报错了

TMPDIR=/msswift_tmp/tmp
vllm serve /mnt/workspace/model/base/Qwen3-VL-4B-Instruct
–load-format safetensors
–dtype bfloat16
–max-model-len 10240
–block-size 16
–enable-prefix-caching False
–gpu-memory-utilization 0.25
–max-num-seqs 3
–disable-log-stats
–limit-mm-per-prompt ‘{“image”:1}’
–tensor-parallel-size 1
–pipeline-parallel-size 1
–port 9014
–enable-chunked-prefill
–mm-processor-kwargs ‘{“max_pixels”:262144}’
–kv-cache-dtype auto
–served-model-name “Qwen3-VL-4B-Instruct”

INFO 12-12 14:22:38 [init.py:216] Automatically detected platform cuda.
usage: vllm [-h] [-v] {chat,complete,serve,bench,collect-env,run-batch} …
vllm: error: unrecognized arguments: False

The error is caused by the argument --enable-prefix-caching False, which is not a valid way to disable this flag. In vLLM, boolean flags are enabled or disabled using --enable-prefix-caching to enable, and --no-enable-prefix-caching to disable. Passing False as a value is not supported and results in an “unrecognized arguments” error. Remove False and use --no-enable-prefix-caching instead, e.g.:

vllm serve ... --no-enable-prefix-caching ...

See the official documentation for boolean flag usage: Engine Arguments.

Would you like more detail on other arguments in your command?

Sources:

Hint: Mention @RunLLM in the post for followups.

@RunLLM -limit-mm-per-prompt参数中,我希望限制vedio的上限为0

你可以通过 --limit-mm-per-prompt '{"video": 0}'--limit-mm-per-prompt.video 0 来将视频输入的上限设置为0,这样每个请求将不允许包含视频内容。据官方文档配置说明,这两种写法都被支持。

示例命令如下:

vllm serve ... --limit-mm-per-prompt '{"video": 0}'

vllm serve ... --limit-mm-per-prompt.video 0

需要更详细的参数说明或用法吗?

Sources:

Hint: Mention @RunLLM in the post for followups.

@RunLLM 下面是我的详细推理参数,我希望vllm打印尽可能多的日志:
vllm serve /mnt/data-nas/road_class/v1-20251204-115223/checkpoint-40
–load-format safetensors
–dtype bfloat16
–max-model-len 10240 # 理论上的单次最大token数
–block-size 64
–no-enable-prefix-caching
–gpu-memory-utilization 0.9
–max-num-seqs 62 # 理论上的最大并发数
–disable-log-stats
–limit-mm-per-prompt ‘{“image”:1,“video”:0}’
–tensor-parallel-size 1
–pipeline-parallel-size 1
–port 9014
–enable-chunked-prefill
–kv-cache-dtype auto
–served-model-name "Qwen3-VL-4B-Instruct

要让vLLM打印尽可能多的日志,建议不要加 --disable-log-stats,并确保未使用任何抑制日志的参数。你可以通过去掉 --disable-log-stats,并适当调整日志级别(如通过环境变量或日志配置),以获得更详细的运行信息。vLLM默认会输出较为详细的INFO级别日志,包含模型加载、内存分配、推理等信息。官方文档未提供直接设置日志级别的CLI参数,但可以通过环境变量或日志配置文件进一步控制。

另外,你的 --limit-mm-per-prompt 参数建议用英文单引号或直接用 --limit-mm-per-prompt.image 1 --limit-mm-per-prompt.video 0,避免中文引号导致解析失败。其余参数设置基本合理。

需要更详细的日志配置方法或环境变量说明吗?

Sources:

Hint: Mention @RunLLM in the post for followups.

@RunLLM

需要更详细的日志配置方法或环境变量说明

你可以通过设置环境变量 VLLM_LOGGING_LEVEL=DEBUG 来让vLLM输出更详细的日志信息。此外,vLLM支持通过 VLLM_CONFIGURE_LOGGINGVLLM_LOGGING_CONFIG_PATH 环境变量自定义日志配置。VLLM_CONFIGURE_LOGGING=1(默认)启用日志配置,VLLM_CONFIGURE_LOGGING=0 禁用vLLM日志配置。若需自定义日志格式和内容,可将 VLLM_LOGGING_CONFIG_PATH 指向一个符合Python logging dictConfig规范的JSON配置文件。官方文档有详细说明和示例。

例如,设置环境变量并自定义日志配置文件:

export VLLM_LOGGING_LEVEL=DEBUG
export VLLM_LOGGING_CONFIG_PATH=/path/to/logging_config.json

logging_config.json 示例见文档

需要具体的JSON配置文件示例或更详细的环境变量说明吗?

Sources:

Hint: Mention @RunLLM in the post for followups.

@RunLLM
需要具体的JSON配置文件示例或更详细的环境变量说明

你可以通过如下JSON文件自定义vLLM日志格式(假设路径为 /path/to/logging_config.json),并用环境变量 VLLM_LOGGING_CONFIG_PATH 指定它。常用环境变量有:VLLM_LOGGING_LEVEL(日志级别),VLLM_CONFIGURE_LOGGING(是否启用日志配置,默认1),VLLM_LOGGING_CONFIG_PATH(自定义日志配置文件路径)。详细说明见官方文档

示例 logging_config.json:

{
  "formatters": {
    "json": {
      "class": "pythonjsonlogger.jsonlogger.JsonFormatter"
    }
  },
  "handlers": {
    "console": {
      "class": "logging.StreamHandler",
      "formatter": "json",
      "level": "DEBUG",
      "stream": "ext://sys.stdout"
    }
  },
  "loggers": {
    "vllm": {
      "handlers": ["console"],
      "level": "DEBUG",
      "propagate": false
    }
  },
  "version": 1
}

启动前设置:

export VLLM_LOGGING_LEVEL=DEBUG
export VLLM_LOGGING_CONFIG_PATH=/path/to/logging_config.json

Sources:

Hint: Mention @RunLLM in the post for followups.