ARTI

ARTI guides

Integrate with your model

Add a configured program at the right tensor boundary while keeping the application's objective and input semantics.

On this page

Start with the host boundary

Choose the module outputs where your program should participate. Configure the program before attaching it, and ensure its terminal tensor satisfies the host boundary's declared shape. Discovery and preview help inspect the selected paths before the host is modified.

python
import arti

# program is a configured FederatedProgram.
layer = arti.ARTILayer(program)
model = arti.ARTI.attach(model, layer, layers="model.layers.*")
print(model.arti.summary())

  • Retain the host's preprocessing, masks and native loss behavior.
  • Select parameter ownership deliberately, including whether the backbone remains frozen.
  • Keep internal program shapes separate from the shape required at the attachment boundary.

Use the shared training session

An attached host reaches the training session through model.arti.trainer; a native model reaches it through arti.trainer. Use the host's model_loss or an explicit objective callable. Tensor alignment is a chosen alternative, not a replacement for the application's original target.

python
session = model.arti.trainer(
    engine="accelerate",
    objective="model_loss",
)
result = session.fit(loader, checkpoint_path="run.arti.st")

Describe ownership with TrainingBinding

Some applications execute one object, optimize parameters owned by another, and save a different supported state closure. TrainingBinding makes those relationships explicit within the shared session. TaskRecipe uses the standard arti.st checkpoint path by default. Explicit binding save/load hooks have their own supported scope; a task does not automatically adopt an arbitrary external or provider checkpoint codec.

Restore the same configured program

Adapter assets retain the supported program state and provenance while frozen base weights stay separate. Loading an attachment requires the compatible program and reconstruction code. A shared shape or Python class name alone is not enough to recreate an arbitrary implementation.

Or build the model directly

A standalone application can compose Formula programs and ordinary modules without an attachment shell. Supply its objective and data to the same task workflow. Native JAX and optional Flax use their declared native integration path.

Save and reload the configured attachment

The attachment artifact stores its owned tensor state. Reconstruct the pinned host, supply the configured layer again, and let ARTI verify the Federal contract before loading weights. Backbone weights remain a separate dependency.

python
model.arti.save("assistant.arti.st")

fresh_model = load_base_model()
fresh_model = arti.ARTI.load(
    fresh_model, "assistant.arti.st",
    layer=layer, map_location="cpu",
)