vllm-project/vllm · error · ValueError

Model {model.get('hf_id')!r} has no usable hardware JSON pat

Error message

Model {model.get('hf_id')!r} has no usable hardware JSON paths.

What it means

by_hardware was a non-empty dict, but after filtering every entry down to string values that are non-empty ({str(hw): path for ... if isinstance(path, str) and path}), the result is empty. All hardware entries had non-string or blank path values (e.g. null, numbers, or ""), so no hardware JSON can be fetched.

Source

Thrown at tools/recipes/recipe_json_to_vllm_config.py:372

        raise ValueError(
            f"Model {model.get('hf_id')!r} has no rendered "
            "recommended_command in the Recipes API."
        )

    raw_by_hardware = recommended.get("by_hardware")
    if not isinstance(raw_by_hardware, dict) or not raw_by_hardware:
        raise ValueError(
            f"Model {model.get('hf_id')!r} has no per-hardware renderings "
            "in recommended_command.by_hardware."
        )

    by_hardware = {
        str(hw): path
        for hw, path in raw_by_hardware.items()
        if isinstance(path, str) and path
    }
    if not by_hardware:
        raise ValueError(
            f"Model {model.get('hf_id')!r} has no usable hardware JSON paths."
        )

    hardware, path = select_hardware(by_hardware, requested_hardware)
    hardware_json_url = api_url(api_base, path)
    hardware_data = load_json(hardware_json_url)
    if not isinstance(hardware_data, dict):
        raise ValueError(f"{hardware_json_url} did not return a JSON object.")

    interactive = requested_model is None or requested_hardware is None
    strategy, resolved = select_strategy(
        api_base,
        hardware_json_url,
        hardware_data,
        requested_strategy,
        interactive,
    )

View on GitHub (pinned to c794754062)

Solutions

  1. curl the model JSON and inspect the actual value types inside recommended_command.by_hardware
  2. If values became structured objects, update the vllm checkout (the tool expects plain string paths)
  3. Fetch a hardware recipe JSON by another means and pass it as the positional source
Defensive patterns

Strategy: validation

Validate before calling

bh = model_data["recommended_command"]["by_hardware"]
usable = {hw: p for hw, p in bh.items() if isinstance(p, str) and p}
if not usable:
    raise SystemExit("all by_hardware entries have non-string/empty paths")

Type guard

def usable_hardware_paths(bh: dict) -> dict[str, str]:
    return {str(hw): p for hw, p in bh.items() if isinstance(p, str) and p}

Prevention

When it happens

Trigger: by_hardware contains keys like {"h100": null} or {"h100": ""} — renderings listed but paths not filled in; or a schema where values are objects (e.g. {"h100": {"path": ...}}) rather than plain strings.

Common situations: Partially populated API records; schema change from string paths to structured objects; test fixtures that mimic key names but not value types.

Related errors


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