{"record":{"id":"7387d7f1b6004aef","repo":"BerriAI/litellm","slug":"bedrock-batch-embedding-requires-one-input-per-jso","errorCode":null,"errorMessage":"Bedrock batch embedding requires one input per JSONL record. Got a list with {len(raw_input)} items for model={model}; emit one JSONL line per input string instead.","messagePattern":"Bedrock batch embedding requires one input per JSONL record\\. Got a list with (.+?) items for model=(.+?); emit one JSONL line per input string instead\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":618,"sourceCode":"          - Pre-tokenized inputs (List[int], List[List[int]]) -> NotImplementedError\n          - Any other type -> ValueError\n\n        Extracted so the validation can be exercised in isolation and so\n        future embedding-provider branches (Titan G1, Cohere) can reuse it\n        without duplicating the type-shaping logic.\n        \"\"\"\n        if raw_input is None:\n            raise ValueError(f\"Embedding batch record is missing required `input` field: model={model}\")\n\n        # Bedrock InvokeModel for Titan v2 takes exactly one string `inputText`\n        # per call. Pre-tokenized inputs and multi-element string lists are\n        # explicitly unsupported so callers emit one JSONL line per embedding\n        # instead of relying on us to silently fan out or concatenate.\n        if isinstance(raw_input, list):\n            if len(raw_input) == 1:\n                candidate = raw_input[0]\n            else:\n                raise ValueError(\n                    \"Bedrock batch embedding requires one input per JSONL \"\n                    \"record. Got a list with \"\n                    f\"{len(raw_input)} items for model={model}; emit one \"\n                    \"JSONL line per input string instead.\"\n                )\n        else:\n            candidate = raw_input\n\n        # Catches pre-tokenized inputs (List[int] from OpenAI spec, or a\n        # single int slipping past the list-unwrap above).\n        # NOTE: bool is a subclass of int but treating True/False as a token\n        # is meaningless either way, so the broad check is fine.\n        if isinstance(candidate, (list, int)):\n            raise NotImplementedError(\n                \"Bedrock Titan v2 batch embedding does not support \"\n                \"pre-tokenized integer inputs. Pass `input` as a string \"\n                f\"(model={model}).\"\n            )","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/files/transformation.py#L600-L636","documentation":"Shape guard for batch embeddings: the record's 'input' is a multi-element list, but Bedrock InvokeModel for Titan v2 accepts exactly one string per call, so the caller must emit one JSONL line per input string.","triggerScenarios":"Thrown at litellm/llms/bedrock/files/transformation.py:618 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit one JSONL line per input string instead of a list of inputs.","Split multi-input records into separate batch records.","Check the batch file generation logic for batching of inputs."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}