{"record":{"id":"75ea85d4d42be3fb","repo":"calesthio/OpenMontage","slug":"model-variant-must-be-2-5-standard-fast-or-mini","errorCode":null,"errorMessage":"model_variant must be 2.5, standard, fast, or mini","messagePattern":"model_variant must be 2\\.5, standard, fast, or mini","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":912,"sourceCode":"            \"callback_url\",\n            \"execution_expires_after\",\n            \"priority\",\n            \"safety_identifier\",\n        )\n        for key in optional:\n            if inputs.get(key) is not None:\n                payload[key] = inputs[key]\n        if inputs.get(\"web_search\"):\n            payload[\"tools\"] = [{\"type\": \"web_search\"}]\n\n        self._validate_optional_parameters(payload)\n        self._validate_request_size(payload)\n        return payload\n\n    def _resolve_model(self, inputs: dict[str, Any]) -> tuple[str, str | None]:\n        variant = str(inputs.get(\"model_variant\", \"standard\")).lower()\n        if variant not in self.MODEL_IDS:\n            raise ValueError(\"model_variant must be 2.5, standard, fast, or mini\")\n        model = str(\n            inputs.get(\"model\")\n            or os.environ.get(\"ARK_SEEDANCE_MODEL\")\n            or self.MODEL_IDS[variant]\n        )\n        if not model or any(char.isspace() for char in model):\n            raise ValueError(\"model must be a non-empty Ark Model/Endpoint ID\")\n        for known_variant, known_model in self.MODEL_IDS.items():\n            if model == known_model:\n                return model, known_variant\n        # Endpoint IDs and future model IDs can have account-specific pricing.\n        # Keep the caller's requested model, but never pretend its price is the\n        # public price of model_variant.\n        return model, None\n\n    @staticmethod\n    def _normalize_duration(value: Any, max_seconds: int = 15) -> int:\n        if value == \"auto\":","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L894-L930","documentation":"Raised by _resolve_model when the normalized model_variant is not a key of MODEL_IDS ({'2.5', 'standard', 'fast', 'mini'}). The variant selects the default Ark model ID and the reference/duration limits, so an unknown value cannot be mapped. Comparison is case-insensitive after str().lower().","triggerScenarios":"model_variant of 'pro', '2.0', 'lite', '', or any string outside the four accepted keys (case is ignored, so 'FAST' is fine).","commonSituations":"Carrying a variant name from another provider's SDK; passing an empty variant that skips the default; version drift after a new variant was added upstream but not in this code.","solutions":["Set model_variant to one of '2.5', 'standard', 'fast', 'mini' (case-insensitive)","Omit model_variant to default to 'standard'","Set an explicit model ID (or ARK_SEEDANCE_MODEL) if you need a custom endpoint, while keeping a valid variant"],"exampleFix":"# before\ninputs = {\"model_variant\": \"pro\"}\n\n# after\ninputs = {\"model_variant\": \"standard\"}","handlingStrategy":"validation","validationCode":"VARIANTS = {\"2.5\", \"standard\", \"fast\", \"mini\"}\nvariant = str(inputs.get(\"model_variant\", \"standard\")).lower()\nif variant not in VARIANTS:\n    inputs[\"model_variant\"] = \"standard\"  # or raise early with context","typeGuard":"def is_valid_variant(variant: str) -> bool:\n    return str(variant).lower() in {\"2.5\", \"standard\", \"fast\", \"mini\"}","tryCatchPattern":null,"preventionTips":["Validate variant against the accepted set at config load time","Keep variant names in one constants module shared by caller and tool"],"tags":["validation","seedance","ark","model-variant","config"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}