Adaptive concurrency through llmgate's limiter; parallel documents and page batches (HAL-1372) - #65
Conversation
…, parallel documents and page batches
HAL-1372, engine half. llmgate v0.5.0's limit middleware wraps the chat
client and the Judge in cmd/server and cmd/engine, inside retry, with
every change logged: a throttled run is visible, never silent. Config
llm.concurrency {initial, max}; llmgate's defaults (4, 64) otherwise.
judgewalk's page-ranking batches are built first and sent at once;
the limiter, not a loop, decides how many are in flight. tocdump and
navbench take -parallel N for documents and questions respectively,
all through one shared limiter per run.
|
Navigation at parallel=4: 258 s wall for 40 questions (sequential 824 s, 3.2×), limiter 4 → 12, zero 429s; 33/40 every-gold-page (34/40 sequential — one question flipped, within run-to-run noise), 37/40 right section, 4.0 requests and $0.0029 per question. |
Reviewer's GuideThis PR upgrades the engine to llmgate’s adaptive limiter, applies separate logged limits to chat and Judge traffic inside retry, and uses bounded parallelism for document processing, navigation questions, and independent page-ranking batches so provider capacity—not a fixed concurrency guess—controls throughput. Sequence diagram for bounded parallel document processingsequenceDiagram
participant User
participant TOCDump
participant Workers as Document workers
participant Limiter as Adaptive limiter
participant Provider as LLM provider
User->>TOCDump: run with -parallel N
TOCDump->>Workers: start documents with bounded concurrency
Workers->>Limiter: Build document TOC requests
Limiter->>Provider: admit requests up to current limit
Provider-->>Limiter: success or 429/transport failure
Limiter-->>Workers: widen or narrow capacity
Workers-->>TOCDump: write document results
TOCDump-->>User: report wall time and limiter limit
Sequence diagram for parallel navigation and page-ranking batchessequenceDiagram
participant NavBench
participant Navigator as JudgeNavigator
participant Limiter as Shared Judge limiter
participant Judge
participant Provider as LLM provider
NavBench->>Navigator: Navigate questions concurrently
Navigator->>Navigator: Build independent page-ranking batches
par Each ranking batch
Navigator->>Limiter: Judge batch request
Limiter->>Judge: admit request
Judge->>Provider: send batch
Provider-->>Judge: ranking response
Judge-->>Limiter: success or failure
end
Limiter-->>Navigator: adapt concurrency from outcomes
Navigator-->>NavBench: return selected pages and evidence
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes HAL-1372 (engine half; llmgate v0.5.0 carries the limiter).
limit.Client/limit.Judgewrap the chat client and the Judge in both binaries, inside retry, every change logged. Configllm.concurrency {initial, max}.judgewalksends its page-ranking batches at once;tocdump -parallel Nandnavbench -parallel Nrun documents and questions concurrently through one shared limiter.Measured, no rate limits hit in either run, the limiter widening itself on success:
Per-request latency rises under load (9.5 → 21 s per filing), so the gain is 1.6×, not 8× — the provider's capacity, observed rather than guessed, is now the limit.
Summary by Sourcery
Enable adaptive, provider-aware concurrency across document ingestion and navigation to improve throughput without exceeding provider capacity.
New Features:
tocdumpand parallel question processing innavbench.Enhancements:
Build:
Documentation:
Tests:
Summary by CodeRabbit
New Features
Performance
Reliability