[PR #708] [MERGED] parse: fix num_workers/parse job batching #822

Closed
opened 2026-02-16 00:19:12 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_cloud_services/pull/708
Author: @pmrowla
Created: 5/1/2025
Status: Merged
Merged: 5/1/2025
Merged by: @logan-markewich

Base: mainHead: fix-num-workers


📝 Commits (2)

  • 2be786b parse: fix num_workers/parse job batching
  • ba9b4bf bump num_workers max to 20

📊 Changes

1 file changed (+39 additions, -42 deletions)

View changed files

📝 llama_cloud_services/parse/base.py (+39 -42)

📄 Description

  • Fixes bug where num_workers was not respected when parsing multiple files

To reproduce:

parser = LlamaParse(
    api_key=API_KEY,
    num_workers=1,
)
files = ["./TOS.pdf"] * 10
result = parser.parse(files)

In this case, 10 concurrent parse jobs would be created via the API, and then they are awaited in the Python SDK in batches of 1 (num_workers) at a time. After this fix, only up to num_workers concurrent parse jobs will be created in the backend at a time.

This issue did not affect all LlamaParse methods (batching worked properly in cases where parser.aget_json() was used). This PR refactors behavior to be consistent for all parser methods.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_cloud_services/pull/708 **Author:** [@pmrowla](https://github.com/pmrowla) **Created:** 5/1/2025 **Status:** ✅ Merged **Merged:** 5/1/2025 **Merged by:** [@logan-markewich](https://github.com/logan-markewich) **Base:** `main` ← **Head:** `fix-num-workers` --- ### 📝 Commits (2) - [`2be786b`](https://github.com/run-llama/llama_cloud_services/commit/2be786b9d6f677e06eb620ffb5272782ae1dc066) parse: fix num_workers/parse job batching - [`ba9b4bf`](https://github.com/run-llama/llama_cloud_services/commit/ba9b4bf828da2ebda38570d02ef6d646e769cce4) bump num_workers max to 20 ### 📊 Changes **1 file changed** (+39 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `llama_cloud_services/parse/base.py` (+39 -42) </details> ### 📄 Description - Fixes bug where `num_workers` was not respected when parsing multiple files To reproduce: ```py parser = LlamaParse( api_key=API_KEY, num_workers=1, ) files = ["./TOS.pdf"] * 10 result = parser.parse(files) ``` In this case, 10 concurrent parse jobs would be created via the API, and then they are awaited in the Python SDK in batches of 1 (`num_workers`) at a time. After this fix, only up to `num_workers` concurrent parse jobs will be created in the backend at a time. This issue did not affect all `LlamaParse` methods (batching worked properly in cases where `parser.aget_json()` was used). This PR refactors behavior to be consistent for all parser methods. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 00:19:12 -05:00
yindo closed this issue 2026-02-16 00:19:13 -05:00
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#822