{"record":{"id":"0a7447126675e9bf","repo":"sgl-project/sglang","slug":"processor-config-key-must-be-set-for-mimo-v2","errorCode":null,"errorMessage":"processor_config.{key} must be set for MiMo-V2","messagePattern":"processor_config\\.(.+?) must be set for MiMo-V2","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multimodal/processors/mimo_v2.py","lineNumber":1492,"sourceCode":"\nclass MiMoV2Processor(BaseMultimodalProcessor):\n    models = [MiMoV2ForCausalLM]\n\n    @staticmethod\n    def _normalize_config_dict(config, name: str) -> dict:\n        if config is None:\n            return {}\n        if isinstance(config, dict):\n            return config\n        if hasattr(config, \"to_dict\"):\n            return config.to_dict()\n        raise ValueError(f\"{name} must be a dict-like config, got {type(config)}\")\n\n    @staticmethod\n    def _require_config_value(config: dict, key: str):\n        value = config.get(key)\n        if value is None:\n            raise ValueError(f\"processor_config.{key} must be set for MiMo-V2\")\n        return value\n\n    def _validate_placeholder_counts(\n        self,\n        text_parts,\n        multimodal_tokens_pattern,\n        image_count: int,\n        video_count: int,\n        audio_count: int,\n    ):\n        counts = {\n            Modality.IMAGE: 0,\n            Modality.VIDEO: 0,\n            Modality.AUDIO: 0,\n        }\n        for text_part in text_parts:\n            if multimodal_tokens_pattern.match(text_part):\n                modality = self.mm_tokens.get_modality_of_token(text_part)","sourceCodeStart":1474,"sourceCodeEnd":1510,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/mimo_v2.py#L1474-L1510","documentation":"Raised by _require_config_value during MiMoProcessor.__init__ when processor_config lacks a mandatory key (value is None). Required keys include vision_start_token_id and friends; the message names the exact missing key.","triggerScenarios":"Building MiMoProcessor from a processor_config dict that omits a required field (e.g. 'vision_start_token_id'), because the checkpoint's preprocessor_config.json is incomplete or the key name changed.","commonSituations":"Hand-edited or trimmed preprocessor configs; older checkpoints predating required fields; configs migrated between naming conventions (e.g. image_start_token_id vs vision_start_token_id).","solutions":["Add the missing key named in the message to processor_config with the correct token id from the model's tokenizer_config/preprocessor_config","Load the full preprocessor_config.json shipped with the checkpoint rather than a subset","If the checkpoint genuinely lacks the field, use a MiMo-V2-compatible checkpoint revision"],"exampleFix":"# before: processor_config = {'fps': 2.0}\n# after\nprocessor_config = {\n  'fps': 2.0,\n  'vision_start_token_id': tokenizer.convert_tokens_to_ids('<|vision_start|>'),\n  # ...other required keys...\n}","handlingStrategy":"validation","validationCode":"REQUIRED = ['vision_start_token_id', 'vision_end_token_id', 'image_token_id', 'video_token_id', 'audio_token_id']\nmissing = [k for k in REQUIRED if processor_config.get(k) is None]\nassert not missing, f'processor_config missing: {missing}'","typeGuard":null,"tryCatchPattern":"try:\n    proc = MiMoProcessor(hf_config, server_args, _processor)\nexcept ValueError as e:\n    if 'must be set for MiMo-V2' in str(e):\n        key = re.search(r'processor_config\\.(\\w+)', str(e)).group(1)\n        processor_config.setdefault(key, tokenizer.convert_tokens_to_ids(f'<|{key.replace(\"_token_id\", \"\")}|>'))\n        proc = MiMoProcessor(hf_config, server_args, _processor)\n    else:\n        raise","preventionTips":["Load the full preprocessor_config.json from the checkpoint","Validate required keys before model init","Use checkpoint revisions matched to your sglang version"],"tags":["config","missing-key","initialization","checkpoint"],"backgroundTag":"missing-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}