{"record":{"id":"168cdd950c066e36","repo":"mudler/LocalAI","slug":"audio-input-requires-a-longcat-video-avatar-1-5-mo","errorCode":null,"errorMessage":"audio input requires a LongCat-Video-Avatar-1.5 model","messagePattern":"audio input requires a LongCat-Video-Avatar-1\\.5 model","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/python/longcat-video/backend.py","lineNumber":277,"sourceCode":"            )\n            if ignored_params:\n                print(\n                    f\"longcat-video ignoring unknown request param(s): {', '.join(ignored_params)}\",\n                    file=sys.stderr,\n                )\n\n            os.makedirs(os.path.dirname(request.dst) or \".\", mode=0o750, exist_ok=True)\n            if hasattr(context, \"add_callback\"):\n                context.add_callback(interrupt_if_cancelled)\n\n            if request.start_image and not os.path.isfile(request.start_image):\n                raise ValueError(\"start_image is not a readable staged file\")\n            if request.num_frames < 0:\n                raise ValueError(\"num_frames must not be negative\")\n\n            if self.model_kind == MODEL_KIND_BASE:\n                if request.audio:\n                    raise ValueError(\n                        \"audio input requires a LongCat-Video-Avatar-1.5 model\"\n                    )\n                self._generate_base(request, params)\n            else:\n                self._generate_avatar(request, params, context)\n\n            return backend_pb2.Result(\n                message=\"Video generated successfully\", success=True\n            )\n        except ValueError as err:\n            return self._fail(context, grpc.StatusCode.INVALID_ARGUMENT, str(err))\n        except Exception as err:\n            print(f\"Error generating LongCat video: {err}\", file=sys.stderr)\n            traceback.print_exc()\n            return self._fail(\n                context,\n                grpc.StatusCode.INTERNAL,\n                f\"LongCat video generation failed: {err}\",","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/python/longcat-video/backend.py#L259-L295","documentation":"ValueError from longcat-video generation: the request includes an audio field but the loaded model classified as MODEL_KIND_BASE (LongCat-Video base), which does text-to-video only. Audio-driven avatar generation requires the LongCat-Video-Avatar-1.5 model; the check fires before _generate_base runs and maps to gRPC INVALID_ARGUMENT.","triggerScenarios":"Loading model LongCat-Video (base) and sending a generation request with request.audio set; pointing the model config at a base checkpoint while reusing an avatar workflow that sends audio.","commonSituations":"Switching model repos without updating the client; testing the cheaper base model with an avatar (talking-head) pipeline.","solutions":["Omit request.audio when using the base LongCat-Video model (text/image-to-video only)","Or load LongCat-Video-Avatar-1.5 as the model when audio-driven generation is needed"],"exampleFix":"# before (base model loaded)\nreq.audio = \"/data/staged/voice.wav\"\n\n# after\nreq.ClearField(\"audio\")  # base model: no audio input","handlingStrategy":"validation","validationCode":"def validate_request_for_model(req, model_kind: str):\n    \"\"\"model_kind: 'base' or 'avatar' as reported at load time.\"\"\"\n    if model_kind == \"base\" and req.audio:\n        raise ValueError(\"audio input is only valid with LongCat-Video-Avatar-1.5\")\n    if model_kind == \"avatar\" and not req.audio:\n        raise ValueError(\"avatar model requires audio\")\n    return req","typeGuard":null,"tryCatchPattern":"try:\n    stub.GenerateVideo(req)\nexcept grpc.RpcError as e:\n    details = e.details() or \"\"\n    if \"audio input requires\" in details:\n        req.ClearField(\"audio\")  # downgrade to text-to-video on base model\n        stub.GenerateVideo(req)\n    else:\n        raise","preventionTips":["Branch your generation flow on the loaded model kind, not one generic request builder","Surface model capabilities (base vs avatar) in your app's model metadata"],"tags":["python","longcat-video","grpc","model-mismatch","validation"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}