{"record":{"id":"23f357bb82b476a8","repo":"invoke-ai/InvokeAI","slug":"filename-does-not-look-like-bnb-quantized-llm-int8","errorCode":null,"errorMessage":"filename does not look like bnb quantized llm_int8","messagePattern":"filename does not look like bnb quantized llm_int8","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"info","filePath":"invokeai/backend/model_manager/configs/t5_encoder.py","lineNumber":91,"sourceCode":"        raise_if_not_dir(mod)\n\n        raise_for_override_fields(cls, override_fields)\n\n        expected_config_path = mod.path / \"text_encoder_2\" / \"config.json\"\n        expected_class_name = \"T5EncoderModel\"\n        raise_for_class_name(expected_config_path, expected_class_name)\n\n        cls.raise_if_filename_doesnt_look_like_bnb_quantized(mod)\n\n        cls.raise_if_state_dict_doesnt_look_like_bnb_quantized(mod)\n\n        return cls(**override_fields)\n\n    @classmethod\n    def raise_if_filename_doesnt_look_like_bnb_quantized(cls, mod: ModelOnDisk) -> None:\n        filename_looks_like_bnb = any(x for x in mod.weight_files() if \"llm_int8\" in x.as_posix())\n        if not filename_looks_like_bnb:\n            raise NotAMatchError(\"filename does not look like bnb quantized llm_int8\")\n\n    @classmethod\n    def raise_if_state_dict_doesnt_look_like_bnb_quantized(cls, mod: ModelOnDisk) -> None:\n        has_scb_key_suffix = state_dict_has_any_keys_ending_with(mod.load_state_dict(), \"SCB\")\n        if not has_scb_key_suffix:\n            raise NotAMatchError(\"state dict does not look like bnb quantized llm_int8\")\n\n\nclass T5Encoder_SDNQ_Config(Config_Base):\n    \"\"\"Configuration for SDNQ-quantized T5 Encoder models.\n\n    Matches two layouts:\n\n    1. **Standalone T5 bundle**: ``mod.path`` is the pipeline-style root, with\n       ``text_encoder_2/`` (and usually ``tokenizer_2/``) as subfolders.\n    2. **Inline submodel**: ``mod.path`` *is* the ``text_encoder_2`` folder itself —\n       this is how a parent FluxPipeline / similar config registers its T5 submodel\n       (``submodels[TextEncoder2].path_or_prefix`` points straight at the folder).","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/t5_encoder.py#L73-L109","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Download the official llm_int8-named conversion (filenames must contain 'llm_int8')","Rename the weight file to include 'llm_int8' only if you are certain it is a bnb LLM.int8 quantization, then rescan","If the model is not bnb-quantized, no action needed — this config correctly declined; register with the appropriate config type explicitly"],"exampleFix":"// before\nt5-encoder/model.safetensors\n// after\nt5-encoder/t5-xxl-encoder-llm_int8.safetensors","handlingStrategy":"validation","validationCode":"def looks_like_llm_int8(model_dir) -> bool:\n    from invokeai.backend.util.util import ...\n    files = list(model_dir.rglob(\"*.safetensors\"))\n    return any(\"llm_int8\" in f.as_posix() for f in files)","typeGuard":null,"tryCatchPattern":"try:\n    install_model(path)\nexcept NotAMatchError as e:\n    if \"llm_int8\" in str(e):\n        logger.warning(\"Not a bnb llm_int8 conversion; falling back to standard T5 config\")","preventionTips":["Download conversions whose filenames follow the llm_int8 convention","Don't rename quantized weight files after download","Confirm the quantization method before choosing a config"],"tags":["bitsandbytes","quantization","model-identification"],"backgroundTag":"model-scan-no-match","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}