# Vllm serve拉起推理服务报错了

**URL:** <https://discuss.vllm.ai/t/vllm-serve/2112>\
**Category:** General\
**Created:** [December 12, 2025, 6:23am UTC](https://discuss.vllm.ai/t/vllm-serve/2112 "2025-12-12T06:23:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sxcnmslll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/sxcnmslll/32/946_2.png) [@sxcnmslll](https://discuss.vllm.ai/u/sxcnmslll)\
**Post date:** [December 12, 2025, 6:23am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/1 "2025-12-12T06:23:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [December 12, 2025, 6:24am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/2 "2025-12-12T06:24:12Z")

</div>

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.:

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

```

See the official documentation for boolean flag usage: [Engine Arguments](https://docs.vllm.ai/en/latest/serving/engine_args.html#searchbox).

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

Sources:

- [Engine Arguments](https://docs.vllm.ai/en/latest/serving/engine_args.html#searchbox)

Hint: Mention @RunLLM in the post for followups.

---

<div class="post-metadata">

**Author:** ![sxcnmslll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/sxcnmslll/32/946_2.png) [@sxcnmslll](https://discuss.vllm.ai/u/sxcnmslll)\
**Post date:** [December 12, 2025, 6:30am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/3 "2025-12-12T06:30:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [December 12, 2025, 6:30am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/4 "2025-12-12T06:30:17Z")

</div>

你可以通过 `--limit-mm-per-prompt '{"video": 0}'` 或 `--limit-mm-per-prompt.video 0` 来将视频输入的上限设置为0，这样每个请求将不允许包含视频内容。据[官方文档](https://docs.vllm.ai/en/latest/cli/serve/#-limit-mm-per-prompt)和[配置说明](https://docs.vllm.ai/en/latest/configuration/conserving_memory/)，这两种写法都被支持。

示例命令如下：

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

```

或

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

```

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

Sources:

- [官方文档](https://docs.vllm.ai/en/latest/cli/serve/#-limit-mm-per-prompt)
- [配置说明](https://docs.vllm.ai/en/latest/configuration/conserving_memory/)

Hint: Mention @RunLLM in the post for followups.

---

<div class="post-metadata">

**Author:** ![sxcnmslll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/sxcnmslll/32/946_2.png) [@sxcnmslll](https://discuss.vllm.ai/u/sxcnmslll)\
**Post date:** [December 15, 2025, 6:44am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/5 "2025-12-15T06:44:12Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [December 15, 2025, 6:45am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/6 "2025-12-15T06:45:07Z")

</div>

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

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

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

Sources:

- [CLI参数说明](https://docs.vllm.ai/en/latest/serving/serve_args.html#cli-arguments)

Hint: Mention @RunLLM in the post for followups.

---

<div class="post-metadata">

**Author:** ![sxcnmslll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/sxcnmslll/32/946_2.png) [@sxcnmslll](https://discuss.vllm.ai/u/sxcnmslll)\
**Post date:** [December 15, 2025, 6:45am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/7 "2025-12-15T06:45:49Z")

</div>

> [@RunLLM](#):
>
> 需要更详细的日志配置方法或环境变量说明

@RunLLM

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

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [December 15, 2025, 6:46am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/8 "2025-12-15T06:46:08Z")

</div>

你可以通过设置环境变量 `VLLM_LOGGING_LEVEL=DEBUG` 来让vLLM输出更详细的日志信息。此外，vLLM支持通过 `VLLM_CONFIGURE_LOGGING` 和 `VLLM_LOGGING_CONFIG_PATH` 环境变量自定义日志配置。`VLLM_CONFIGURE_LOGGING=1`（默认）启用日志配置，`VLLM_CONFIGURE_LOGGING=0` 禁用vLLM日志配置。若需自定义日志格式和内容，可将 `VLLM_LOGGING_CONFIG_PATH` 指向一个符合Python logging dictConfig规范的JSON配置文件。[官方文档](https://docs.vllm.ai/en/latest/examples/others/logging_configuration/)有详细说明和示例。

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

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

```

`logging_config.json` 示例见[文档](https://docs.vllm.ai/en/latest/examples/others/logging_configuration/)。

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

Sources:

- [Logging Configuration](https://docs.vllm.ai/en/latest/examples/others/logging_configuration/)

Hint: Mention @RunLLM in the post for followups.

---

<div class="post-metadata">

**Author:** ![sxcnmslll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/sxcnmslll/32/946_2.png) [@sxcnmslll](https://discuss.vllm.ai/u/sxcnmslll)\
**Post date:** [December 15, 2025, 6:50am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/9 "2025-12-15T06:50:36Z")

</div>

> [@RunLLM](#):
>
> 需要具体的JSON配置文件示例或更详细的环境变量说明吗？

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

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [December 15, 2025, 6:50am UTC](https://discuss.vllm.ai/t/vllm-serve/2112/10 "2025-12-15T06:50:58Z")

</div>

你可以通过如下JSON文件自定义vLLM日志格式（假设路径为 `/path/to/logging_config.json`），并用环境变量 `VLLM_LOGGING_CONFIG_PATH` 指定它。常用环境变量有：`VLLM_LOGGING_LEVEL`（日志级别），`VLLM_CONFIGURE_LOGGING`（是否启用日志配置，默认1），`VLLM_LOGGING_CONFIG_PATH`（自定义日志配置文件路径）。详细说明见[官方文档](https://docs.vllm.ai/en/latest/examples/others/logging_configuration/)。

示例 logging\_config.json：

```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
}

```

启动前设置：

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

```

Sources:

- [Logging Configuration](https://docs.vllm.ai/en/latest/examples/others/logging_configuration/)

Hint: Mention @RunLLM in the post for followups.
