{"record":{"id":"29c6bd486a830073","repo":"invoke-ai/InvokeAI","slug":"only-mistralencoder-gguf-config-models-are-support","errorCode":null,"errorMessage":"Only MistralEncoder_GGUF_Config models are supported here.","messagePattern":"Only MistralEncoder_GGUF_Config models are supported here\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/load/model_loaders/mistral_encoder.py","lineNumber":999,"sourceCode":"\n        return model\n\n\n@ModelLoaderRegistry.register(\n    base=BaseModelType.Any,\n    type=ModelType.MistralEncoder,\n    format=ModelFormat.GGUFQuantized,\n)\nclass MistralEncoderGGUFLoader(ModelLoader):\n    \"\"\"Load a GGUF-quantized Mistral encoder (text-only).\"\"\"\n\n    def _load_model(\n        self,\n        config: AnyModelConfig,\n        submodel_type: Optional[SubModelType] = None,\n    ) -> AnyModel:\n        if not isinstance(config, MistralEncoder_GGUF_Config):\n            raise ValueError(\"Only MistralEncoder_GGUF_Config models are supported here.\")\n\n        match submodel_type:\n            case SubModelType.TextEncoder:\n                return self._load_from_gguf(config)\n            case SubModelType.Tokenizer:\n                logger = InvokeAILogger.get_logger(\"MistralEncoderProcessor\")\n                return _load_tokenizer_for_model(Path(config.path), logger)\n\n        raise ValueError(\n            \"Only Tokenizer and TextEncoder submodels are supported. \"\n            f\"Received: {submodel_type.value if submodel_type else 'None'}\"\n        )\n\n    def _load_from_gguf(self, config: MistralEncoder_GGUF_Config) -> AnyModel:\n        logger = InvokeAILogger.get_logger(self.__class__.__name__)\n        target_device = TorchDevice.choose_torch_device()\n        compute_dtype = TorchDevice.choose_bfloat16_safe_dtype(target_device)\n","sourceCodeStart":981,"sourceCodeEnd":1017,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/load/model_loaders/mistral_encoder.py#L981-L1017","documentation":"MistralEncoderGGUFLoader._load_model (GGUF-quantized Mistral encoder format) asserts isinstance(config, MistralEncoder_GGUF_Config) and raises ValueError otherwise. Only GGUF config records may reach this loader; a Diffusers-folder or single-file checkpoint config indicates the caller bypassed the registry dispatch or the config record's format/class are inconsistent.","triggerScenarios":"Calling MistralEncoderGGUFLoader._load_model with MistralEncoder_Diffusers_Config, MistralEncoder_Checkpoint_Config, or any non-GGUF AnyModelConfig — typically via direct loader invocation or hand-built config records.","commonSituations":"Scripts that force a .gguf file through the wrong loader class; test harnesses with mocked configs; model records whose declared format was edited (e.g. from Checkpoint to GGUFQuantized) without re-generating the config class.","solutions":["Pass a MistralEncoder_GGUF_Config whose path points to the .gguf file.","Use the model manager so the registry picks the loader matching the config's format instead of calling this class directly.","For safetensors checkpoints use MistralEncoderCheckpointLoader; for HF folders use MistralEncoderDiffusersLoader.","Re-scan/re-import the model so the config class matches the actual file format."],"exampleFix":"// before\nmodel = gguf_loader._load_model(diffusers_cfg, SubModelType.TextEncoder)  # ValueError\n// after\nfrom invokeai.backend.model_manager.configs.mistral import MistralEncoder_GGUF_Config\nassert isinstance(cfg, MistralEncoder_GGUF_Config)\nmodel = gguf_loader._load_model(cfg, SubModelType.TextEncoder)","handlingStrategy":"type-guard","validationCode":"from invokeai.backend.model_manager.configs.mistral import MistralEncoder_GGUF_Config\n\ndef can_load_with_gguf_loader(cfg: AnyModelConfig) -> bool:\n    return isinstance(cfg, MistralEncoder_GGUF_Config)","typeGuard":"def is_mistral_gguf_config(cfg: AnyModelConfig) -> TypeGuard[MistralEncoder_GGUF_Config]:\n    return isinstance(cfg, MistralEncoder_GGUF_Config)","tryCatchPattern":"try:\n    model = loader._load_model(cfg, SubModelType.TextEncoder)\nexcept ValueError as e:\n    if \"Only MistralEncoder_GGUF_Config\" in str(e):\n        model = registry_loader_for(cfg)._load_model(cfg, SubModelType.TextEncoder)\n    else:\n        raise","preventionTips":["Point GGUF loader calls only at .gguf files with GGUF config records.","Let the loader registry choose the loader from the config format.","Re-scan models after changing a record's format so the config class is regenerated."],"tags":["python","model-loading","gguf","config-validation","invokeai"],"backgroundTag":"unsupported-model-config-type","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}