Skip to content

fix(controller): drop invalid --enable-metrics flag from vLLM runtime#1031

Merged
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:fix/vllm-enable-metrics
Jul 9, 2026
Merged

fix(controller): drop invalid --enable-metrics flag from vLLM runtime#1031
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:fix/vllm-enable-metrics

Conversation

@Defilan

@Defilan Defilan commented Jul 9, 2026

Copy link
Copy Markdown
Member

What

Remove the --enable-metrics flag from the vLLM runtime's generated server arguments, and flip the unit test to assert the flag is absent.

Why

--enable-metrics is not a valid vLLM flag. vLLM's OpenAI server always exposes Prometheus metrics at /metrics, so there is nothing to enable. Passing the flag makes vLLM's argument parser reject the whole command, so every vLLM InferenceService pod crashes on startup:

vllm: error: unrecognized arguments: --enable-metrics

Reported in #1030 (thanks @kaechele) against v0.9.2 on K3s/A10. The flag was introduced in #769 on the assumption vLLM had a llama.cpp-style metrics toggle; it does not. The existing unit test asserted the bad flag was present, so the suite stayed green while the runtime was broken end to end (a "test asserts implementation, not behavior" case, cf. #378).

How

  • internal/controller/runtime_vllm.go: drop the --enable-metrics element from BuildArgs; add a NOTE explaining why the flag must not come back. Metrics are unaffected: the PodMonitor already scrapes /metrics, which vLLM serves by default.
  • internal/controller/inferenceservice_deployment_test.go: replace the ContainElement("--enable-metrics") assertion with NotTo(ContainElement("--enable-metrics")) and update the arg count (HaveLen(6) -> HaveLen(5)), so the regression cannot silently return.

Testing

  • go build ./... clean.
  • go test ./internal/controller/ -run TestControllers focused on the vLLM BuildArgs specs: Ran 1 of 522 Specs, 1 Passed.

Checklist

  • Root cause identified and fixed at the source (not the symptom)
  • Unit test updated to guard against regression
  • No change to metrics behavior (/metrics still exposed and scraped)
  • DCO sign-off

Fixes #1030


Assisted-by: Claude Code (Opus 4.8); reviewed and verified by the author.

vLLM has no --enable-metrics flag; its OpenAI server always exposes
Prometheus metrics at /metrics. Emitting the flag makes vLLM's argument
parser reject the whole command, so every vLLM InferenceService pod fails
to start with 'unrecognized arguments: --enable-metrics'. Remove it; the
PodMonitor already scrapes /metrics unconditionally.

The prior unit test asserted the bad flag was present, so the suite stayed
green while the runtime was broken. Flip it to assert the flag is absent so
the regression cannot return.

Fixes defilantech#1030

Signed-off-by: Christopher Maher <chris@mahercode.io>
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Defilan Defilan merged commit 9b9450d into defilantech:main Jul 9, 2026
23 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 9, 2026
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.

[BUG] vllm runtime does not start (unrecognized arguments: --enable-metrics)

1 participant