{"record":{"id":"cca0bdbd6fb9587e","repo":"mudler/LocalAI","slug":"base-model-must-point-to-a-longcat-video-checkpoin","errorCode":null,"errorMessage":"base_model must point to a LongCat-Video checkpoint","messagePattern":"base_model must point to a LongCat-Video checkpoint","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/python/longcat-video/backend.py","lineNumber":472,"sourceCode":"            text_encoder=text_encoder,\n            vae=vae,\n            scheduler=scheduler,\n            dit=dit,\n        )\n        self.pipeline.to(self.device_index)\n\n    def _load_avatar_model(self, model):\n        avatar_patterns = list(AVATAR_COMMON_PATTERNS)\n        model_subfolder = (\n            \"base_model_int8\" if self.options[\"use_int8\"] else \"base_model\"\n        )\n        avatar_patterns.append(f\"{model_subfolder}/**\")\n        checkpoint = self._resolve_checkpoint(model, avatar_patterns)\n\n        base_model = self._resolve_option_path(self.options.get(\"base_model\"))\n        base_model = base_model or BASE_MODEL_ID\n        if classify_model(str(base_model)) != MODEL_KIND_BASE:\n            raise ValueError(\"base_model must point to a LongCat-Video checkpoint\")\n        base_checkpoint = self._resolve_checkpoint(base_model, AVATAR_BASE_PATTERNS)\n\n        dtype = self.torch.bfloat16\n        overrides = attention_overrides(self.options[\"attention_backend\"])\n        tokenizer = self.AutoTokenizer.from_pretrained(\n            base_checkpoint,\n            subfolder=\"tokenizer\",\n        )\n        text_encoder = self.UMT5EncoderModel.from_pretrained(\n            base_checkpoint,\n            subfolder=\"text_encoder\",\n            torch_dtype=dtype,\n            low_cpu_mem_usage=True,\n        )\n        vae = self.AutoencoderKLWan.from_pretrained(\n            base_checkpoint,\n            subfolder=\"vae\",\n            torch_dtype=dtype,","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/python/longcat-video/backend.py#L454-L490","documentation":"ValueError from _load_avatar_model(): when loading the Avatar-1.5 pipeline, the 'base_model' option (or the BASE_MODEL_ID default) must classify as MODEL_KIND_BASE — i.e. point at a LongCat-Video base checkpoint that supplies the tokenizer, UMT5 text encoder, and VAE via the AVATAR_BASE_PATTERNS subfolders. If it resolves to the avatar model itself or something else, the checkpoint resolution for the base components would fetch wrong weights, so it is rejected up front.","triggerScenarios":"Setting options.base_model to the avatar repo (circular: avatar needs a *base* checkpoint); pointing base_model at an unrelated HF repo or local dir; default BASE_MODEL_ID unavailable and overridden with a wrong id.","commonSituations":"Users set every option to the same avatar model id thinking it is a fallback; local offline setups where base_model is redirected to a local path that only contains avatar weights.","solutions":["Set base_model to the LongCat-Video base checkpoint (the repo containing tokenizer/, text_encoder/, vae/ subfolders)","Or omit base_model so the built-in BASE_MODEL_ID default is used","Verify the path/id with classify_model-like naming: it must be the base video model, not the avatar variant"],"exampleFix":"# before\noptions:\n  base_model: LongCat-Video/Live-LongCat-Video-Avatar-1.5\n\n# after\noptions:\n  base_model: LongCat-Video/Live-LongCat-Video","handlingStrategy":"validation","validationCode":"def validate_avatar_options(options: dict) -> dict:\n    base = options.get(\"base_model\")  # None -> backend default, which is valid\n    if base is not None and \"avatar\" in str(base).lower():\n        raise ValueError(\"base_model must be a LongCat-Video base checkpoint, not the avatar model\")\n    return options","typeGuard":null,"tryCatchPattern":"try:\n    stub.LoadModel(opts)\nexcept grpc.RpcError as e:\n    if \"base_model\" in (e.details() or \"\"):\n        opts[\"options\"].pop(\"base_model\", None)  # let backend use its default base\n        stub.LoadModel(opts)\n    else:\n        raise","preventionTips":["Omit base_model unless you deliberately host the base checkpoint at a custom location","Keep base and avatar checkpoint ids in named constants to avoid copy-paste swaps"],"tags":["python","longcat-video","model-loading","configuration","validation"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}