Skip to content

Python SDK ​

Use this reference to call the Python SDK with import rundial as rd.

rd.init ​

python
rd.init(*, project: 'str | None' = None, workspace: 'str | None' = None, workspace_slug: 'str | None' = None, name: 'str | None' = None, endpoint: 'str' = 'http://127.0.0.1:8787', run_id: 'str | None' = None, kind: 'RunKind' = 'training', resume: 'ResumeMode' = 'never', group: 'str | None' = None, job_type: 'str | None' = None, tags: 'list[str] | None' = None, config: 'Mapping[str, object] | None' = None, mode: 'Mode' = 'online', distributed: 'Distributed' = 'rank0', distributed_rank: 'int | None' = None, api_key: 'str | None' = None, **client_options: 'object') -> 'Run'

Create or attach a run with a context-managed friendly API.

This function owns the created client instance. Calling run.finish() or exiting a with block will close the underlying client.

rd.checkpoint ​

python
rd.checkpoint(model_path: 'str | os.PathLike[str]', *, step: 'int | None' = None, name: 'str' = 'checkpoint', metadata: 'Mapping[str, object] | None' = None, keep_last: 'int | None' = 5) -> 'bool'

Log a checkpoint artifact on the current run created by rd.init(...).

rd.Image ​

python
rd.Image(path_or_image: 'str | os.PathLike[str] | object', *, caption: 'str | None' = None, metadata: 'Mapping[str, object] | None' = None) -> 'None'

Image media value for run.log({"samples": rd.Image(...)}).

rd.Table ​

python
rd.Table(*, columns: 'Sequence[str]', rows: 'Sequence[Sequence[object] | Mapping[str, object]]', caption: 'str | None' = None, metadata: 'Mapping[str, object] | None' = None) -> 'None'

Bounded table media value for run.log({"predictions": rd.Table(...)}).

rd.eval.suite ​

python
rd.eval.suite(name: 'str', *, dataset: 'Mapping[str, object] | str', scorers: 'list[str | Mapping[str, object]]', workspace: 'str | None' = None, project: 'str | None' = None, org_id: 'str | None' = None, project_id: 'str | None' = None, endpoint: 'str' = 'http://127.0.0.1:8787', api_key: 'str | None' = None, suite_id: 'str | None' = None, dataset_name: 'str | None' = None, dataset_version: 'str | None' = None, mode: 'Mode' = 'online', **client_options: 'object') -> 'RundialEvalSuite'

Create an eval suite and return a context-friendly suite facade.

RundialEvalSuite.run ​

python
run(self, *, config: 'Mapping[str, object] | None' = None, run_id: 'str | None' = None, eval_run_id: 'str | None' = None) -> 'RundialEvalRun'

RundialEvalRun.log_result ​

python
log_result(self, example_id: 'str', *, scores: 'Mapping[str, object]', passed: 'Mapping[str, bool] | bool | None' = None, trace: 'RundialSpan | str | None' = None, evidence: 'Mapping[str, object] | None' = None, meta: 'Mapping[str, object] | None' = None, observation_ids: 'Mapping[str, str] | None' = None, replicate_id: 'str' = '0', revision: 'int' = 0, objective: 'str' = 'maximize') -> 'bool'

Enqueue one or more scorer results without network or disk I/O.

ArtifactDownloadHandle.download ​

python
download(self, directory: 'str | Path') -> 'Path'

RundialRun ​

Run-scoped logging facade.

RundialRun.log ​

python
log(self, metrics: 'Mapping[str, object]', *, step: 'int | None' = None, time_ms: 'int | None' = None, context: 'Mapping[str, str] | None' = None) -> 'bool'

RundialRun.log_metric ​

python
log_metric(self, metric_key: 'str', *, step: 'int | None' = None, value: 'object', timestamp_ms: 'int | None' = None, time_ms: 'int | None' = None, context: 'Mapping[str, str] | None' = None) -> 'bool'

RundialRun.log_text ​

python
log_text(self, message: 'object', *, level: 'LogLevel' = 'info', timestamp_ms: 'int | None' = None, time_ms: 'int | None' = None) -> 'bool'

RundialRun.trace ​

python
trace(self, name: 'str', *, kind: 'TraceSpanKind' = 'internal', attrs: 'Mapping[str, object] | None' = None, trace_id: 'str | None' = None, parent_span_id: 'str | None' = None) -> 'RundialSpan'

RundialRun.tool_call ​

python
tool_call(self, name: 'str', *, input: 'object | None' = None, output: 'object | None' = None, attrs: 'Mapping[str, object] | None' = None, status: 'TraceSpanStatus' = 'ok') -> 'bool'

RundialRun.log_artifact ​

