Skip to content

Batch API analysis mode (--batch): 50% cheaper bulk runs - #10

Merged
zackkitzmiller merged 2 commits into
mainfrom
feat/batch-analysis
Jun 13, 2026
Merged

Batch API analysis mode (--batch): 50% cheaper bulk runs#10
zackkitzmiller merged 2 commits into
mainfrom
feat/batch-analysis

Conversation

@zackkitzmiller

Copy link
Copy Markdown
Member

Summary

Stacked on #9 (needs describe_text and the document-extraction path from that PR).

Adds an opt-in Batch API path for the analyze pass: spindle --batch <dirs>. All uncached images and documents are submitted as one message batch (50% cheaper per token), polled until the batch ends, and results are mapped back per file. Cache hits, filename-only fallbacks, and videos resolve through the existing paths.

Design

  • AiProvider::describe_batch(Vec<DescribeRequest>) — default impl falls back to sequential individual calls, so non-batch providers and test mocks work unchanged
  • ClaudeProvider override: submit → poll (5s interval) → fetch JSONL results; per-item errors stay individual, batch-level failures fail every item with the shared cause
  • describe_image/describe_text now share a describe_api_request builder with the batch path, so both modes send byte-identical request params
  • Results are matched by custom_id (req-{index}), tolerating out-of-order JSONL lines; missing ids surface as per-item errors

Not in scope (follow-ups)

  • Cost estimator still quotes full price in batch mode (should halve)
  • Progress UI shows no batch-specific status while polling

Test plan

@ecc-tools

ecc-tools Bot commented Jun 12, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

@ecc-tools

ecc-tools Bot commented Jun 13, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

Base automatically changed from feat/content-aware-classification to main June 13, 2026 04:04
Adds a 50%-cheaper asynchronous analysis path using the Messages
Batch API, suited to large fire-and-forget organize runs.

- New AiProvider::describe_batch with a sequential default impl;
  ClaudeProvider overrides it: submit to /v1/messages/batches, poll
  until ended, fetch JSONL results, map per-item outcomes back to
  submission order (item errors stay individual; batch-level
  failures fail all items with the shared cause)
- describe_image/describe_text refactored onto a shared
  describe_api_request builder so individual and batch paths build
  identical requests
- analyze_batch branches on AnalyzeOptions.use_batch_api: cache hits
  and filename fallbacks resolve locally, images and documents are
  submitted in one batch, videos keep the per-file path (keyframe
  extraction is multi-request)
- --batch CLI flag wires through PipelineConfig
@ecc-tools

ecc-tools Bot commented Jun 13, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

@zackkitzmiller
zackkitzmiller merged commit d43b940 into main Jun 13, 2026
1 check passed
@zackkitzmiller
zackkitzmiller deleted the feat/batch-analysis branch June 13, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant