invoke-ai/InvokeAI · error · ValueError
Only MistralEncoder_GGUF_Config models are supported here.
Error message
Only MistralEncoder_GGUF_Config models are supported here.
What it means
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.
Source
Thrown at invokeai/backend/model_manager/load/model_loaders/mistral_encoder.py:999
return model
@ModelLoaderRegistry.register(
base=BaseModelType.Any,
type=ModelType.MistralEncoder,
format=ModelFormat.GGUFQuantized,
)
class MistralEncoderGGUFLoader(ModelLoader):
"""Load a GGUF-quantized Mistral encoder (text-only)."""
def _load_model(
self,
config: AnyModelConfig,
submodel_type: Optional[SubModelType] = None,
) -> AnyModel:
if not isinstance(config, MistralEncoder_GGUF_Config):
raise ValueError("Only MistralEncoder_GGUF_Config models are supported here.")
match submodel_type:
case SubModelType.TextEncoder:
return self._load_from_gguf(config)
case SubModelType.Tokenizer:
logger = InvokeAILogger.get_logger("MistralEncoderProcessor")
return _load_tokenizer_for_model(Path(config.path), logger)
raise ValueError(
"Only Tokenizer and TextEncoder submodels are supported. "
f"Received: {submodel_type.value if submodel_type else 'None'}"
)
def _load_from_gguf(self, config: MistralEncoder_GGUF_Config) -> AnyModel:
logger = InvokeAILogger.get_logger(self.__class__.__name__)
target_device = TorchDevice.choose_torch_device()
compute_dtype = TorchDevice.choose_bfloat16_safe_dtype(target_device)
View on GitHub (pinned to 0b6a024f2f)
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.
Example fix
// before model = gguf_loader._load_model(diffusers_cfg, SubModelType.TextEncoder) # ValueError // after from invokeai.backend.model_manager.configs.mistral import MistralEncoder_GGUF_Config assert isinstance(cfg, MistralEncoder_GGUF_Config) model = gguf_loader._load_model(cfg, SubModelType.TextEncoder)
Defensive patterns
Strategy: type-guard
Validate before calling
from invokeai.backend.model_manager.configs.mistral import MistralEncoder_GGUF_Config
def can_load_with_gguf_loader(cfg: AnyModelConfig) -> bool:
return isinstance(cfg, MistralEncoder_GGUF_Config) Type guard
def is_mistral_gguf_config(cfg: AnyModelConfig) -> TypeGuard[MistralEncoder_GGUF_Config]:
return isinstance(cfg, MistralEncoder_GGUF_Config) Try / catch
try:
model = loader._load_model(cfg, SubModelType.TextEncoder)
except ValueError as e:
if "Only MistralEncoder_GGUF_Config" in str(e):
model = registry_loader_for(cfg)._load_model(cfg, SubModelType.TextEncoder)
else:
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Only MistralEncoder_Diffusers_Config models are supported he
- Only MistralEncoder_Checkpoint_Config models are supported h
- Expected Main_GGUF_ZImage_Config, got {type(config).__name__
- Only Tokenizer and TextEncoder submodels are supported. Rece
- A submodel type must be provided when loading onnx pipelines
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/29c6bd486a830073.
Report an issue: GitHub.