Skip to content

test: add parse_cli_args coverage for vLLM nested arg preservation (fixes #3348)#4019

Open
finaspirant wants to merge 1 commit into
UKGovernmentBEIS:mainfrom
finaspirant:test/parse-cli-args-vllm-nested-args-3348
Open

test: add parse_cli_args coverage for vLLM nested arg preservation (fixes #3348)#4019
finaspirant wants to merge 1 commit into
UKGovernmentBEIS:mainfrom
finaspirant:test/parse-cli-args-vllm-nested-args-3348

Conversation

@finaspirant
Copy link
Copy Markdown

Summary

Adds unit tests for parse_cli_args — the CLI layer that processes -M flags
— to prevent regression of issue #3348.

Background

When running:

inspect eval task.py --model vllm/model \
  -M speculative-config.num_speculative_tokens=1

the argument flows through two stages:

  1. parse_cli_args normalises the full key string (hyphens → underscores)
  2. _server_arg_to_cli_key converts back to CLI format for vllm serve,
    preserving underscores in nested segments

In v0.3.183, stage 2 used a global .replace("_", "-") which mangled the
nested portion — num_speculative_tokensnum-speculative-tokens — breaking
pydantic validation in vLLM's SpeculativeConfig. The fix landed in #4016 via
_server_arg_to_cli_key, with tests added in tests/util/test_local_server.py.

parse_cli_args (stage 1) had zero test coverage. This PR adds it.

Tests Added

tests/cli/test_parse_cli_args.py — 6 tests:

Fixes #3348

…KGovernmentBEIS#3348)

parse_cli_args had zero test coverage. This adds 6 tests covering the
full -M flag pipeline for dotted vLLM arguments, including the regression
case from UKGovernmentBEIS#3348 where nested underscores (e.g. num_speculative_tokens)
were being mangled to hyphens (num-speculative-tokens), breaking pydantic
validation in vLLM's SpeculativeConfig.

The _server_arg_to_cli_key fix landed in UKGovernmentBEIS#4016; these tests lock in the
correct behaviour at the CLI parsing layer.

Fixes UKGovernmentBEIS#3348
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.

Incorrect replacement of "_" with "-" when passing certain vLLM model arguments

1 participant