Skip to content

docs: clarify batch parallelism and transcribe_batch callbacks#4

Merged
fcogidi merged 4 commits intomainfrom
fix/batch-on-result-strict-mode
Apr 17, 2026
Merged

docs: clarify batch parallelism and transcribe_batch callbacks#4
fcogidi merged 4 commits intomainfrom
fix/batch-on-result-strict-mode

Conversation

@fcogidi
Copy link
Copy Markdown
Collaborator

@fcogidi fcogidi commented Apr 17, 2026

Summary

  • Document max_parallel_requests for generate/transcribe vs embed micro-batching
  • Widen on_result types
  • Add JSONL streaming example for transcribe_batch.

fcogidi added 3 commits April 17, 2026 17:09
Fire callbacks for the failing item when return_exceptions=False in
bounded generation, unbounded TaskGroup-wrapped coroutines, and
transcription batch handling.
Add bounded, unbounded generate_batch, and transcribe_batch cases where return_exceptions=False and the failing item must still
receive on_result before propagation.
Document max_parallel_requests for generate/transcribe vs embed
micro-batching; widen on_result types; add JSONL streaming example
for transcribe_batch.
@fcogidi fcogidi marked this pull request as ready for review April 17, 2026 21:22
@fcogidi fcogidi requested a review from Copilot April 17, 2026 21:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clarifies batch parallelism behavior and callback contracts in the docs, and adjusts batch execution so on_result fires for failing items even in strict (return_exceptions=False) mode.

Changes:

  • Document how max_parallel_requests affects generate_batch / transcribe_batch vs embed_batch micro-batching.
  • Ensure on_result is invoked for the failing item in strict mode for generation (bounded + TaskGroup paths) and transcription.
  • Add/extend tests covering strict-mode on_result behavior; add a JSONL streaming example for transcribe_batch.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_client_batch.py Adds async tests ensuring on_result fires for failing items in strict mode (generation bounded/unbounded, transcription).
src/infermesh/_transcription.py Refactors transcription batch task settlement to ensure strict-mode failures still trigger on_result before aborting.
src/infermesh/_generation.py Ensures strict-mode failures trigger on_result (bounded + TaskGroup paths) and updates progress accounting accordingly.
docs/guide.md Clarifies parallelism/micro-batching, widens documented on_result result types, and adds a JSONL streaming example for transcribe_batch.
README.md Mirrors the parallelism/micro-batching clarification from the guide.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/guide.md
Comment thread docs/guide.md Outdated
@fcogidi fcogidi merged commit 3992e24 into main Apr 17, 2026
8 checks passed
@fcogidi fcogidi deleted the fix/batch-on-result-strict-mode branch April 17, 2026 21:32
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.

2 participants