# Inference Batch Seal variable-size inference requests by a token budget and carry the first oversized arrival to the next batch. Machine learning and evaluation · framework · 0.1.2 Framework bird: Indian paradise flycatcher male. ## Drive the workflow Start with `inference_batch_start()`. For each event call `inference_batch_step(snapshot, event, value)`, persist the returned snapshot, and dispatch `inference_batch_command(snapshot)` to your application’s adapter. The host owns I/O, event ordering, duplicate detection and durable command delivery. A matching event produces one command. Rejected events retain the phase and saved quantity. An invalid snapshot yields an empty vector. The snapshot contains phase ID, saved quantity and last command ID. Event values are whole numbers from zero through one billion. In the table, **x** is the event value and **r** is the saved quantity. Rules match in listed order. To validate a whole history without running effects use `inference_batch_replay(events, values)`. It returns the final snapshot or an empty vector on rejection. | Current phase | Event | Guard | Next phase | Command | New quantity | |---|---|---|---|---|---| | idle | budget | x>0 | packing | start_batch | x | | packing | request | x>0 and x<=r | packing | enqueue_request | r-x | | packing | request | x>r | rolling | execute_current | x | | rolling | budget | x>=r | packing | enqueue_pending | x-r | | rolling | budget | x