ARTI

ARTI guides

Commit and resume prediction

Retain original request identities, structured results and named binary files. Continue unfinished work from the durable journal.

On this page

Configure two batching boundaries

The outer batch_size bounds a committed partition. predict_kwargs belongs to the task callback and can use a different model batch size. Requests use unique, nonempty string IDs; the callback returns one JSON-compatible result per input in order.

python
import arti

run = arti.PredictionRunConfig(
    "outputs/prediction",
    batch_size=64,
    predict_kwargs={"batch_size": 16},
)
result = arti.run_prediction(
    "outputs/model", "requests.jsonl", run,
    task_factory="my_package.tasks:build_task",
)
result = arti.run_prediction(
    "outputs/model", None, run, resume=True,
    task_factory="my_package.tasks:build_task",
)

Use committed parts as the authority

plan.json pins original inputs, ordered IDs, source model, task identity and prediction policies. Each part publishes predictions.jsonl and its receipt together by atomic directory rename. Resume adopts completed receipts even if a later progress write was interrupted.

Saved objectPurpose
plan.jsonOriginal population and fixed policy
Committed part + receiptAuthoritative output and execution evidence
Final JSONLDerived stream assembled from complete parts

Declare native file outputs

For images, arrays or other task formats, declare named relative files with each structured result. The durable file contract binds their content and keeps the task’s original encoding. Codecs, media decoding and output meaning remain application-owned.

Continue or rebuild completed results

An unfinished run requires its original model asset and task code. Once every part is committed, the final JSONL can be rebuilt without a model call or original request file. A supplied model must still match the pinned source. Moving a complete journal does not change its content identity.

Terminal
python -m arti recipe inspect-prediction outputs/prediction
python -m arti recipe predict-run --run-dir outputs/prediction --resume