[Bug]: LlamaParse - Inconsistent number of documents being produced after parsing with gpt-4o enabled #176

Open
opened 2026-02-16 00:17:03 -05:00 by yindo · 0 comments
Owner

Originally created by @dychen1 on GitHub (Jul 9, 2024).

Bug Description

LlamaParse returns incorrect (and inconsistent) number of pages when trying to parse a PDF with gpt-4o mode on.

There are 11 pages in this sample.pdf. When I run

api_key = xx
openai_api_key = yy
file =  _path_to_file_

parser = LlamaParse(
    api_key=api_key, 
    result_type="markdown",
    gpt4o_mode=True,
    gpt4o_api_key=openai_api_key,
    do_not_cache=True,
    invalidate_cache=True,
    split_by_page=True
)

docs = await parser.aload_data(file)

After running this snippet a number of times, the number of documents that is returned ranges between 12-15, unfortunately not 11.
It is equally surprising that the number of documents returned, which is meant to represent each page to my understanding, is not consistent between runs.

Versions:

llama-parse = "^0.4.5"
llama-index-core = "^0.10.52.post2"

Relevant Logs

Started parsing the file under job_id ea188470-7b34-43e3-9354-23c53d729997 - 15 documents returned

Started parsing the file under job_id 14978390-52aa-473d-b104-dc0b68e7340c - 14 documents returned 

Started parsing the file under job_id 153dbc8d-7000-4083-9354-da34c583f980 - 13 documents returned
Originally created by @dychen1 on GitHub (Jul 9, 2024). ### Bug Description LlamaParse returns incorrect (and inconsistent) number of pages when trying to parse a PDF with gpt-4o mode on. There are 11 pages in this [sample.pdf](https://github.com/user-attachments/files/16150434/01.18.2024.Ad.Hoc.IC.Meeting.Book_Public.Version.w_page.pdf). When I run ``` api_key = xx openai_api_key = yy file = _path_to_file_ parser = LlamaParse( api_key=api_key, result_type="markdown", gpt4o_mode=True, gpt4o_api_key=openai_api_key, do_not_cache=True, invalidate_cache=True, split_by_page=True ) docs = await parser.aload_data(file) ``` After running this snippet a number of times, the number of documents that is returned ranges between 12-15, unfortunately not 11. It is equally surprising that the number of documents returned, which is meant to represent each page to my understanding, is not consistent between runs. ### Versions: llama-parse = "^0.4.5" llama-index-core = "^0.10.52.post2" ### Relevant Logs ``` Started parsing the file under job_id ea188470-7b34-43e3-9354-23c53d729997 - 15 documents returned Started parsing the file under job_id 14978390-52aa-473d-b104-dc0b68e7340c - 14 documents returned Started parsing the file under job_id 153dbc8d-7000-4083-9354-da34c583f980 - 13 documents returned ```
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#176