BerriAI/litellm · error · OCIError

Failed to parse OCI embed response as JSON

Error message

Failed to parse OCI embed response as JSON: {e}

What it means

Error "Failed to parse OCI embed response as JSON: {e}" thrown in BerriAI/litellm.

Solutions

  1. Log the raw OCI embed response; handle non-JSON bodies and check the wrapped parse error {e}.

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

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

        model: str,
        raw_response: httpx.Response,
        model_response: EmbeddingResponse,
        logging_obj: LiteLLMLoggingObj,
        api_key: str | None,
        request_data: dict,
        optional_params: dict,
        litellm_params: dict,
    ) -> EmbeddingResponse:
        if raw_response.status_code != 200:
            raise OCIError(
                status_code=raw_response.status_code,
                message=raw_response.text,
            )

        try:
            json_response: Final = raw_response.json()
        except Exception as e:
            raise OCIError(
                status_code=raw_response.status_code,
                message=f"Failed to parse OCI embed response as JSON: {e}",
            )

        try:
            parsed: Final = OCIEmbedResponse(**json_response)
        except Exception as e:
            raise OCIError(
                status_code=500,
                message=f"OCI embed response does not match expected schema: {e}",
            )

        model_response.model = parsed.modelId
        model_response.data = [
            {
                "object": "embedding",
                "index": i,
                "embedding": embedding,

View on GitHub (pinned to 77b7c6c40c)