Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

batch-router

БесплатноЗапускает вложенные скриптыНе проверен

Use when the user says 'bulk LLM job', 'batch job', 'submit a batch job', 'run this prompt over all the documents', 'process thousands of PDFs', 'extract…

edwinhuот edwinhu★ 28 звёзд на GitHub

Об этом скилле

Batch router

Picks the provider for one batch job and hands off. It never submits: the handoff is to claude-batch, openai-batch or gemini-vertex, which own the request format, the pilot and the submission.

What this skill carries — grep references/ for any subject the names below miss: !d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"

## IRON LAW: BATCH BY DEFAULT, NEVER SYNC — AND NO FULL PAID RUN WITHOUT EDDY'S YES

Every bulk LLM job goes through a provider's Batch API (half price), never a loop of synchronous calls and never an interactive-agent fan-out; one synchronous verify per job is the only sync call. The full run waits for the pilot's results --input exit 0 and a message from Eddy approving the cost this router printed. A sync loop that "already works" still costs double, and a fan-out of agents bills the shared Claude accounts per document.

Route

uv run ${CLAUDE_SKILL_DIR}/scripts/route_batch.py --requests 5000 --in-tokens 3000 --out-tokens 300 \
  [--tier cheap|mid|top|frontier | --model <id>] [--needs pdf|vision|audio|video|embeddings|long-context|web-search] \
  [--purpose research|consulting|other] [--balance uva=200 --balance nyu=200] [--json]
uv run ${CLAUDE_SKILL_DIR}/scripts/route_batch.py --jsonl requests.jsonl --out-tokens 300   # measured

Model table maintenance: route_batch.py --propose [--json] (advisory: new models the providers serve, newer same-family candidates per tier) and --refresh [--table PATH] (only writer of available, prices, asOf in scripts/batch_models.json; review the diff).

It prints a ranked table with a reason per row and the next command. Document type decides first:

  1. Document job → Gemini. PDFs, images, audio, video, embeddings, or long context (mean input

    100k tokens/request, flagged automatically) rank Gemini first even when a Claude credit expires tomorrow; Claude and OpenAI rows become fallbacks. Pass --needs for every document type the job has.

Text web-search job → Claude. --needs web-search with no document type ranks the usable Claude rows first (soonest-expiring credit first, then groups 1–3 below); OpenAI and Gemini grounding are fallbacks. Pass --max-uses (default 3) for the per-row search cap.

Only a text job reaches the credit ranking:

  1. Prepaid credit that expires soonest, covers the estimated cost +20%, and has a usable key.
  2. Other prepaid credit (short balance, or expiry within 24h).
  3. Pay-per-token, cheapest model that fits; Gemini Vertex wins a tie and is the default fallback.
  4. Blocked: no key, or the batch path lacks a needed capability (Claude has no embeddings, audio or video). Listed, with why.

Over a provider's per-batch limit (Claude 100k / 256 MB, OpenAI 50k / 200 MB, Gemini 200k) the row says how many shards. Details, prices and limits: routing rules.

Then invoke the skill the top row names (workflows:claude-batch, workflows:openai-batch or workflows:gemini-vertex) and follow it: validate exit 0 → one verify → 5–10 row pilot whose results --input exits 0 → Eddy's yes to the printed cost → full run → results --input exit 0.

Facts

  • Who pays for Gemini. Research batches run on Vertex in the research project (vertex_research_project in accounts.toml; --purpose research prints it), never on the AI Studio GOOGLE_API_KEY. Every Cloud project bills Eddy's personal account (credits first), so pilot and cap every job. Consulting work needs its own project, never the research project; until one exists the router says ask Eddy.
  • No paid commitment without Eddy. Ask before creating a billing account, a Cloud project, a prepayment or any other paid commitment.
  • Claude subscriptions are not a batch budget. Daily agent work runs on the Claude Code subscription; the API credit ($200/month per org, three orgs, API and Message Batches only) is what batches spend.
  • Balances are never stored. There is no balance API for Claude credits; the Console is the only source. Pass --balance <account>=<usd> from what Eddy or the Console reported today; without it the router assumes at most the monthly credit and prints balance UNVERIFIED. Writing a balance into accounts.toml creates a number that is silently wrong a day later.
  • Accounts are config, at $BATCH_ACCOUNTS (default ~/.config/batch-router/accounts.toml; shape in references/accounts.example.toml). This repo is public: org ids, emails and key paths never go in it.
  • OpenAI is pay-per-token until its account says credit_linked = true: the ChatGPT Pro credit page never names Batch
Полный SKILL.md на GitHub

Установить batch-router в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/accounts.example.tomlreferences/routing.mdscripts/batch_models.jsonscripts/batch_refresh.pyscripts/batch_router_test.pyscripts/batchlib.pyscripts/route_batch.py

FAQ

Что делает скилл batch-router?

Use when the user says 'bulk LLM job', 'batch job', 'submit a batch job', 'run this prompt over all the documents', 'process thousands of PDFs', 'extract fields from every filing', 'code each filing', 'label / annotate these documents', 'hand-code these', 'have agents read each document', 'which batch provider', 'cheapest way to run this over N rows', 'spend my API credits', 'Claude or OpenAI or Gemini for this batch', or needs any per-row LLM extraction, classification or enrichment over many inputs.

Как установить скилл batch-router?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл batch-router запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить batch-router с