{"record":{"id":"3e13e239da14740c","repo":"vllm-project/vllm","slug":"no-selectable-items-found","errorCode":null,"errorMessage":"No selectable items found.","messagePattern":"No selectable items found\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/recipes/recipe_json_to_vllm_config.py","lineNumber":203,"sourceCode":"        elif tokens and all(token in text for token in tokens):\n            score = 800.0\n        elif tokens and any(token in text for token in tokens):\n            score = 500.0\n        else:\n            ratio = difflib.SequenceMatcher(None, q, hf_id).ratio()\n            if ratio < 0.30:\n                continue\n            score = ratio * 100.0\n\n        scored.append((score, model))\n\n    scored.sort(key=lambda pair: (-pair[0], str(pair[1].get(\"hf_id\", \"\")).lower()))\n    return [model for _, model in scored[:limit]]\n\n\ndef choose_from_menu(items: list[Any], label_fn, prompt_text: str) -> Any:\n    if not items:\n        raise ValueError(\"No selectable items found.\")\n\n    if len(items) == 1:\n        print(f\"Selected: {label_fn(items[0])}\")\n        return items[0]\n\n    for index, item in enumerate(items, start=1):\n        print(f\"  [{index}] {label_fn(item)}\")\n\n    while True:\n        answer = prompt(prompt_text)\n        try:\n            index = int(answer)\n        except ValueError:\n            print(f\"Enter a number from 1 to {len(items)}.\")\n            continue\n        if 1 <= index <= len(items):\n            return items[index - 1]\n        print(f\"Enter a number from 1 to {len(items)}.\")","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/recipes/recipe_json_to_vllm_config.py#L185-L221","documentation":"choose_from_menu() renders a numbered selection list but refuses empty input: if the caller passes zero items (e.g. search scoring filtered everything out, or a model has no hardware entries), it raises ValueError('No selectable items found.') before prompting.","triggerScenarios":"A model search whose results all score below the 0.30 similarity cutoff in search_models(), so the scored list handed to the menu is empty; or by_hardware mapping having no keys for the selected model.","commonSituations":"Querying the Recipes API for a model family that exists in models.json but has no published recipes yet; a stale API base URL returning sparse data; overly specific search strings.","solutions":["Broaden the --model query (e.g. 'llama' instead of a full HF repo name) so at least one candidate passes scoring.","Verify the model actually has recipes by checking the Recipes API/models.json listing.","Update to a current checkout in case scoring cutoffs or API paths changed."],"exampleFix":"# before\npython tools/recipes/recipe_json_to_vllm_config.py --model \"meta-llama/Llama-3.1-70B-Instruct-GPTQ-Int4\"\n# -> ValueError: No selectable items found.\n\n# after\npython tools/recipes/recipe_json_to_vllm_config.py --model \"llama 3.1 70b\"","handlingStrategy":"validation","validationCode":"matches = search_models(models, query)\nif not matches:\n    raise SystemExit(f\"No candidates for {query!r}; broaden the search term\")\n# only then call the interactive menu","typeGuard":"def has_candidates(items: list) -> bool:\n    return bool(items)","tryCatchPattern":null,"preventionTips":["Check match counts before rendering selection menus.","Prefer short canonical model names ('llama 3.1') over full HF repo ids in --model."],"tags":["cli","recipes","search","tooling"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}