{"record":{"id":"bf6311dbe67850cc","repo":"sgl-project/sglang","slug":"batching-config-rule-from-source-contains-unknow","errorCode":null,"errorMessage":"batching config rule from {source} contains unknown key(s): {', '.join(hints)}","messagePattern":"batching config rule from (.+?) contains unknown key\\(s\\): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/managers/dynamic_batch_admission.py","lineNumber":320,"sourceCode":"    raise ValueError(\n        \"batching config must be a {'schema_version': 1, 'rules': [...]} object, \"\n        \"a list of rules, or a mapping keyed by model|resolution\"\n    )\n\n\ndef _validate_rule_keys(data: dict[str, Any], *, source: str) -> None:\n    unknown = sorted(set(data) - _BATCHING_RULE_KEYS)\n    if not unknown:\n        return\n\n    hints = []\n    for key in unknown:\n        matches = get_close_matches(key, _BATCHING_RULE_KEYS, n=1)\n        if matches:\n            hints.append(f\"{key!r} (did you mean {matches[0]!r}?)\")\n        else:\n            hints.append(repr(key))\n    raise ValueError(\n        f\"batching config rule from {source} contains unknown key(s): \"\n        f\"{', '.join(hints)}\"\n    )\n\n\ndef _optional_str(value: Any) -> str | None:\n    if value is None:\n        return None\n    return str(value)\n\n\ndef _optional_float(value: Any) -> float | None:\n    if value is None:\n        return None\n    return float(value)\n\n\ndef _optional_bool(value: Any) -> bool | None:","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/managers/dynamic_batch_admission.py#L302-L338","documentation":"Each rule object may only contain the known BatchingRule keys; _validate_rule_keys collects unknown keys (with difflib 'did you mean' suggestions) and raises listing all of them, prefixed by the config file path.","triggerScenarios":"A rule containing a misspelled or unsupported key, e.g. \"max_batch\" instead of \"max_batch_size\", or a legacy key removed from _BATCHING_RULE_KEYS.","commonSituations":"Typos in hand-edited configs; keys valid in a different/newer schema version; copy-paste from docs that are out of sync with the installed version.","solutions":["Rename or remove the unknown keys per the did-you-mean hints in the message","Check _BATCHING_RULE_KEYS in dynamic_batch_admission.py for the exact supported key set of your installed version"],"exampleFix":"// before\n{\"model\": \"x\", \"max_batch\": 4}\n// after\n{\"model\": \"x\", \"max_batch_size\": 4}","handlingStrategy":"validation","validationCode":"KNOWN = {\"model\",\"model_contains\",\"resolution\",\"device_memory_gb_min\",\"device_memory_gb_max\",\"max_batch_size\",\"max_cost\"}\nfor i, r in enumerate(rules):\n    unknown = set(r) - KNOWN\n    if unknown:\n        raise SystemExit(f\"rule[{i}] unknown keys: {sorted(unknown)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read the did-you-mean hint in the error before guessing key spellings"],"tags":["config","batching","typo","unknown-key"],"backgroundTag":"unknown-config-key","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}