ARTI guides
Commit and resume prediction
Retain original request identities, structured results and named binary files. Continue unfinished work from the durable journal.
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.
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 object | Purpose |
|---|---|
| plan.json | Original population and fixed policy |
| Committed part + receipt | Authoritative output and execution evidence |
| Final JSONL | Derived 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.
python -m arti recipe inspect-prediction outputs/prediction
python -m arti recipe predict-run --run-dir outputs/prediction --resume