BerriAI/litellm · error · ValueError

No text content could be extracted from the file for embeddi

Error message

No text content could be extracted from the file for embedding. Possible causes:
  1. PDF files require OCR - add 'ocr' config with a vision model (e.g., 'anthropic/claude-3-5-sonnet-20241022')
  2. Binary files cannot be processed - convert to text first
  3. File is empty or contains no extractable text
For PDFs, either enable OCR or use a PDF extraction library to convert to text before ingestion.

What it means

Error "No text content could be extracted from the file for embedding. Possible causes: 1. PDF files require OCR - add 'ocr' config with a vision model (e.g., 'anthropic/claude-3-5-sonnet-20241022') 2. Binary files cannot be processed - convert to text first 3. File is empty or contains no extractable text For PDFs, either enable OCR or use a PDF extraction library to convert to text before ingestion." thrown in BerriAI/litellm.

Source

Thrown at litellm/rag/ingestion/s3_vectors_ingestion.py:468

            existing_file_id: Existing provider file ID, unsupported for S3 Vectors

        Returns:
            Tuple of (index_name, filename)
        """
        # Ensure infrastructure exists
        await self._ensure_config_initialized()

        if not embeddings or not chunks:
            error_msg: Final = (
                "No text content could be extracted from the file for embedding. "
                "Possible causes:\n"
                "  1. PDF files require OCR - add 'ocr' config with a vision model (e.g., 'anthropic/claude-3-5-sonnet-20241022')\n"
                "  2. Binary files cannot be processed - convert to text first\n"
                "  3. File is empty or contains no extractable text\n"
                "For PDFs, either enable OCR or use a PDF extraction library to convert to text before ingestion."
            )
            verbose_logger.error(error_msg)
            raise ValueError(error_msg)

        # Prepare vectors for PutVectors API
        vectors: Final = [
            S3VectorEntry(
                key=f"{filename}_{i}" if filename else f"chunk_{i}",
                data=S3VectorDataPayload(float32=embedding),
                metadata=(
                    {"source_text": chunk, "chunk_index": str(i), "filename": filename}
                    if filename
                    else {"source_text": chunk, "chunk_index": str(i)}
                ),
            )
            for i, (chunk, embedding) in enumerate(zip(chunks, embeddings))
        ]

        # Call PutVectors API
        await self._put_vectors(vectors)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. For PDFs, add an 'ocr' config with a vision model, or convert the file to text before ingestion.
  2. Verify the file is non-empty and contains extractable text.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/rag/ingestion/s3_vectors_ingestion.py:468 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/e4f6aa43ed3e9eed. Report an issue: GitHub.