BerriAI/litellm · error · Exception

Prop ` ` is not supported

Error message

Prop `{type}` is not supported

What it means

During Bytez content-part normalization, the part's type is looked up in open_ai_to_bytez_content_item_map; types mapped to None ('document' and 'file') are deliberately unsupported and raise this Exception. Note a type entirely absent from the map (e.g. 'audio') instead raises a bare KeyError before this check — a rough edge in the same code path.

Solutions

  1. Strip document/file parts from messages before routing to bytez models (or route those requests to a provider that supports them).
  2. If the content is text inside the document, extract and send it as a {"type": "text"} part.
  3. Watch for the related KeyError variant when a type is misspelled — fix the type string.

Example fix

# before
messages = [{
    "role": "user",
    "content": [
        {"type": "document", "document": {"file_id": "abc"}},  # unsupported on Bytez
        {"type": "text", "text": "summarize this"},
    ],
}]

# after
messages = [{
    "role": "user",
    "content": [{"type": "text", "text": extracted_document_text}],
}]
Defensive patterns

Strategy: validation

Validate before calling

BYTEZ_OK_TYPES = {"text", "image_url", "input_audio", "video_url"}

def strip_unsupported_parts(messages: list) -> list:
    return [
        {
            "role": m["role"],
            "content": [p for p in m["content"] if p.get("type") in BYTEZ_OK_TYPES],
        }
        if isinstance(m.get("content"), list)
        else m
        for m in messages
    ]

Type guard

BYTEZ_SUPPORTED_PART_TYPES = {"text", "image_url", "input_audio", "video_url"}

def is_bytez_supported_part(part: object) -> bool:
    return (
        isinstance(part, dict)
        and part.get("type") in BYTEZ_SUPPORTED_PART_TYPES
    )

Try / catch

try:
    litellm.completion(model="bytez/org/model", messages=messages)
except Exception as e:
    if "is not supported" in str(e):
        litellm.completion(model="bytez/org/model", messages=strip_unsupported_parts(messages))
    else:
        raise

Prevention

When it happens

Trigger: Sending a message containing a document or file content part (e.g. {"type": "document", ...} or {"type": "file", ...}) to a bytez model; using an assistant/tooling pipeline that attaches PDFs or files to multimodal messages.

Common situations: Porting multimodal workflows from providers that do support documents/files; agent frameworks attaching file artifacts uniformly across models; expecting OpenAI-compatible file handling on bytez.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/089f48d39a585632. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/bytez/chat/transformation.py:398

    new_messages: Final = []

    for message in messages:
        role = message["role"]
        content: list = message["content"]

        new_content = []

        for content_item in content:
            type: str | None = content_item.get("type")

            if not type:
                raise Exception("Prop `type` is not a string")

            content_item_map = open_ai_to_bytez_content_item_map[type]

            if not content_item_map:
                raise Exception(f"Prop `{type}` is not supported")

            new_type = content_item_map["type"]

            value_name = content_item_map["value_name"]

            value: str | None = content_item.get(value_name)

            if not value:
                raise Exception(f"Prop `{value_name}` is not a string")

            new_content.append({"type": new_type, value_name: value})

        new_messages.append({"role": role, "content": new_content})

    return new_messages


# "content": "The cat ran so fast"

View on GitHub (pinned to 77b7c6c40c)