BerriAI/litellm · error · ValueError

Invalid 'bedrock_tags' value. Expected a list of {'key': <st

Error message

Invalid 'bedrock_tags' value. Expected a list of {'key': <str>, 'value': <str>} dicts, e.g. [{'key': 'team', 'value': 'genai'}]. Got: {raw_tags!r}

What it means

Error "Invalid 'bedrock_tags' value. Expected a list of {'key': <str>, 'value': <str>} dicts, e.g. [{'key': 'team', 'value': 'genai'}]. Got: {raw_tags!r}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/bedrock/batches/transformation.py:53

)

# Bedrock batch input files are uploaded as
# s3://bucket/litellm-bedrock-files-{model, ":" -> "-"}-{uuid4}.jsonl (see
# BedrockFilesTransformation._get_s3_object_name). A uuid4 is always 36 hex/dash
# characters, so it can be stripped off the end unambiguously even though the
# model name itself may contain dashes.
_S3_BATCH_FILE_UUID_SUFFIX_PATTERN: Final = re.compile(
    r"-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\.jsonl$"
)

_BEDROCK_TAGS_ADAPTER: Final[TypeAdapter[list[BedrockTag]]] = TypeAdapter(list[BedrockTag])


def _validate_bedrock_tags(raw_tags: object) -> list[BedrockTag]:
    try:
        return _BEDROCK_TAGS_ADAPTER.validate_python(raw_tags, strict=True)
    except ValidationError as e:
        raise ValueError(
            "Invalid 'bedrock_tags' value. Expected a list of {'key': <str>, 'value': <str>} dicts, "
            f"e.g. [{{'key': 'team', 'value': 'genai'}}]. Got: {raw_tags!r}"
        ) from e


class BedrockBatchesConfig(BaseAWSLLM, BaseBatchesConfig):
    """
    Config for Bedrock Batches - handles batch job creation and management for Bedrock
    """

    def __init__(self):
        super().__init__()
        self.common_utils = CommonBatchFilesUtils()

    @property
    def custom_llm_provider(self) -> LlmProviders:
        return LlmProviders.BEDROCK

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Pass bedrock_tags as a list of {'key': str, 'value': str} dicts.

When it happens

Trigger: Thrown at litellm/llms/bedrock/batches/transformation.py:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/2da71e79c4e06625. Report an issue: GitHub.