Adaptive Harmony provides common utilities for efficient concurrent processing of data. Use these functions to parallelize model inference, grading, and other async operations in your recipes.Documentation Index
Fetch the complete documentation index at: https://docs.adaptive-ml.com/llms.txt
Use this file to discover all available pages before exploring further.
async_map
Process all items concurrently with automatic progress tracking:
f— Async function to applydata— Sequence of itemsmax_concurrent_samples— Optionalintcap on in-flight tasks. Backed by anasyncio.Semaphore. Use this to avoid overwhelming a downstream model or API.stage_notifier— OptionalStageNotifier. When set, progress is reported to the platform as each sample finishes, so the job UI shows live progress.
async_map_fallible
Same as async_map but silently skips failures instead of crashing.
Failed samples are excluded from results.
max_concurrent_samples and stage_notifier as async_map.
Pass return_indices=True to recover which inputs survived. The result type changes to list[tuple[int, T]] where the int is the index in the original data sequence:
async_map_batch
Process an iterator in batches with automatic retry on failure:f- Async function to applydata- Iterator (not list) of itemsbatch_size- Number of items per batchmax_failure_fraction- Max fraction of failures before raising exception (default 0.5)
- Processes
batch_sizeitems concurrently - If a sample fails, pulls next item from iterator and retries
- Fails if more than
max_failure_fraction * batch_sizesamples fail - Results are not ordered
- Working with iterators
- Want automatic retry with fresh samples on failure (as in training, where batch size must remain constant)
- Don’t need to preserve ordering

