Skip to main content
Artifacts are outputs that recipes create and register with the Adaptive Engine. All you have to do is create and add content to one in your recipe code, and it will appear in the UI after the run completes. Harmony supports two types of artifacts: evaluation results and new datasets.
Artifacts are currently only registered in the platform if the recipe that creates them is executed in the platform. Artifacts created in interactive sessions do not get logged to the platform.

Evaluation artifact

EvaluationArtifact stores evaluation results from model assessments. Each artifact contains multiple EvalSample objects (model completions with attached grades). When viewed in the Adaptive UI, the artifact displays aggregate evaluation scores per model across all graders that were used in the evaluation, in an interactive table format. Import from adaptive_harmony: EvaluationArtifact, EvalSample, EvalSampleInteraction, Grade. Create an artifact with EvaluationArtifact(name, ctx) where name is the display name in the UI and ctx is the recipe context. Use add_samples(samples) to append a list of EvalSample objects to the artifact. The method returns self for chaining and raises ValueError if the samples list is empty.

Example

The artifact is automatically registered with the job and appears as an evaluation table in the UI when the recipe completes.
The evaluation artifact will fail to render in the UI if the source model key in EvalSampleInteraction does not exist in the platform. When using adaptive_harmony.parameters.Model instances, get the key via model.model_key to ensure it matches the spawned model. Same goes for dataset_key, which you can get from dataset.dataset_key if you are using adaptive_harmony.parameters.Dataset.
The grader_key in each Grade can be a new name for a custom grader defined in the recipe. If the grader key doesn’t exist in the platform, Adaptive automatically creates a new custom grader entry to reflect it in the evaluation results.

Dataset artifact

DatasetArtifact saves datasets generated during recipe execution. It supports different dataset kinds and saves samples in JSONL format compatible with the platform’s dataset format. Import from adaptive_harmony: DatasetArtifact, StringThread. Import from adaptive_harmony.runtime: AdaptiveDatasetKind. Create an artifact with DatasetArtifact(name, ctx, kind=AdaptiveDatasetKind.Mixed) where kind specifies the dataset type:
  • Prompt — Prompt-only samples (no completions)
  • Completion — Prompt-completion pairs
  • Metric — Samples with evaluation metrics
  • Preference — Preference samples (good vs bad completions)
  • Mixed — Any combination of the above (default)
Use add_samples_from_thread(threads) to convert StringThread objects to dataset samples and append them. This method only works with Prompt, Completion, and Mixed kinds. For Metric and Preference datasets, use add_samples(samples) with structured sample objects instead. Both methods return self for chaining. The sample_count property returns the number of samples added.

Example

Metric datasets store samples with evaluation scores from multiple graders. Each sample requires a metrics dict mapping grader keys to float values.
Preference datasets store samples with both good and bad completions for the same prompt.
All artifacts are automatically registered with the run and appear in the Adaptive UI when the run completes.