invoke-ai/InvokeAI · info · NotAMatchError

filename does not look like bnb quantized llm_int8

Error message

filename does not look like bnb quantized llm_int8

What it means

NotAMatchError from T5Encoder_BnBLLMint8_Config.raise_if_filename_doesnt_look_like_bnb_quantized. It requires at least one weight file whose path contains 'llm_int8' (the naming convention bitsandbytes LLM.int8 conversions use). If no weight filename contains that substring, the config declines the match.

Source

Thrown at invokeai/backend/model_manager/configs/t5_encoder.py:91

        raise_if_not_dir(mod)

        raise_for_override_fields(cls, override_fields)

        expected_config_path = mod.path / "text_encoder_2" / "config.json"
        expected_class_name = "T5EncoderModel"
        raise_for_class_name(expected_config_path, expected_class_name)

        cls.raise_if_filename_doesnt_look_like_bnb_quantized(mod)

        cls.raise_if_state_dict_doesnt_look_like_bnb_quantized(mod)

        return cls(**override_fields)

    @classmethod
    def raise_if_filename_doesnt_look_like_bnb_quantized(cls, mod: ModelOnDisk) -> None:
        filename_looks_like_bnb = any(x for x in mod.weight_files() if "llm_int8" in x.as_posix())
        if not filename_looks_like_bnb:
            raise NotAMatchError("filename does not look like bnb quantized llm_int8")

    @classmethod
    def raise_if_state_dict_doesnt_look_like_bnb_quantized(cls, mod: ModelOnDisk) -> None:
        has_scb_key_suffix = state_dict_has_any_keys_ending_with(mod.load_state_dict(), "SCB")
        if not has_scb_key_suffix:
            raise NotAMatchError("state dict does not look like bnb quantized llm_int8")


class T5Encoder_SDNQ_Config(Config_Base):
    """Configuration for SDNQ-quantized T5 Encoder models.

    Matches two layouts:

    1. **Standalone T5 bundle**: ``mod.path`` is the pipeline-style root, with
       ``text_encoder_2/`` (and usually ``tokenizer_2/``) as subfolders.
    2. **Inline submodel**: ``mod.path`` *is* the ``text_encoder_2`` folder itself —
       this is how a parent FluxPipeline / similar config registers its T5 submodel
       (``submodels[TextEncoder2].path_or_prefix`` points straight at the folder).

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Download the official llm_int8-named conversion (filenames must contain 'llm_int8')
  2. Rename the weight file to include 'llm_int8' only if you are certain it is a bnb LLM.int8 quantization, then rescan
  3. If the model is not bnb-quantized, no action needed — this config correctly declined; register with the appropriate config type explicitly

Example fix

// before
t5-encoder/model.safetensors
// after
t5-encoder/t5-xxl-encoder-llm_int8.safetensors
Defensive patterns

Strategy: validation

Validate before calling

def looks_like_llm_int8(model_dir) -> bool:
    from invokeai.backend.util.util import ...
    files = list(model_dir.rglob("*.safetensors"))
    return any("llm_int8" in f.as_posix() for f in files)

Try / catch

try:
    install_model(path)
except NotAMatchError as e:
    if "llm_int8" in str(e):
        logger.warning("Not a bnb llm_int8 conversion; falling back to standard T5 config")

Prevention

When it happens

Trigger: from_model_on_disk probing a directory whose weight files (per mod.weight_files()) have no 'llm_int8' in their filename — e.g. standard fp16 safetensors, or a bnb model saved with default filenames instead of the llm_int8 naming convention.

Common situations: Using a bnb-quantized model that was saved/resaved with generic names (model.safetensors), downloading fp16 T5 instead of the llm_int8 conversion, or renaming files after download.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/23f357bb82b476a8. Report an issue: GitHub.