{"record":{"id":"13b12acf505fbffc","repo":"vllm-project/vllm","slug":"strategy-requested-r-is-not-available-for-this-m","errorCode":null,"errorMessage":"Strategy {requested!r} is not available for this model/hardware. Available: {', '.join(strategies)}","messagePattern":"Strategy (.+?) is not available for this model/hardware\\. Available: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/recipes/recipe_json_to_vllm_config.py","lineNumber":307,"sourceCode":"    hardware_json_url: str,\n    recipe: dict[str, Any],\n    requested: str | None,\n    interactive: bool,\n) -> tuple[str, str]:\n    recommended, sources = strategy_sources(api_base, hardware_json_url, recipe)\n    strategies = [recommended, *sorted(s for s in sources if s != recommended)]\n\n    if requested:\n        selected = next(\n            (\n                strategy\n                for strategy in strategies\n                if strategy.lower() == requested.lower()\n            ),\n            None,\n        )\n        if selected is None:\n            raise ValueError(\n                f\"Strategy {requested!r} is not available for this model/hardware. \"\n                f\"Available: {', '.join(strategies)}\"\n            )\n        return selected, sources[selected]\n\n    if not interactive:\n        return recommended, hardware_json_url\n\n    print(\"\\nAvailable strategies:\")\n\n    def strategy_label(strategy: str) -> str:\n        if strategy == recommended:\n            return f\"{strategy} (recommended)\"\n        return strategy\n\n    selected = choose_from_menu(strategies, strategy_label, \"Select strategy: \")\n    return selected, sources[selected]\n","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/recipes/recipe_json_to_vllm_config.py#L289-L325","documentation":"select_strategy() validates --strategy against the strategy ids available for the chosen model/hardware (the recommended one plus alternatives from the recipe JSON). An explicit request matching none of them (case-insensitive) raises ValueError listing valid ids.","triggerScenarios":"Passing --strategy with an id not present in the recipe's 'strategy'/'alternatives' mapping, e.g. 'tp8' when only 'tp4-pp2' and 'tp2-pp4' are offered.","commonSituations":"Assuming a parallelism layout exists for a model/hardware pair that was never benchmarked; typos or renamed strategy ids between recipe versions.","solutions":["Use one of the ids listed in the error message.","Run without --strategy to accept the recommended strategy or browse them interactively.","Inspect the recipe JSON's strategy/alternatives fields for the exact available ids."],"exampleFix":"# before\n... --model \"llama 3.1\" --hardware h100 --strategy tp8\n# -> ValueError: Strategy 'tp8' is not available ... Available: tp4-pp2, tp2-pp4\n\n# after\n... --model \"llama 3.1\" --hardware h100 --strategy tp4-pp2","handlingStrategy":"validation","validationCode":"strategies = {recommended, *sources}\nif args.strategy and args.strategy.lower() not in {s.lower() for s in strategies}:\n    raise SystemExit(f\"Unknown strategy {args.strategy!r}; available: {sorted(strategies)}\")","typeGuard":"def is_known_strategy(requested: str, sources: dict[str, str]) -> bool:\n    return requested.lower() in {s.lower() for s in sources}","tryCatchPattern":null,"preventionTips":["Read the recipe's strategy/alternatives keys before pinning --strategy in scripts.","Omit --strategy to accept the recommended value in automation."],"tags":["cli","recipes","strategy","validation","tooling"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}