{"record":{"id":"e9744cde143ccd16","repo":"vllm-project/vllm","slug":"do-not-combine-a-positional-recipe-json-source-wit","errorCode":null,"errorMessage":"Do not combine a positional recipe JSON source with --model/--hardware/--strategy discovery options.","messagePattern":"Do not combine a positional recipe JSON source with --model/--hardware/--strategy discovery options\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/recipes/recipe_json_to_vllm_config.py","lineNumber":634,"sourceCode":"    else:\n        lines.append(\"# No recipe-specific environment variables.\")\n\n    lines.append(\"\")\n    Path(path).write_text(\"\\n\".join(lines), encoding=\"utf-8\")\n    Path(path).chmod(Path(path).stat().st_mode | 0o111)\n\n\ndef main() -> int:\n    args = parse_args()\n\n    try:\n        source = args.source\n        if source is None:\n            source = discover_recipe_source(\n                args.api_base, args.model, args.hardware, args.strategy\n            )\n        elif args.model or args.hardware or args.strategy:\n            raise ValueError(\n                \"Do not combine a positional recipe JSON source with \"\n                \"--model/--hardware/--strategy discovery options.\"\n            )\n\n        recipe = load_json(source)\n        if not isinstance(recipe, dict):\n            raise ValueError(\"Recipe JSON must be a JSON object.\")\n\n        argv = recipe_argv(recipe)\n        config = argv_to_config(argv)\n        write_config(args.config_out, source, recipe, config)\n        write_env(args.env_out, source, recipe)\n    except Exception as exc:\n        print(f\"ERROR: {exc}\", file=sys.stderr)\n        return 1\n\n    print(f\"Wrote {args.config_out}\")\n    print(f\"Wrote {args.env_out}\")","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/recipes/recipe_json_to_vllm_config.py#L616-L652","documentation":"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.","triggerScenarios":"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.","commonSituations":"Copy-pasting a previous discovery command and appending a downloaded JSON path; shell history editing; scripted invocations that always pass flags.","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"],"exampleFix":"# before\npython tools/recipes/recipe_json_to_vllm_config.py recipe.json --model Qwen/Qwen3-8B\n# after\npython tools/recipes/recipe_json_to_vllm_config.py recipe.json","handlingStrategy":"validation","validationCode":"if positional_source is not None and (args.model or args.hardware or args.strategy):\n    raise SystemExit(\"pass either the positional source or --model/--hardware/--strategy, not both\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one invocation mode per run and template your commands accordingly","Use argparse mutually exclusive groups if wrapping this CLI in your own tooling"],"tags":["vllm-recipes","cli-usage","argument-validation"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}