INNER CODE UNIT · Python

discover_modes

llm-d/llm-d · scripts/guide.py:450

def discover_modes(guide: dict) -> list[str]:
    """Modes come from ``verify.endpoint`` keys, falling back to
    ``benchmark.endpoint``. Modes describe how to talk to the deployed system,
    so endpoint discovery is the natural source. ``[]`` if neither is present."""
    for section in ("verify", "benchmark"):
        node = guide.get(section)
        ep = node.get("endpoint") if isinstance(node, dict) else None
        if isinstance(ep, dict):
            return list(ep.keys())
    return []


def _check_verify(node: Any, declared: set[str], f: Findings) -> None:
    if not isinstance(node, dict):
        f.error("verify: must be a map")
        return
    for k in node:
        if k not in {"endpoint", "tests"}:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…