Skip to main content

Experiments

Experiments track ML runs with parameters, metrics, and artifacts. Use this resource to create experiments, log results, compare runs, and register models.

Access it as client.experiments on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Quick start

from strongly import Strongly

client = Strongly()

# List (auto-paginates as you iterate) # filters: search, status, tag, pinned
for experiment in client.experiments.list():
print(experiment.id)

# Create
created = client.experiments.create(name="lr-sweep")
print(created.id)

# Read it back
fetched = client.experiments.retrieve(created.id)

# Delete (returns None; raises on failure)
client.experiments.delete(created.id)

Methods

Core

list

list(*, search: Optional[str] = None, status: Optional[str] = None, tag: Optional[str] = None, pinned: Optional[bool] = None, limit: Optional[int] = None) -> SyncPaginator[Experiment]

List experiments with pagination, filtering, and search.

Args: search: Search by name or description. status: Filter by status. tag: Filter by tag. pinned: If True, only return pinned experiments. limit: Maximum number of items to return (default: all matching items).

create

create(*, name: str, description: Optional[str] = None, tags: Optional[Sequence[str]] = None) -> Experiment

Create a new experiment.

Args: name: Experiment name. description: Optional description. tags: Optional tags.

retrieve

retrieve(experiment_id: str) -> Experiment

Get a single experiment by ID.

update

update(experiment_id: str, *, name: Optional[str] = None, description: Optional[str] = None, tags: Optional[Sequence[str]] = None, status: Optional[str] = None) -> Experiment

Update an experiment.

delete

delete(experiment_id: str) -> None

Delete an experiment.

Other

compare

compare(ids: List[str]) -> Dict[str, Any]

Compare multiple experiments.

Args: ids: List of experiment IDs to compare (minimum 2).

log_artifact

log_artifact(experiment_id: str, *, name: str, s3_key: Optional[str] = None, content_base64: Optional[str] = None, path: Optional[str] = None, type: Optional[str] = None, content_type: Optional[str] = None, size: Optional[int] = None) -> Dict[str, Any]

Record an artifact reference for an experiment run.

Args: name: Artifact name. s3_key: S3 key if the artifact is already uploaded. content_base64: Base64-encoded file content to upload. path: Artifact path. type: Artifact type (e.g. file, model). content_type: MIME content type. size: File size in bytes.

log_metric

log_metric(experiment_id: str, *, metrics: Sequence[Mapping[str, Any]]) -> Dict[str, Any]

Append metric values to an experiment run.

Args: metrics: A sequence of {key, value, step?} metric entries.

client.experiments.log_metric(
exp_id,
metrics=[{"key": "accuracy", "value": 0.91, "step": 10}],
)

log_param

log_param(experiment_id: str, *, params: Mapping[str, Any]) -> Dict[str, Any]

Record hyperparameter values for an experiment run.

Args: params: Key-value parameter pairs.

client.experiments.log_param(exp_id, params={"lr": 0.01, "epochs": 20})

pin

pin(experiment_id: str) -> Dict[str, Any]

Toggle pin on an experiment.

register

register(*, name: str, description: Optional[str] = None, tags: Optional[Sequence[str]] = None) -> Dict[str, Any]

Register an experiment from an external runner.

Used by SDK consumers running training jobs outside Strongly that want their runs to land in the experiment registry.

stats

stats() -> ExperimentStats

Get experiment overview stats.

update_tags

update_tags(experiment_id: str, tags: List[str]) -> Dict[str, Any]

Update experiment tags.

Args: experiment_id: The experiment ID. tags: The new list of tags.