mudler/LocalAI · error · ValueError

audio input requires a LongCat-Video-Avatar-1.5 model

Error message

audio input requires a LongCat-Video-Avatar-1.5 model

What it means

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.

Source

Thrown at backend/python/longcat-video/backend.py:277

            )
            if ignored_params:
                print(
                    f"longcat-video ignoring unknown request param(s): {', '.join(ignored_params)}",
                    file=sys.stderr,
                )

            os.makedirs(os.path.dirname(request.dst) or ".", mode=0o750, exist_ok=True)
            if hasattr(context, "add_callback"):
                context.add_callback(interrupt_if_cancelled)

            if request.start_image and not os.path.isfile(request.start_image):
                raise ValueError("start_image is not a readable staged file")
            if request.num_frames < 0:
                raise ValueError("num_frames must not be negative")

            if self.model_kind == MODEL_KIND_BASE:
                if request.audio:
                    raise ValueError(
                        "audio input requires a LongCat-Video-Avatar-1.5 model"
                    )
                self._generate_base(request, params)
            else:
                self._generate_avatar(request, params, context)

            return backend_pb2.Result(
                message="Video generated successfully", success=True
            )
        except ValueError as err:
            return self._fail(context, grpc.StatusCode.INVALID_ARGUMENT, str(err))
        except Exception as err:
            print(f"Error generating LongCat video: {err}", file=sys.stderr)
            traceback.print_exc()
            return self._fail(
                context,
                grpc.StatusCode.INTERNAL,
                f"LongCat video generation failed: {err}",

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Omit request.audio when using the base LongCat-Video model (text/image-to-video only)
  2. Or load LongCat-Video-Avatar-1.5 as the model when audio-driven generation is needed

Example fix

# before (base model loaded)
req.audio = "/data/staged/voice.wav"

# after
req.ClearField("audio")  # base model: no audio input
Defensive patterns

Strategy: validation

Validate before calling

def validate_request_for_model(req, model_kind: str):
    """model_kind: 'base' or 'avatar' as reported at load time."""
    if model_kind == "base" and req.audio:
        raise ValueError("audio input is only valid with LongCat-Video-Avatar-1.5")
    if model_kind == "avatar" and not req.audio:
        raise ValueError("avatar model requires audio")
    return req

Try / catch

try:
    stub.GenerateVideo(req)
except grpc.RpcError as e:
    details = e.details() or ""
    if "audio input requires" in details:
        req.ClearField("audio")  # downgrade to text-to-video on base model
        stub.GenerateVideo(req)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: Switching model repos without updating the client; testing the cheaper base model with an avatar (talking-head) pipeline.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/168cdd950c066e36. Report an issue: GitHub.