vllm-project/vllm · error · ValueError

Interactive input is unavailable. Pass --model and --hardwar

Error message

Interactive input is unavailable. Pass --model and --hardware, or provide a recipe JSON URL/file.

What it means

When no recipe JSON source is given, the tool falls back to an interactive model/hardware picker that reads from stdin. prompt() catches EOFError (closed stdin, no TTY, CI) and converts it into this ValueError telling you to supply the non-interactive arguments instead.

Source

Thrown at tools/recipes/recipe_json_to_vllm_config.py:144

def load_json(source: str) -> dict[str, Any] | list[Any]:
    if source.startswith(("http://", "https://")):
        req = urllib.request.Request(
            source,
            headers={"User-Agent": "vllm-recipe-config-converter/1.0"},
        )
        with urllib.request.urlopen(req, timeout=30) as response:
            return json.load(response)

    with open(source, encoding="utf-8") as f:
        return json.load(f)


def prompt(text: str) -> str:
    try:
        return input(text).strip()
    except EOFError as exc:
        raise ValueError(
            "Interactive input is unavailable. Pass --model and --hardware, "
            "or provide a recipe JSON URL/file."
        ) from exc


def model_label(model: dict[str, Any]) -> str:
    label = str(model.get("hf_id", ""))
    title = model.get("title")
    provider = model.get("provider")
    if title and title != label:
        label += f" — {title}"
    if provider:
        label += f" [{provider}]"
    return label


def search_models(
    models: list[dict[str, Any]], query: str, limit: int = 20

View on GitHub (pinned to c794754062)

Solutions

  1. Pass explicit flags: `--model <query> --hardware <id>` (and optionally `--strategy`).
  2. Or supply the recipe JSON directly via URL/path so discovery never prompts.
  3. For local exploration, run inside a real terminal so prompts work.

Example fix

# before (CI job)
python tools/recipes/recipe_json_to_vllm_config.py < /dev/null
# -> ValueError: Interactive input is unavailable...

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

Strategy: validation

Validate before calling

import sys
non_interactive = not sys.stdin.isatty()
if non_interactive and not (args.model and args.hardware) and not args.recipe:
    raise SystemExit("Non-interactive run needs --model/--hardware or a recipe JSON URL/file")

Try / catch

try:
    value = input(prompt)
except EOFError:
    raise SystemExit("No TTY: pass --model and --hardware explicitly") from None

Prevention

When it happens

Trigger: Invoking recipe_json_to_vllm_config.py in CI/piped context without --model/--hardware and without a recipe JSON URL/file, so the first input() hits EOF.

Common situations: Scripting the tool in automation with stdin closed; running it under a non-interactive shell where the discovery flow starts but cannot prompt.

Related errors


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