vllm-project/vllm · error · ValueError

Hardware {requested!r} is not available for this model. Avai

Error message

Hardware {requested!r} is not available for this model. Available: {', '.join(hardware_ids)}

What it means

After a model is selected, select_hardware() validates the --hardware flag against the hardware ids the model's recipe JSON actually offers (case-insensitive). An explicit request matching none of them raises ValueError listing the available ids.

Source

Thrown at tools/recipes/recipe_json_to_vllm_config.py:253

        if requested:
            raise ValueError(f"No recipe model matched {requested!r}.")

        print(f"No recipe model matched {query!r}. Try again.")
        query = None


def select_hardware(
    by_hardware: dict[str, str], requested: str | None
) -> tuple[str, str]:
    hardware_ids = sorted(by_hardware)

    if requested:
        selected = next(
            (hw for hw in hardware_ids if hw.lower() == requested.lower()),
            None,
        )
        if selected is None:
            raise ValueError(
                f"Hardware {requested!r} is not available for this model. "
                f"Available: {', '.join(hardware_ids)}"
            )
        return selected, by_hardware[selected]

    print("\nAvailable hardware:")
    selected = choose_from_menu(hardware_ids, lambda value: value, "Select hardware: ")
    return selected, by_hardware[selected]


def strategy_sources(
    api_base: str, hardware_json_url: str, recipe: dict[str, Any]
) -> tuple[str, dict[str, str]]:
    recommended = recipe.get("strategy")
    if not isinstance(recommended, str) or not recommended:
        raise ValueError(
            "Hardware recipe JSON does not contain a usable `strategy` field."
        )

View on GitHub (pinned to c794754062)

Solutions

  1. Pick one of the ids listed in the error message (e.g. --hardware a100).
  2. Run without --hardware to see the interactive hardware menu for that model.
  3. If your GPU is missing, choose the closest available recipe and adapt the config manually.

Example fix

# before
python tools/recipes/recipe_json_to_vllm_config.py --model "llama 3.1" --hardware h100
# -> ValueError: Hardware 'h100' is not available ... Available: a100, b200

# after
python tools/recipes/recipe_json_to_vllm_config.py --model "llama 3.1" --hardware a100
Defensive patterns

Strategy: validation

Validate before calling

hardware_ids = sorted(by_hardware)
if args.hardware and args.hardware.lower() not in {h.lower() for h in hardware_ids}:
    raise SystemExit(f"Unknown hardware {args.hardware!r}; available: {', '.join(hardware_ids)}")

Type guard

def is_known_hardware(requested: str, by_hardware: dict[str, str]) -> bool:
    return requested.lower() in {h.lower() for h in by_hardware}

Prevention

When it happens

Trigger: Passing --hardware h100 when the chosen model's recipes only cover e.g. a100, b200, mi300; using a marketing GPU name instead of the catalog's id.

Common situations: Assuming a model has a recipe for your GPU when only other SKUs were benchmarked; hardware id spelling/case mismatch not caught by the case-insensitive compare (e.g. 'h100-80gb' vs 'h100').

Related errors


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/ab3f674bf57ceeb0. Report an issue: GitHub.