⚡ Bolt: [performance improvement] Prevent LLM API rate limits during parallel extraction#67
Conversation
…parallel extraction
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Added concurrency control using `asyncio.Semaphore(5)` to bound the number of concurrent LLM calls during batched extractions in `_node_extract_profile`, `_node_extract_temporal`, `_node_extract_code`, and `_node_extract_snippet`.
🎯 Why: While `asyncio.gather` was used to parallelize sub-queries across the LLM, doing so unbounded could cause API rate limiting errors when a user query generates a large number of profile/temporal/code/snippet sub-queries. Bounding concurrency balances throughput and stability.
📊 Measured Improvement: The underlying performance logic (using `asyncio.gather`) is preserved and effectively optimized by preventing failures under heavy load. A benchmark simulating network API latency showed no degradation for small sets of queries, while effectively capping concurrency at 5 requests at a time to keep it robust against rate limit crashes.
PR created automatically by Jules for task 8918555165628498996 started by @ishaanxgupta