BerriAI/litellm · error · OCIError

OCI embedText accepts at most

Error message

OCI embedText accepts at most {OCI_EMBED_BATCH_LIMIT} inputs per request (got {len(texts)}). Batch your requests.

What it means

Error "OCI embedText accepts at most {OCI_EMBED_BATCH_LIMIT} inputs per request (got {len(texts)}). Batch your requests." thrown in BerriAI/litellm.

Solutions

  1. Split the input into batches of at most the limit shown in the message and issue multiple embedding requests.

When it happens

Trigger: Thrown at litellm/llms/oci/embed/transformation.py:212 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at litellm/llms/oci/embed/transformation.py:212

        if isinstance(input, str):
            texts = [input]
        elif isinstance(input, list):
            texts = []
            for item in input:
                if isinstance(item, list):
                    raise OCIError(
                        status_code=400,
                        message=(
                            "OCI embedText does not support token-array inputs. "
                            "Convert token lists to strings before calling embedding()."
                        ),
                    )
                texts.append(item if isinstance(item, str) else str(item))
        else:
            texts = [str(input)]

        if len(texts) > OCI_EMBED_BATCH_LIMIT:
            raise OCIError(
                status_code=400,
                message=(
                    f"OCI embedText accepts at most {OCI_EMBED_BATCH_LIMIT} inputs per request "
                    f"(got {len(texts)}). Batch your requests."
                ),
            )

        serving_mode_type: Final = optional_params.get("oci_serving_mode", "ON_DEMAND").upper()
        if serving_mode_type not in {"ON_DEMAND", "DEDICATED"}:
            raise OCIError(
                status_code=400,
                message="oci_serving_mode must be 'ON_DEMAND' or 'DEDICATED'.",
            )

        if serving_mode_type == "DEDICATED":
            endpoint_id: Final = optional_params.get("oci_endpoint_id", model)
            serving_mode = OCIServingMode(servingType="DEDICATED", endpointId=endpoint_id)
        else:

View on GitHub (pinned to 77b7c6c40c)