Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to "batch LLM requests", "should I use the batch API", "estimate batch vs realtime cost", "design a bulk LLM job", or "process thousands of prompts cheaply".
.claude/skills/borghei-batch-api-orchestrator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-05 | ✓→✗ | ▼ Worse | 60% | 0% |
> Category: Engineering > Domain: AI Engineering
Decide when to run LLM work through an asynchronous batch API versus realtime/streaming, then design the job so it is cheap, idempotent, and resilient to partial failure. Batch APIs typically cost roughly half of realtime in exchange for higher latency (results arrive over minutes to hours, not milliseconds), which makes them ideal for evals, backfills, embeddings, and bulk classification/extraction — and wrong for anything a human is waiting on. This skill is model- and vendor-agnostic: it reasons about the batch pattern, not any one provider's API.
Before recommending or designing a batch job, confirm these inputs. If any is unknown or vague, ASK — do not assume:
--latency-tolerance and the batch-vs-realtime verdict)--requests, --avg-input-tokens, --avg-output-tokens for the cost estimate)--realtime-input-price, --realtime-output-price, --batch-discount; defaults are neutral placeholders, not real prices)Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions.
bashcd engineering/batch-api-orchestrator # 1. Should this be batch or realtime, and what does it cost? python scripts/batch_cost_estimator.py \ --requests 50000 --avg-input-tokens 800 --avg-output-tokens 200 \ --realtime-input-price 3.0 --realtime-output-price 15.0 \ --batch-discount 0.5 --latency-tolerance hours # 2. Plan the chunking / idempotency / retry strategy for the job python scripts/batch_job_planner.py \ --total-items 50000 --max-batch-size 10000 --retry-policy exponential --json
| Tool | Purpose | Key Flags | |------|---------|-----------| | scripts/batch_cost_estimator.py | Compare realtime vs batch cost, show savings, and recommend batch or realtime given latency tolerance | --requests, --avg-input-tokens, --avg-output-tokens, --realtime-input-price, --realtime-output-price, --batch-discount, --latency-tolerance, --json | | scripts/batch_job_planner.py | Produce a chunking + idempotency + partial-failure plan for a bulk job | --total-items, --max-batch-size, --retry-policy, --max-retries, --json |
Both scripts: Python 3 standard library only, argparse CLI, --json and human-readable output. Run --help for full usage.
--requests, --avg-input-tokens, --avg-output-tokens).batch_cost_estimator.py with the real --latency-tolerance (realtime, minutes, or hours).references/batch-patterns-and-decision-tree.md.batch_job_planner.py with --total-items, --max-batch-size, and a --retry-policy.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | pass→pass | 13,426 | 8,732 | -35% | 1 | 1 | 0% | 2,387 | 2,800 | +17% | 0 | 0 | — |
case-08 | pass→pass | 12,278 | 7,592 | -38% | 1 | 1 | 0% | 1,998 | 2,649 | +33% | 0 | 0 | — |
case-01 | fail→fail | 17,820 | 22,247 | +25% | 1 | 1 | 0% | 3,788 | 4,973 | +31% | 0 | 0 | — |
case-09 | pass→pass | 18,774 | 17,187 | -8% | 1 | 1 | 0% | 3,059 | 4,370 | +43% | 0 | 0 | — |
case-02 | fail→fail | 26,022 | 6,323 | -76% | 1 | 1 | 0% | 4,629 | 1,807 | -61% | 0 | 0 | — |
case-03 | fail→fail | 23,522 | 8,131 | -65% | 1 | 1 | 0% | 4,337 | 1,816 | -58% | 0 | 0 | — |
case-04 | pass→pass | 23,343 | 14,598 | -37% | 1 | 1 | 0% | 4,221 | 4,115 | -3% | 0 | 0 | — |
case-05 | pass→fail | 16,261 | 16,745 | +3% | 1 | 1 | 0% | 2,604 | 4,163 | +60% | 0 | 0 | — |
case-06 | pass→pass | 18,703 | 20,275 | +8% | 1 | 1 | 0% | 3,386 | 4,958 | +46% | 0 | 0 | — |
case-07 | pass→pass | 11,475 | 16,327 | +42% | 1 | 1 | 0% | 2,543 | 4,027 | +58% | 0 | 0 | — |
case-11 | pass→pass | 15,160 | 11,857 | -22% | 1 | 1 | 0% | 2,553 | 3,633 | +42% | 0 | 0 | — |
case-12 | pass→pass | 7,614 | 8,107 | +6% | 1 | 1 | 0% | 1,212 | 2,706 | +123% | 0 | 0 | — |
case-13 | pass→pass | 12,260 | 13,964 | +14% | 1 | 1 | 0% | 2,003 | 3,266 | +63% | 0 | 0 | — |
case-14 | fail→pass | 16,088 | 16,721 | +4% | 1 | 1 | 0% | 2,694 | 4,006 | +49% | 0 | 0 | — |
case-15 | pass→pass | 12,471 | 3,774 | -70% | 1 | 1 | 0% | 2,078 | 2,107 | +1% | 0 | 0 | — |
case-16 | fail→pass | 10,430 | 3,416 | -67% | 1 | 1 | 0% | 1,864 | 2,091 | +12% | 0 | 0 | — |
case-17 | fail→pass | 6,435 | 2,998 | -53% | 1 | 1 | 0% | 1,052 | 1,913 | +82% | 0 | 0 | — |
case-18 | fail→pass | 7,238 | 2,412 | -67% | 1 | 1 | 0% | 1,211 | 1,777 | +47% | 0 | 0 | — |
case-19 | pass→fail | 13,307 | 9,422 | -29% | 1 | 1 | 0% | 2,098 | 1,825 | -13% | 0 | 0 | — |
case-20 | pass→pass | 15,012 | 20,850 | +39% | 1 | 1 | 0% | 2,413 | 3,980 | +65% | 0 | 0 | — |
case-21 | pass→pass | 14,602 | 16,305 | +12% | 1 | 1 | 0% | 2,275 | 3,356 | +48% | 0 | 0 | — |
case-22 | pass→pass | 13,190 | 5,814 | -56% | 1 | 1 | 0% | 2,118 | 2,419 | +14% | 0 | 0 | — |
case-23 | pass→pass | 11,873 | 9,693 | -18% | 1 | 1 | 0% | 1,798 | 2,841 | +58% | 0 | 0 | — |
case-24 | pass→pass | 5,398 | 1,695 | -69% | 1 | 1 | 0% | 689 | 1,609 | +134% | 0 | 0 | — |
case-25 | pass→pass | 9,011 | 6,035 | -33% | 1 | 1 | 0% | 1,441 | 2,274 | +58% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 22 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of 0 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.