{"record":{"id":"acbdcffa20e6f33e","repo":"vllm-project/vllm","slug":"o-is-missing-its-value","errorCode":null,"errorMessage":"-O is missing its value","messagePattern":"-O is missing its value","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/recipes/recipe_json_to_vllm_config.py","lineNumber":488,"sourceCode":"        raise ValueError(f\"Expected model after 'vllm serve', got {model!r}\")\n\n    config: dict[str, Any] = {\"model\": model}\n\n    i = 3\n    while i < len(argv):\n        token = argv[i]\n\n        # -O3 / -O=3\n        if token.startswith(\"-O\") and token != \"-O\":\n            value = token[3:] if token.startswith(\"-O=\") else token[2:]\n            merge_value(config, [\"optimization-level\"], coerce(value))\n            i += 1\n            continue\n\n        # -O 3\n        if token == \"-O\":\n            if i + 1 >= len(argv):\n                raise ValueError(\"-O is missing its value\")\n            merge_value(config, [\"optimization-level\"], coerce(argv[i + 1]))\n            i += 2\n            continue\n\n        # Selected common short aliases.\n        if token in SHORT_ALIASES:\n            if i + 1 >= len(argv):\n                raise ValueError(f\"{token} is missing its value\")\n            merge_value(\n                config,\n                [SHORT_ALIASES[token]],\n                coerce(argv[i + 1]),\n            )\n            i += 2\n            continue\n\n        if not token.startswith(\"--\"):\n            raise ValueError(","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/recipes/recipe_json_to_vllm_config.py#L470-L506","documentation":"The bare '-O' flag is the last token of argv: the parser expects its value as the next token (i + 1) but i + 1 is past the end of the list, so optimization-level cannot be set and parsing aborts with ValueError('-O is missing its value').","triggerScenarios":"Recipe argv ending in exactly '-O', e.g. ['vllm','serve','m','-O']; a renderer bug dropping the optimization level value; truncation of the argv array.","commonSituations":"Recipes API emitting '-O' with a value that got filtered out (e.g. null dropped during JSON rendering); manual editing that removed the trailing value.","solutions":["jq '.argv' recipe.json and check the last tokens","Append the missing value ('-O 3') or switch to the attached forms '-O3' / '-O=3' which cannot dangle","Re-fetch the recipe if the value was lost in rendering/report the malformed recipe"],"exampleFix":"# before\n\"argv\": [\"vllm\", \"serve\", \"m\", \"-O\"]\n# after\n\"argv\": [\"vllm\", \"serve\", \"m\", \"-O3\"]","handlingStrategy":"validation","validationCode":"argv = [str(x) for x in recipe[\"argv\"]]\nfor i, tok in enumerate(argv):\n    if tok in (\"-O\", \"-tp\", \"-pp\", \"-dp\") and i + 1 >= len(argv):\n        raise SystemExit(f\"{tok} dangles at end of argv without a value\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer attached forms (-O3, --key=value) when authoring argv — they cannot dangle","Validate that every value-taking token has a successor before feeding argv to the tool"],"tags":["vllm-recipes","argv-parsing","optimization-level"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}