{"record":{"id":"62b0115c6cccc56f","repo":"sgl-project/sglang","slug":"inklingmultimodalprocessor-required-config-field","errorCode":null,"errorMessage":"InklingMultimodalProcessor: required config field {where}.{name!r} is missing. It must be set in the model config so preprocessing matches the model. Add it to config.json.","messagePattern":"InklingMultimodalProcessor: required config field (.+?)\\.(.+?) is missing\\. It must be set in the model config so preprocessing matches the model\\. Add it to config\\.json\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/multimodal/processors/inkling.py","lineNumber":101,"sourceCode":"        return base64.b64decode(payload) if \";base64\" in header else payload.encode()\n    if url.startswith((\"http://\", \"https://\")):\n        return download_remote_media(url, timeout=30)\n    return url  # plain path / file:// -> handled by the per-modality byte loader\n\n\n_MISSING = object()\n\n\ndef _require(obj, name, *, where):\n    \"\"\"Read a config field that MUST be present — no silent default.\n\n    A wrong-but-silent fallback here corrupts model inputs (e.g. encoding with a\n    different dmel grid than the model de-bins with yields garbage audio embeddings\n    and no error), so fail loudly instead.\n    \"\"\"\n    val = getattr(obj, name, _MISSING) if obj is not None else _MISSING\n    if val is _MISSING or val is None:\n        raise ValueError(\n            f\"InklingMultimodalProcessor: required config field {where}.{name!r} is \"\n            f\"missing. It must be set in the model config so preprocessing matches \"\n            f\"the model. Add it to config.json.\"\n        )\n    return val\n\n\nclass InklingMultimodalProcessor(SGLangBaseProcessor):\n    # import_processors() registers this for the Inkling arch. Text-only checkpoints leave\n    # both towers disabled (gated on *_config.decoder_dmodel), so it is a no-op there.\n    models: List[Type] = [InklingForConditionalGeneration]\n\n    def __init__(self, hf_config, server_args, _processor, *args, **kwargs):\n        super().__init__(hf_config, server_args, _processor, *args, **kwargs)\n\n        vision_config = _cfg(hf_config, \"vision_config\")\n        audio_config = _cfg(hf_config, \"audio_config\")\n        # InklingMMConfig always builds default vision/audio sub-configs (decoder_dmodel=None)","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/inkling.py#L83-L119","documentation":"The Inkling multimodal processor requires that the model config (config.json) carries specific fields (e.g. the dmel audio grid parameters) because preprocessing must exactly match what the model was trained with. _raise_if_missing/_require raises when a required attribute is absent or None on the HF config object instead of silently guessing a default, since a mismatched grid yields garbage audio embeddings with no error.","triggerScenarios":"Loading an Inkling model whose config.json is missing one of the required fields (deleted during quantization/export, hand-edited, or from an older checkpoint); passing a config where the field is explicitly null.","commonSituations":"Community-uploaded checkpoints with stripped config fields; converting/merging models and dropping extra keys; finetuned saves that didn't persist custom fields.","solutions":["Inspect the model's config.json and add the missing field with the value the base checkpoint used (compare against the original repo on the Hub)","If using a local finetune/export pipeline, ensure custom config keys are preserved on save","Verify you are loading the correct revision of the checkpoint (git checkout of the HF revision)"],"exampleFix":"// before (config.json)\n{ \"architectures\": [\"InklingForConditionalGeneration\"] }\n// after\n{\n  \"architectures\": [\"InklingForConditionalGeneration\"],\n  \"audio_config\": { \"dmel\": { \"n_mels\": 128, \"sampling_rate\": 24000 } }\n}","handlingStrategy":"validation","validationCode":"REQUIRED = ['audio_config']  # per processor docs\ncfg = AutoConfig.from_pretrained(model_id).to_dict()\nmissing = [k for k in REQUIRED if cfg.get(k) is None]\nif missing:\n    raise RuntimeError(f'config.json missing {missing}; fix checkpoint before serving')","typeGuard":"def has_required_config(cfg: dict, keys: list[str]) -> bool:\n    return all(cfg.get(k) is not None for k in keys)","tryCatchPattern":null,"preventionTips":["Validate checkpoints right after download/export","Diff config.json against the base model repo before serving finetunes","Pin HF revision IDs"],"tags":["multimodal","model-config","inkling","missing-config-field"],"backgroundTag":"missing-model-config-field","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}