{"record":{"id":"1d6f9eeee02989de","repo":"BerriAI/litellm","slug":"input-type-input-type-requires-async-invoke-ro","errorCode":null,"errorMessage":"Input type '{input_type}' requires async_invoke route. Use model format: 'bedrock/async_invoke/model_id'","messagePattern":"Input type '(.+?)' requires async_invoke route\\. Use model format: 'bedrock/async_invoke/model_id'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/embed/twelvelabs_marengo_transformation.py","lineNumber":99,"sourceCode":"        \"\"\"\n        Transform OpenAI-style input to TwelveLabs Marengo format/async-invoke format.\n\n        Supports:\n        - Text inputs (for both invoke and async-invoke)\n        - Image inputs (for both invoke and async-invoke)\n        - Video inputs (async-invoke only)\n        - Audio inputs (async-invoke only)\n        - S3 URLs for all media types (async-invoke only)\n        \"\"\"\n        # Get input_type or default to \"text\"\n        input_type: Final = cast(\n            TWELVELABS_EMBEDDING_INPUT_TYPES,\n            inference_params.get(\"inputType\") or inference_params.get(\"input_type\") or \"text\",\n        )\n\n        # Validate that async-invoke is used for video/audio\n        if input_type in [\"video\", \"audio\"] and not async_invoke_route:\n            raise ValueError(\n                f\"Input type '{input_type}' requires async_invoke route. \"\n                f\"Use model format: 'bedrock/async_invoke/model_id'\"\n            )\n\n        transformed_request: Final[TwelveLabsMarengoEmbeddingRequest] = {\"inputType\": input_type}\n\n        if input_type == \"text\":\n            transformed_request[\"inputText\"] = input\n            # Set default textTruncate if not specified\n            if \"textTruncate\" not in inference_params:\n                transformed_request[\"textTruncate\"] = \"end\"\n\n        elif input_type in [\"image\", \"video\", \"audio\"]:\n            if self._is_s3_url(input):\n                # S3 URL input\n                s3_location: Final[TwelveLabsS3Location] = {\"uri\": input}\n                bucket_owner: Final = self._extract_bucket_owner_from_params(inference_params)\n                if bucket_owner:","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/embed/twelvelabs_marengo_transformation.py#L81-L117","documentation":"TwelveLabs Marengo embedding transformations accept video/audio (and S3-URL media) inputs only through Bedrock's asynchronous invoke route. _transform_request checks inputType and refuses video/audio when the model string does not carry the 'async_invoke/' prefix, because the synchronous invoke endpoint cannot process them.","triggerScenarios":"Calling litellm.embedding(model='bedrock/twelvelabs.marengo-embed-2.7', input=..., input_type='video') without the async route prefix; likewise for input_type='audio' or S3 media URLs passed on the sync path.","commonSituations":"Copying the sync text-embedding call shape and only switching inputType to video/audio; forgetting that the async route is opt-in via model string, not a parameter.","solutions":["Prefix the model with the async route: 'bedrock/async_invoke/twelvelabs.marengo-embed-2.7'.","For text embeddings, keep input_type='text' (or omit it) on the normal model string.","Provide output_s3_uri when using the async route (see error 1271)."],"exampleFix":"# before\nlitellm.embedding(model=\"bedrock/twelvelabs.marengo-embed-2.7\", input=[video_url], input_type=\"video\")\n\n# after\nlitellm.embedding(\n    model=\"bedrock/async_invoke/twelvelabs.marengo-embed-2.7\",\n    input=[video_url],\n    input_type=\"video\",\n    output_s3_uri=\"s3://my-bucket/out/\",\n)","handlingStrategy":"validation","validationCode":"def validate_marengo_call(model: str, input_type: str | None):\n    it = input_type or \"text\"\n    if it in (\"video\", \"audio\") and not model.startswith(\"bedrock/async_invoke/\"):\n        raise ValueError(f\"{it} requires bedrock/async_invoke/ model prefix\")","typeGuard":"def needs_async_route(input_type: str | None) -> bool:\n    return (input_type or \"text\") in (\"video\", \"audio\")","tryCatchPattern":null,"preventionTips":["Wrap TwelveLabs calls in a helper that derives the route from input_type.","Keep S3 media URLs on the async_invoke route only."],"tags":["bedrock","twelvelabs","embedding","async-invoke","validation"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}