vllm-project/vllm · error · ValueError

{hardware_json_url} did not return a JSON object.

Error message

{hardware_json_url} did not return a JSON object.

What it means

A hardware was selected from by_hardware and its JSON URL fetched, but the response parsed to a non-object (list/string/number/null). The per-hardware recipe must be a JSON object for the subsequent select_strategy() step, so the tool aborts.

Source

Thrown at tools/recipes/recipe_json_to_vllm_config.py:380

            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,
    )

    print("\nResolved recipe:")
    print(f"  Model:    {model.get('hf_id')}")
    print(f"  Hardware: {hardware}")
    print(f"  Strategy: {strategy}")
    print(f"  JSON:     {resolved}")
    print()

    return resolved

View on GitHub (pinned to c794754062)

Solutions

  1. curl the exact hardware_json_url from the error message and check the JSON top-level type
  2. Verify the path in by_hardware is current for your --api-base (paths and base must come from the same API generation)
  3. Update the vllm checkout, or hand-fetch a valid hardware recipe JSON and pass it positionally
Defensive patterns

Strategy: validation

Validate before calling

hw_data = json.load(urllib.request.urlopen(hardware_json_url))
if not isinstance(hw_data, dict):
    raise SystemExit(f"{hardware_json_url} is {type(hw_data).__name__}, expected object")

Type guard

def is_json_object(x: object) -> bool:
    return isinstance(x, dict)

Prevention

When it happens

Trigger: The by_hardware path points at a list endpoint or returns a bare string (e.g. a rendered command line instead of a document); stale path after the API reorganized its URL layout; proxy interference mangling the response.

Common situations: Recipes API URL restructuring; per-hardware rendering format change; caching layer serving wrong content type for the path.

Related errors


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