vllm-project/vllm · error · ValueError
Do not combine a positional recipe JSON source with…
Error message
Do not combine a positional recipe JSON source with --model/--hardware/--strategy discovery options.
What it means
The CLI accepts either a positional recipe JSON source OR discovery via --model/--hardware/--strategy, but not both. main() checks: if a positional source was given and any of the three discovery flags is also set, it raises this ValueError, because the two paths would disagree about which recipe to convert.
Solutions
- Drop either the positional source or all of --model/--hardware/--strategy from the command
- If you have the JSON already, run: python tools/recipes/recipe_json_to_vllm_config.py recipe.json
- If you want discovery, remove the positional path: python tools/recipes/recipe_json_to_vllm_config.py --model MODEL --hardware HW
Example fix
# before python tools/recipes/recipe_json_to_vllm_config.py recipe.json --model Qwen/Qwen3-8B # after python tools/recipes/recipe_json_to_vllm_config.py recipe.json
Defensive patterns
Strategy: validation
Validate before calling
if positional_source is not None and (args.model or args.hardware or args.strategy):
raise SystemExit("pass either the positional source or --model/--hardware/--strategy, not both") Prevention
- Pick one invocation mode per run and template your commands accordingly
- Use argparse mutually exclusive groups if wrapping this CLI in your own tooling
When it happens
Trigger: Running e.g. `recipe_json_to_vllm_config.py recipe.json --model Qwen/Qwen3-8B` — the positional file wins for content, but --model signals discovery, so the tool refuses the ambiguous invocation.
Common situations: Copy-pasting a previous discovery command and appending a downloaded JSON path; shell history editing; scripted invocations that always pass flags.
Related errors
- Cannot merge nested option
- Expected model after 'vllm serve', got
- Expected recipe argv to start with: ['vllm', 'serve'…
- did not return a JSON object.
- did not return a JSON object.
AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14).
Data as JSON: /api/errors/e9744cde143ccd16.
Report an issue: GitHub.
Appendix: source
Thrown at tools/recipes/recipe_json_to_vllm_config.py:634
else:
lines.append("# No recipe-specific environment variables.")
lines.append("")
Path(path).write_text("\n".join(lines), encoding="utf-8")
Path(path).chmod(Path(path).stat().st_mode | 0o111)
def main() -> int:
args = parse_args()
try:
source = args.source
if source is None:
source = discover_recipe_source(
args.api_base, args.model, args.hardware, args.strategy
)
elif args.model or args.hardware or args.strategy:
raise ValueError(
"Do not combine a positional recipe JSON source with "
"--model/--hardware/--strategy discovery options."
)
recipe = load_json(source)
if not isinstance(recipe, dict):
raise ValueError("Recipe JSON must be a JSON object.")
argv = recipe_argv(recipe)
config = argv_to_config(argv)
write_config(args.config_out, source, recipe, config)
write_env(args.env_out, source, recipe)
except Exception as exc:
print(f"ERROR: {exc}", file=sys.stderr)
return 1
print(f"Wrote {args.config_out}")
print(f"Wrote {args.env_out}")View on GitHub (pinned to c794754062)