batch-api-orchestrator
БесплатноЗапускает вложенные скриптыНе проверенDecides batch vs realtime for bulk LLM work, prices both, and plans chunking, idempotency keys and partial-failure retries. Use when running evals, backfills…
от borghei★ 1 250 звёзд на GitHubОб этом скилле
Batch API Orchestrator
Category: Engineering Domain: AI Engineering
Overview
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.
When to Use
- A job of thousands of LLM requests where no person waits on each answer (evals, backfills, embeddings, bulk classification).
- Choosing between a provider's batch API and realtime calls on cost and latency.
- Designing chunk sizes, retries and reconciliation for a batch job before writing client code.
Clarify First
Before recommending or designing a batch job, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Latency tolerance: is a human waiting (interactive), or can results land in minutes/hours? (sets
--latency-toleranceand the batch-vs-realtime verdict). - Volume & token shape: how many requests, and the average input/output tokens each? (sets
--requests,--avg-input-tokens,--avg-output-tokensfor the cost estimate). - Pricing & discount: your realtime per-token prices and the batch discount your vendor offers (sets
--realtime-input-price,--realtime-output-price,--batch-discount; defaults are neutral placeholders, not real prices).
Ask about the two or three inputs that matter most for this request. If the user says "just draft it," proceed and list your assumptions.
Quick Start
cd 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
Tools Overview
| 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.
Exit codes (both). 0 estimate or plan printed; 2 invalid arguments (negative or zero counts,
discount outside 0-1, unknown latency tolerance or retry policy).
Provider limits to check (as of 2026-11, from the providers' batch API docs; confirm before sizing a job)
| Anthropic Message Batches | OpenAI Batch API | |
|---|---|---|
| Discount vs realtime | 50% | 50% |
| Max per batch | 100,000 requests or 256 MB | 50,000 requests per input file, input file up to 200 MB |
| Completion window | most finish within an hour; expire after 24 h | 24 h window |
| Result retention | 29 days | output file deleted 30 days after the batch completes (set 1 hour to 30 days with output_expires_after) |
| Prompt caching | stacks with the batch discount | check current docs |
Use these to set --max-batch-size and --batch-discount. Limits change, so read the provider's
batch documentation before sizing a production job.
Done when:
- The cost comparison used your provider's current prices and discount, not the placeholders.
- Every request carries an idempotency key and every result is joined back to its request by id.
- A small pilot batch (a few hundred items) completed, and failed items were retried on their own.
Workflows
1. Decide batch vs realtime, then size the cost
- Gather volume and token shape (
--requests,--avg-input-tokens,--avg-output-tokens). - Plug in your vendor prices and batch discount — never assume them.
- Run
batch_cost_estimator.pywith the real--latency-tolerance(realtime,minutes, orhours). - Read the verdict: if work is interactive, the tool recommends realtime regardless of savings; otherwise it quantifies the batch savings.
- Sanity-check against the decision tree in
references/batch-patterns-and-decision-tree.md.
2. Design a resilien
Установить batch-api-orchestrator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл batch-api-orchestrator?
Decides batch vs realtime for bulk LLM work, prices both, and plans chunking, idempotency keys and partial-failure retries. Use when running evals, backfills, embeddings or bulk extraction through a provider batch API.
Как установить скилл batch-api-orchestrator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл batch-api-orchestrator запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic