Bounding box error with Llamaparse #557

Closed
opened 2026-02-16 00:18:15 -05:00 by yindo · 4 comments
Owner

Originally created by @arsentievalex on GitHub (Oct 11, 2025).

Describe the bug
I'm trying to parse a pdf with Python code calling LlamaParse (code snippet taken from the LlamaCloud). The code returns this error below. When I go to LlamaCloud I see that the document was parsed successfully, however the script returns the error. Looks like the error is due to None values for bounding box coordinates on some pages, which causes Pydantic validation to fail.

.Traceback (most recent call last):
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/main.py", line 40, in <module>
    result = parser.parse("sample_report.pdf")
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/base.py", line 1490, in parse
    return asyncio_run(self.aparse(file_path, extra_info, fs=fs))
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_index/core/async_utils.py", line 52, in asyncio_run
    return loop.run_until_complete(coro)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/base.py", line 1422, in aparse
    result = await self._aparse_one(
             ^^^^^^^^^^^^^^^^^^^^^^^
        file_path, file_name, extra_info=extra_info, fs=fs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/base.py", line 1380, in _aparse_one
    JobResult(
    ~~~~~~~~~^
        job_id=job_id,
        ^^^^^^^^^^^^^^
    ...<5 lines>...
        page_separator=self.page_separator or _DEFAULT_SEPARATOR,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/types.py", line 208, in __init__
    super().__init__(job_id=job_id, file_name=file_name, **job_result)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/pydantic/main.py", line 250, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 108 validation errors for JobResult
pages.6.items.0.bBox.x
  Input should be a valid number [type=float_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.12/v/float_type
pages.6.items.0.bBox.y
  Input should be a valid number [type=float_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.12/v/float_type
pages.6.items.0.bBox.w

Files
Can't provide PDF example due to PII (see job iD)

Job ID
a4f857f7-bd83-4f27-b19b-ebd76f0e22b6

Client:
Please remove untested options:

  • Python Library
  • API
  • Frontend (cloud.llamaindex.ai)

Additional context
I'm using the below code:

parser = LlamaParse(

  # Load LlamaParse API key from .env file
  api_key=os.getenv("LLAMAPARSE_API_KEY"),

  # The parsing mode
  parse_mode="parse_page_with_agent",

  # The model to use
  model="openai-gpt-4-1-mini",

  # Whether to use high resolution OCR (Slow)
  high_res_ocr=True,

  # Adaptive long table. LlamaParse will try to detect long table and adapt the output
  adaptive_long_table=True,

  # Whether to try to extract outlined tables
  outlined_table_extraction=True,

  # Whether to output tables as HTML in the markdown output
  output_tables_as_HTML=True,

  # The maximum number of pages to parse
  max_pages=20,

  # The page separator
  page_separator="\n\n---\n\n",
)


# Parse the PDF
result = parser.parse("sample_report.pdf")

# Get markdown documents, one per page
markdown_documents = result.get_markdown_documents(split_by_page=True)
Originally created by @arsentievalex on GitHub (Oct 11, 2025). **Describe the bug** I'm trying to parse a pdf with Python code calling LlamaParse (code snippet taken from the LlamaCloud). The code returns this error below. When I go to LlamaCloud I see that the document was parsed successfully, however the script returns the error. Looks like the error is due to None values for bounding box coordinates on some pages, which causes Pydantic validation to fail. ``` .Traceback (most recent call last): File "/Users/olek.arsentiev/Documents/fcc-qa-agents/main.py", line 40, in <module> result = parser.parse("sample_report.pdf") File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/base.py", line 1490, in parse return asyncio_run(self.aparse(file_path, extra_info, fs=fs)) File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_index/core/async_utils.py", line 52, in asyncio_run return loop.run_until_complete(coro) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/base.py", line 1422, in aparse result = await self._aparse_one( ^^^^^^^^^^^^^^^^^^^^^^^ file_path, file_name, extra_info=extra_info, fs=fs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/base.py", line 1380, in _aparse_one JobResult( ~~~~~~~~~^ job_id=job_id, ^^^^^^^^^^^^^^ ...<5 lines>... page_separator=self.page_separator or _DEFAULT_SEPARATOR, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/llama_cloud_services/parse/types.py", line 208, in __init__ super().__init__(job_id=job_id, file_name=file_name, **job_result) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/olek.arsentiev/Documents/fcc-qa-agents/.venv/lib/python3.13/site-packages/pydantic/main.py", line 250, in __init__ validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) pydantic_core._pydantic_core.ValidationError: 108 validation errors for JobResult pages.6.items.0.bBox.x Input should be a valid number [type=float_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.12/v/float_type pages.6.items.0.bBox.y Input should be a valid number [type=float_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.12/v/float_type pages.6.items.0.bBox.w ``` **Files** Can't provide PDF example due to PII (see job iD) **Job ID** a4f857f7-bd83-4f27-b19b-ebd76f0e22b6 **Client:** Please remove untested options: - Python Library - API - Frontend (cloud.llamaindex.ai) **Additional context** I'm using the below code: ``` parser = LlamaParse( # Load LlamaParse API key from .env file api_key=os.getenv("LLAMAPARSE_API_KEY"), # The parsing mode parse_mode="parse_page_with_agent", # The model to use model="openai-gpt-4-1-mini", # Whether to use high resolution OCR (Slow) high_res_ocr=True, # Adaptive long table. LlamaParse will try to detect long table and adapt the output adaptive_long_table=True, # Whether to try to extract outlined tables outlined_table_extraction=True, # Whether to output tables as HTML in the markdown output output_tables_as_HTML=True, # The maximum number of pages to parse max_pages=20, # The page separator page_separator="\n\n---\n\n", ) # Parse the PDF result = parser.parse("sample_report.pdf") # Get markdown documents, one per page markdown_documents = result.get_markdown_documents(split_by_page=True) ```
yindo added the bug label 2026-02-16 00:18:15 -05:00
yindo closed this issue 2026-02-16 00:18:15 -05:00
Author
Owner

@logan-markewich commented on GitHub (Oct 11, 2025):

Yet another field to mark as optional

@logan-markewich commented on GitHub (Oct 11, 2025): Yet another field to mark as optional
Author
Owner

@arsentievalex commented on GitHub (Oct 11, 2025):

@logan-markewich is it something that I can do or should be done in the library?

@arsentievalex commented on GitHub (Oct 11, 2025): @logan-markewich is it something that I can do or should be done in the library?
Author
Owner

@logan-markewich commented on GitHub (Oct 12, 2025):

It's just a PR here to the pydantic types

@logan-markewich commented on GitHub (Oct 12, 2025): It's just a PR here to the pydantic types
Author
Owner

@logan-markewich commented on GitHub (Oct 14, 2025):

Fixed in llama cloud services 0.6.74

@logan-markewich commented on GitHub (Oct 14, 2025): Fixed in llama cloud services 0.6.74
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#557