Kitaru

artifacts

Artifact helpers for explicit named artifacts.

kitaru.save() persists a named artifact inside a checkpoint. kitaru.load() retrieves a named artifact from a previous execution.

Both are valid only inside a checkpoint.

Example::

from kitaru import checkpoint

@checkpoint def research(topic: str) -> str: context = gather_sources(topic) kitaru.save("sources", context, type="context") return summarize(context)

In a later execution:

@checkpoint def refine(exec_id: str) -> str: old_sources = kitaru.load(exec_id, "sources") return improve(old_sources)

func_require_checkpoint_scope(api_name) -> tuple[UUID, UUID]

Validate that an API call happens inside a checkpoint scope.

paramapi_namestr

Calling Kitaru API name.

Returns

tuple

Tuple of current execution UUID and checkpoint UUID.

func_normalize_artifact_type(artifact_type) -> str

Validate and normalize Kitaru artifact type labels.

paramartifact_typestr

Artifact type supplied by the user.

Returns

str

Normalized artifact type.

func_normalize_step_name(step_name) -> str

Normalize ZenML step names back to user-facing checkpoint names.

paramstep_namestr

Returns

str
func_matches_requested_name(*, step_name, artifact, requested_name) -> bool

Check whether an artifact matches a Kitaru load() name lookup.

paramstep_namestr
paramartifactArtifactVersionResponse
paramrequested_namestr

Returns

bool
func_collect_named_artifact_matches(*, run, requested_name) -> list[_ArtifactMatch]

Collect candidate artifacts in a run for a given Kitaru lookup name.

paramrunPipelineRunResponse
paramrequested_namestr

Returns

list[kitaru.artifacts._ArtifactMatch]
func_format_match(match) -> str

Format a match for ambiguity error messages.

parammatch_ArtifactMatch

Returns

str
funcsave(name, value, *, type='output', tags=None) -> None

Persist a named artifact inside the current checkpoint.

paramnamestr

Artifact name (unique within the checkpoint).

paramvalueAny

The value to persist. Must be serializable.

paramtypestr
= 'output'

Artifact type for categorization (one of "prompt", "response", "context", "input", "output", "blob").

paramtagslist[str] | None
= None

Optional tags for filtering and discovery.

Returns

None
funcload(exec_id, name) -> Any

Load a named artifact from a previous execution.

paramexec_idstr

The execution ID to load from.

paramnamestr

The artifact name to retrieve.

Returns

typing.Any

The materialized artifact value.

On this page