python
log_artifact(self, path_or_dir: 'str | os.PathLike[str]', *, name: 'str | None' = None, type: 'str | None' = None, metadata: 'Mapping[str, object] | None' = None, aliases: 'list[str] | None' = None, retention_policy: 'Mapping[str, object] | None' = None) -> 'bool'

RundialRun.checkpoint ​

python
checkpoint(self, model_path: 'str | os.PathLike[str]', *, step: 'int | None' = None, name: 'str' = 'checkpoint', metadata: 'Mapping[str, object] | None' = None, keep_last: 'int | None' = 5) -> 'bool'

RundialRun.use_artifact ​

python
use_artifact(self, artifact_ref: 'str') -> 'ArtifactDownloadHandle'

RundialRun.flush ​

python
flush(self, timeout_seconds: 'float | None' = None) -> 'bool'

RundialRun.diagnostics ​

python
diagnostics(self) -> 'RundialDiagnostics'

RundialRun.update_config ​

python
update_config(self, config: 'Mapping[str, object]', *, timeout_seconds: 'float' = 5.0) -> 'bool'

RundialRun.finish ​

python
finish(self, timeout_seconds: 'float' = 5.0, *, status: 'RunTerminalStatus' = 'completed', reason: 'str | None' = None) -> 'bool'

RundialRun.complete ​

python
complete(self, reason: 'str | None' = None, timeout_seconds: 'float' = 5.0) -> 'bool'

RundialRun.fail ​

python
fail(self, reason: 'str | None' = None, timeout_seconds: 'float' = 5.0) -> 'bool'

RundialRun.abort ​

python
abort(self, reason: 'str | None' = None, timeout_seconds: 'float' = 5.0) -> 'bool'

RundialSpan ​

Run-scoped trace span context manager.

RundialSpan.set_attrs ​

python
set_attrs(self, attrs: 'Mapping[str, object] | None' = None, **kwargs: 'object') -> 'None'

RundialSpan.event ​

python
event(self, name: 'str', attrs: 'Mapping[str, object] | None' = None, *, timestamp_ns: 'int | None' = None) -> 'None'

RundialSpan.finish ​

python
finish(self, *, status: 'TraceSpanStatus' = 'ok', end_ns: 'int | None' = None) -> 'bool'

RundialClient ​

Non-blocking SDK client with background ingest pipeline.

RundialClient.start_run ​

python
start_run(self, *, project_id: 'str', workspace_slug: 'str | None' = None, run_id: 'str | None' = None, kind: 'RunKind' = 'training', resume: 'RunResumeMode' = 'never', run_name: 'str | None' = None, group: 'str | None' = None, job_type: 'str | None' = None, tags: 'list[str] | None' = None, config: 'Mapping[str, object] | None' = None, _owns_client: 'bool' = False) -> 'RundialRun'

RundialClient.start_run_for_workspace_project ​

python
start_run_for_workspace_project(self, *, workspace: 'str | None' = None, project: 'str | None' = None, workspace_slug: 'str | None' = None, project_slug: 'str | None' = None, run_id: 'str | None' = None, kind: 'RunKind' = 'training', resume: 'RunResumeMode' = 'never', run_name: 'str | None' = None, group: 'str | None' = None, job_type: 'str | None' = None, tags: 'list[str] | None' = None, config: 'Mapping[str, object] | None' = None, _owns_client: 'bool' = False) -> 'RundialRun'

RundialClient.resolve_run_target ​

python
resolve_run_target(self, *, workspace: 'str', project: 'str') -> 'dict[str, str]'

RundialClient.log_metric ​

python
log_metric(self, *, project_id: 'str', run_id: 'str', metric_key: 'str', step: 'int', value: 'object', timestamp_ms: 'int | None' = None, time_ms: 'int | None' = None, context: 'Mapping[str, str] | None' = None) -> 'bool'

RundialClient.log_text ​

python
log_text(self, *, project_id: 'str', run_id: 'str', message: 'object', level: 'LogLevel' = 'info', timestamp_ms: 'int | None' = None, time_ms: 'int | None' = None) -> 'bool'

RundialClient.flush ​

python
flush(self, timeout_seconds: 'float | None' = None) -> 'bool'

RundialClient.close ​

python
close(self, timeout_seconds: 'float' = 5.0, *, drain: 'bool' = True) -> 'bool'

RundialClient.diagnostics ​

python
diagnostics(self) -> 'RundialDiagnostics'

RundialClient.list_metric_keys ​

python
list_metric_keys(self, *, project_id: 'str', run_id: 'str | None' = None, limit: 'int' = 8) -> 'list[dict[str, object]]'

RundialClient.query_series ​

python
query_series(self, *, project_id: 'str', run_id: 'str', metric_keys: 'list[str]', max_points_per_series: 'int' = 25) -> 'dict[str, object]'