HyperGAN logo HyperGAN v2.2.0
Auto-Generated From hypergan.__all__

Python API Reference

Every public symbol exposed by import hypergan as hg, lazy-loaded so importing hypergan stays Torch-free until training, sampling, or bundle loading runs.

129 public symbols 110 functions 12 dataclasses 2 classes 4 exceptions 1 callable module
129 / 129 shown
No Python API symbols match the current filter.

Configuration & Models

25 symbols

Build, load, override, validate, and serialize hypergan-model/1 configurations and HNDL/PyTorch components.

function

hg.model

(name='custom/model', *, data=None, prior=None, networks=None, losses=None, penalty=None, train=None, sampling=None, samplers=None, metrics=None, evaluations=None, defaults=None, base=None, **kwargs)

Keyword constructor for a Model (front end over from_dict).

function

hg.load

(path)

Load a model file, an engine recipe TOML, or a run's stored Model, as a Model.

An exported .pt bundle holds weights, not a model file: load it with hg.load_bundle(path) (or hg.load_inference(path) for a ready graph).

function

hg.load_bundle

(path_or_run, *, checkpoint='latest', device='cpu')

Load an exported .pt bundle file or extract the EMA bundle from a run checkpoint.

function

hg.override

(model, changes=None, /, **sections)

Return a copy with dotted-path values set, e.g. {"train.steps": 10}.

List elements are addressed by index, id or critic: "losses.reconstruction.weight". Keyword sections deep-merge tables: override(model, train={"steps": 10}).

function

hg.save

(model, path, *, overwrite=False)

Write the model file; referenced .hndl files and Python are not copied.

function

hg.plain

(value, location)

Check that an argument survives the config file unchanged (no None, NaN or objects).

function

hg.hndl

(source=None, *, file=None, input_shape, output_shape, inputs, role, **args)

A network written in HNDL, inline (source) or in a file (file).

function

hg.module

(path, *, inputs, role, trainable=None, **args)

A network implemented as an importable torch.nn.Module class or factory.

function

hg.sampler

(fn, *, inputs=None, count=None, seed=None, **args)

Declare a sampler entry for [samplers.<name>].

function

hg.adversarial

(critic, *, weight=1.0, critic_weight=None, generator_weight=None, penalty=1.0, real=None, fake=None, inputs=None, id=None)

Define an adversarial loss term binding a critic network to real and generated inputs.

function

hg.reconstruction

(id='reconstruction', fn='mse', *, input='generated', target='batch.real', weight=1.0)

Define a reconstruction loss term between generated output and a target tensor (default MSE).

function

hg.objective

(id, fn='mse', *, input=None, target=None, inputs=None, weight=1.0, args=None, type='objective')

Define a loss objective term computing a loss function over specified input tensors.

function

hg.prior_loss

(weight=1.0, **settings)

Define a prior regularization loss term with an optional weight and settings.

function

hg.lift

(raw, *, base=None)

Lift an engine recipe dictionary into a Model conforming to hypergan-model/1.

function

hg.resolve_inheritance

(model_dict: dict, config_path: pathlib.Path | str | None = None, workspace_root: pathlib.Path | str | None = None, _chain: tuple = ()) -> dict

Recursively resolve 'extends' inheritance for model files.

Parent configurations are merged recursively (tables deep-merged by name, scalars and arrays replaced). Relative paths are anchored to the declaring file. Circular inheritance chains raise ValueError.

function

hg.interpolate_variables

(data: Any, workspace_dict: dict, env_vars: dict | None = None) -> Any

Recursively replace ${var} and known {var} in strings, dictionaries, and lists.

Scope includes:

  • ${workspace.root}, ${workspace.runs_root}, {root}, {runs_root}
  • ${paths.<key>}, ${<key>}, {paths.<key>}, {<key>}
  • Explicit env_vars
  • Fallback to os.environ[key] (for ${var} syntax)

Raises KeyError if an undefined ${var} variable is encountered.

function

hg.collect_source_files

(config_path: pathlib.Path | str, workspace_root: pathlib.Path | str | None = None) -> list[pathlib.Path]

Collect the chain of source configuration files for provenance snapshotting.

function

hg.import_path

(obj, what)

module:qualname for a class or function that other processes can import.

Project Scaffolding, Datasets & Validation

16 symbols

Scaffold projects, manage starter templates, validate configs, run preflight checks, and cache datasets.

function

hg.init_project

(project_dir, *, template=None, resolution=None, data_dir=None, output_config=None, device='cuda', overwrite=False)

Initialize a HyperGAN project directory with hypergan.toml, runs/, and configs/<template>.toml.

function

hg.new

(data_dir=None, output_path=None, *, template=None, resolution=None, device='cuda', project=None, overwrite=False, name=None, dataset=None)

Scaffold a new HyperGAN model file (or initialize a project directory when project is set).

dataset is another name for data_dir, the directory of training images. name names the model file (<name>.toml; configs/<name>.toml in a project) when output_path does not.

function

hg.list_templates

()

List available starter templates (e.g. gaussian-grid, dcgan, resnet, tiny-transformer).

function

hg.validate

alias: validate_config
(model)

Check the model without Torch or user code; return warnings, raise on errors.

function

hg.preflight

alias: preflight_check
(config, profile=None, runtime=False)

Validate execution environment, hardware, and configuration compatibility.

function

hg.data_check

alias: check_data
(config, output=None)

Inspect and inventory a dataset folder defined in config, optionally writing a manifest.

function

hg.download_dataset

(name='cifar10', destination=None, *, cache_dir=None, url=None, source_archive=None, verify_only=False, timeout=60.0)

Acquire, verify, and extract a qualified dataset into destination, writing dataset-manifest.json.

function

hg.dataset_info

(name='cifar10')

Return source URL, version, expected bytes, checksums, and usage notice for a qualified dataset.

function

hg.get_cache_dir

() -> pathlib.Path

Return the root cache directory (~/.hypergan/cache/ or $HYPERGAN_CACHE_DIR).

function

hg.ensure_cached_url

(url: str, expected_sha256: str | None = None, expected_size: int | None = None, filename: str | None = None, cache_dir: str | pathlib.Path | None = None, timeout: float = 60.0) -> pathlib.Path

Download url to cache directory with multi-rank locking, verification, and resume.

function

hg.resolve_or_cache

(path_or_url: str | pathlib.Path, expected_sha256: str | None = None, expected_size: int | None = None, filename: str | None = None, cache_dir: str | pathlib.Path | None = None, timeout: float = 60.0) -> pathlib.Path

Resolve local path without copying, or download external URL into cache.

function

hg.find_workspace

(start_path: pathlib.Path | str | None = None) -> pathlib.Path | None

Walk up parent directories from start_path to discover hypergan.toml.

Returns the absolute path to hypergan.toml if found, or None.

function

hg.load_workspace

(workspace_file: pathlib.Path | str) -> dict

Load a hypergan.toml workspace file.

Returns a dictionary containing [workspace], [paths], [gpus], [envs], and optional default [run] and [checkpoints] tables.

function

hg.resolve_device_aliases

(devices: str | list[str] | None, workspace_dict: dict | None = None) -> str | list[str]

Map friendly GPU aliases ('gpu0', 'gpu1') through workspace [gpus] table.

Returns the mapped devices in the same shape (str or list) as input.

function

hg.find_runs_root

(path=None)

Locate the root directory containing training runs for a workspace or path.

Training & Run Control

11 symbols

Prepare, launch, resume, and control training runs (blocking or non-blocking via RunHandle) and on-demand requests.

function

hg.prepare

(model, run_dir=None, steps=None, *, name=None, profile=None, service_policy=None, devices=None, device=None, nodes=None, node_rank=None, rendezvous=None, strategy=None, sync_every=None, checkpoint_every=None, max_seconds=None, stop_after_steps=None, preview_every=None, previews=None, preview_keep=None, preview_keep_source=None, preview_name=None, **extra)

Validate and prepare a training run, returning a PreparedExecution.

Without run_dir the run gets a fresh directory as hypergan train gives it (see _default_run_dir); name names that directory and the run instead of a generated slug.

function

hg.prepare_resume

(run_dir, checkpoint=None, model=None, *, steps=None, profile=None, service_policy=None, devices=None, device=None, nodes=None, node_rank=None, rendezvous=None, strategy=None, sync_every=None, checkpoint_every=None, max_seconds=None, stop_after_steps=None, preview_every=None, previews=None, preview_keep=None, preview_keep_source=None, preview_name=None, sets=None, overrides=None, **extra)

Validate and prepare a run resumption, returning a PreparedExecution.

function

hg.train

(model, run_dir=None, *, steps=None, name=None, previews=None, preview_every=None, checkpoint_every=None, profile=None, devices=None, device=None, nodes=None, node_rank=None, rendezvous=None, strategy=None, sync_every=None, on_event=None, **controls) -> 'Run'

Train (or continue, if run_dir exists) and return the Run.

If run_dir is omitted or None, each call starts a fresh run directory the way hypergan train does: <runs_root>/<stem>-<adj>-<noun>, or <runs_root>/<name> when name is given.

function

hg.resume

(run, model=None, *, steps=None, devices=None, device=None, on_event=None, **controls) -> 'Run'

Continue a run from its latest checkpoint (optionally with changed observation settings).

function

hg.launch

(model, run_dir=None, *, steps=None, name=None, previews=None, preview_every=None, checkpoint_every=None, profile=None, devices=None, device=None, nodes=None, node_rank=None, rendezvous=None, strategy=None, sync_every=None, on_event=None, **controls) -> 'RunHandle'

Launch a training run asynchronously in a background thread and return a RunHandle.

function

hg.stop

(run=None, *, stop_all=False, timeout=15.0)

Gracefully stop an active training run (or all active runs) via SIGINT.

function

hg.request_checkpoint

(run_dir=None, attempt_id=None, request_id=None)

Submit an asynchronous request for the training process to save a checkpoint.

function

hg.request_status

alias: checkpoint_status
(run_dir=None, request_id=None)

Check the status of an asynchronous control request (checkpoint, stop, or sample).

function

hg.request_sample

(run_dir=None, attempt_id=None, request_id=None)

Submit an asynchronous request for the training process to emit a preview/sample.

function

hg.request_stop

(run_dir=None, attempt_id=None, request_id=None)

Submit an asynchronous request for the training process to stop cleanly at a boundary.

class

hg.RunHandle

(run_dir: 'Path', thread: 'threading.Thread | None', run: 'Run | None' = None)

Handle to a training run launched asynchronously in a background thread.

Methods
Method Signature Description
run (property) The Run instance for this execution (loaded once available).
is_alive () -> 'bool' Check if the training thread/process is active.
is_running () -> 'bool' Check if the training thread/process is active.
wait (timeout: 'float | None' = None) -> 'Run' Wait for training to complete and return the final Run object.
join (timeout: 'float | None' = None) -> 'Run' Wait for training to complete and return the final Run object.
stop (timeout: 'float' = 15.0) -> 'None' Request graceful stop of the training run.
run_info (property) Load current RunInfo for the active run.

Run Discovery, Inspection & Telemetry

28 symbols

Discover runs, read status/logs/metrics/events, compare experiments, prune checkpoints, and compact storage.

function

hg.open_run

(run_dir=None)

Open and load a Run instance and its manifest by directory, slug, tag, or short ID.

(all_runs=False, cwd=None, *, root=None) -> 'PsSnapshot'

List active training runs (or all runs if all_runs=True) enriched with GPU VRAM and queue status.

function

hg.logs

(run=None, *, tail=50, follow=False, raw=False, stream=None)

Read or follow a run's training log and return its lines.

Without follow the last tail lines are returned, and written only when stream is given. With follow they are also written as they arrive, to stream or stdout, until the run ends or Ctrl+C. raw gives the events.jsonl lines instead of formatted ones.

(run, *, force=False)

Remove a run directory and its registry entry (stops active run if force=True).

function

hg.list_runs

alias: runs alias: runs_ls
(root=None, *, sort='updated', status=None, status_filter=None, cwd=None)

Discover and list all runs under root with filtering and sorting.

function

hg.compare

alias: runs_compare
(runs, metric='loss/g_total', at_steps=None)

Compare multiple runs for a given metric across step milestones.

function

hg.diff

(target_a, target_b=None, *, sets=None, overrides=None)

Compare two configurations, models, runs, or checkpoints, returning differences.

sets (or overrides) are applied to target_b, or to a copy of target_a when target_b is omitted, as hypergan diff -s does.

function

hg.gc

alias: prune
(run=None, dry_run=False, stride=10, *, all_runs=False)

Clean rebuildable views and compact events on a finished run (or all runs if all_runs=True).

function

hg.compact_events

(run, stride=10)

Compact redundant train events in events.jsonl, returning reclaimed bytes.

function

hg.prune_checkpoints

(run=None, policy=None, dry_run=False)

Prune obsolete checkpoints in run under the retention policy.

It deletes files, so run is resolved strictly, like rm and gc: an exact run ID, short ID, slug, tag, run directory name, or run path.

function

hg.resolve_checkpoint

(run=None, target='latest')

Resolve target ('latest', 'best', step int/str, or path) to a checkpoint directory.

function

hg.resolve_run_target

(target=None, *, cwd=None, allow_latest=True, require_active=False)

Resolve a run reference (short ID, slug, name, path, @latest, or None for active/latest).

function

hg.sync_registry

(cwd=None, extra_roots=None)

Synchronize runs in workspace and runs roots into the global registry.

function

hg.generate_run_slug

(stem, parent_dir=None)

Generate a unique run name and short '<adj>-<noun>' slug for a model stem.

function

hg.read_run_info

(run_dir: 'Union[Path, str, None]' = None) -> 'RunInfo'

Canonical loader for run metadata from manifest.json, summary.json, and tag.json.

module

hg.metrics

(run, names=None)

Published scalar metrics: {name: [(step, value), ...]} in step order.

Finite scalar publication and immutable, torch-free metric definitions.

Numerical adapters always validate their complete internal results. Publication selects already computed values; it never computes objectives or executes plugins.

function

hg.observations

(run)

Why a value is or is not there: [(step, id, status, reason)] for custom metrics, evaluations and previews (queued, dropped, scheduled, skipped, ...).

function

hg.events

(run, cursor=None, limit=100, max_bytes=1048576)

Read a bounded page of run events without loading training dependencies.

function

hg.samples

(run, *, name=None)

Periodic EMA previews, oldest first (enable with train(..., previews=N)).

function

hg.project

(run_dir=None, map_spec=None, follow=False, limit=100, on_progress=None)

Project run events into the mapped contribution views.

function

hg.contributions

(run_dir=None, map_revision=None, cursor=None, limit=100, max_bytes=1048576)

Read a page of mapped contribution events, auto-projecting if needed.

Sampling, Evaluation & Media

6 symbols

Generate samples, interpolate latents, run snapshot evaluations (e.g. FID), and handle image/audio outputs.

function

hg.sample

(run=None, count=16, seed=None, *, inputs=None, output=None, checkpoint=None, default_image_png=False, device=None, output_dir=None)

Fresh samples from the run's final EMA model (or target checkpoint or .pt bundle).

function

hg.evaluate

(run, metric_id=None, *, checkpoint=None, devices=None, model=None, config=None, bundle=None)

Run one snapshot evaluation now on a run (finished or running); returns its receipt.

function

hg.import_evaluation

(run, evaluator_id, *, step, values, outputs, attempt_id=None, snapshot_identity=None, snapshot_sha256=None, protocol=None)

Import measured scores at their source step without a checkpoint or plugin.

outputs maps the local IDs in values to label, unit and direction. Original attempt, snapshot and protocol metadata may be supplied when known. Repeating an identical import returns the existing receipt.

function

hg.interpolate

(v0, v1, steps=10, *, mode='slerp', t=None)

Perform linear or spherical linear interpolation between two latent vectors.

function

hg.audio

(tensor, *, rate)

Construct an Audio object from a 1D (mono) or 2D (channels, samples) tensor/array with sample rate.

Standalone Export, Inference & Observatory

14 symbols

Export standalone generators (bundle, safetensors, pt2, onnx), load EMA inference bundles, and manage the Web Observatory.

function

hg.export

(run=None, checkpoint='latest', output=None, format='bundle', include_example_inputs=False, device='cpu')

Export a standalone EMA inference model bundle from a run checkpoint.

function

hg.export_generator

(run_dir=None, output_path=None, format='bundle', include_example_inputs=False, checkpoint='latest', device='cpu')

Export standalone generator across bundle, safetensors, pt2, or onnx formats.

function

hg.extract_ema_bundle

(checkpoint_dir, manifest=None)

Extract EMA weights from checkpoint_dir into an in-memory bundle.

function

hg.load_inference

(target=None)

Verify and load a run's EMA inference bundle on CPU in evaluation mode.

Accepts an exported .pt bundle file, a run directory, slug, tag, short ID, or Run instance. Returns (state_dict, config_dict, ComponentGraph, prior, bundle_sha256).

class

hg.LoadedGenerator

(bundle: dict | Path | str, device: str = 'cpu')

Callable standalone generator module with baked particle table and inference helpers.

Methods
Method Signature Description
means () means helper method.
sigma (property) sigma helper method.
sample_latents (count: int, generator: torch.Generator | None = None, seed: int | None = None) -> torch.Tensor sample_latents helper method.
sample_prior (count: int, generator: torch.Generator | None = None, seed: int | None = None) -> torch.Tensor sample_prior helper method.
forward (z: torch.Tensor | None = None, inputs: dict | None = None, **kwargs) -> torch.Tensor forward helper method.
sample (count: int = 16, seed: int | None = None, inputs: dict | None = None, conditioning: dict | None = None) -> torch.Tensor sample helper method.
interpolate (seed_a: int | None = None, seed_b: int | None = None, steps: int = 10, *, z_a: torch.Tensor | None = None, z_b: torch.Tensor | None = None, mode: str = 'slerp', inputs: dict | None = None, conditioning: dict | None = None) -> torch.Tensor interpolate helper method.
to (*args, **kwargs) to helper method.
function

hg.view

(item, sampler, *, run=None)

Apply a sampler to a Sample: a name from the model's [samplers], a module:function path, or a callable. Returns what the sampler returns (Image/Audio for the built-in helpers).

function

hg.serve

(run_dir=None, port=None, host='127.0.0.1', auth='none', session_file=None, open_browser=False, public_origin=None, dev=False, bind=None)

Launch the Web Observatory server for a runs root or run directory.

function

hg.viewer_status

(run_dir=None)

Check the running status and port of a viewer process for a run or runs root.

function

hg.ensure_dashboard_running

(runs_root=None, check_version=True, run_id=None, *, host=None, port=None, auth=None, public_origin=None)

Ensure the persistent root dashboard is running for runs_root, returning its URL.

host, port, auth and public_origin are those of hypergan view; any left as None keeps the dashboard default.

function

hg.dashboard_status

(runs_root=None)

Query the status of the persistent Web Observatory dashboard for a runs root or run.

function

hg.stop_dashboard

(runs_root=None, timeout=8.0)

Stop the persistent Web Observatory dashboard for a runs root or run.

function

hg.stop_all_servers

(force=False)

Terminate all background viewer, dashboard, and supervisor processes on the host.

Multi-GPU Job Queue

7 symbols

Schedule, inspect, stop, and execute sequential or multi-GPU training queues and systemd user services.

function

hg.queue_add

(model_file, devices=None, run_dir=None, name=None, steps=None, sets=None, no_web=False, wait=False, queue_file=None, **kwargs)

Enqueue a training experiment or wait directive into the job queue.

function

hg.queue_ls

(status=None, queue_file=None)

List queued, running, and completed jobs from the job queue.

function

hg.queue_status

(job_id=None, queue_file=None, lines=20)

Check the execution status and recent logs of a queued job.

function

hg.queue_stop

(job_id=None, stop_all=False, queue_file=None)

Stop or cancel a queued job, or all jobs if stop_all=True.

function

hg.queue_run

(devices=None, poll_interval=5.0, once=False, queue_file=None, *, no_web=False)

Process and run jobs sequentially from the queue until drained (no_web: start no dashboard).

function

hg.queue_install_service

(user=True, devices=None, name=None, dry_run=False)

Generate or install a systemd service unit for the HyperGAN queue runner.

Diagnostics & Introspection

6 symbols

Describe model architectures, explain gradient routing, fingerprint configs, and introspect schema & HNDL operators.

function

hg.describe

alias: describe_model
(path=None, networks=False, write=False) -> 'ModelDescription'

Describe a model's formulation, losses, optimizers, and network architectures.

function

hg.operators

(query=None)

Return catalog of all 85 HNDL operators, optionally filtered by search query.

Data & Metrics Types

12 symbols

Typed dataclasses and structured return records exposed across the HyperGAN Python API.

dataclass

hg.Model

(spec: 'dict', base: 'Path | None' = None, path: 'Path | None' = None, origin: 'Path | None' = None) -> None

A model file's contents. base resolves relative hndl paths.

path is the file the spec was read from unchanged; origin is the file it came from even after override, so a fresh run is placed and named as hypergan train <file> would.

Fields
Field Type Default
spec dict required
base Path | None None
path Path | None None
origin Path | None None
Methods
Method Signature Description
name (property)
dataclass

hg.Run

(path: 'Path', manifest: 'dict') -> None

A run directory and the manifest it recorded.

Fields
Field Type Default
path Path required
manifest dict required
Methods
Method Signature Description
status (property) Current lifecycle status of the run (running, completed, stopped, etc.).
step (property) Latest recorded training step count.
stop_reason (property) Reason why training stopped (e.g. early_stop, max_seconds), if any.
config (property) Resolved configuration recorded in the run manifest.
fingerprint (property) Numerical recipe fingerprint (config_sha256).
run_id (property) Unique 32-character hexadecimal run identifier.
short_id (property) First 8 characters of the run identifier.
name (property) Human-readable experiment name or custom tag.
slug (property) Memorable '<adj>-<noun>' run slug.
dataclass

hg.Sample

(step: 'int', name: 'str', data: 'object', inputs: 'dict', particle_ids: 'list | None', source: 'str', path: 'Path', png: 'bytes | None' = None) -> None

Generated output recorded by a run, in whatever structure the model produces.

data holds the generated tensor (None when a large image preview was stored only as a PNG grid, then in png). inputs holds the batch conditioning it was generated from.

Fields
Field Type Default
step int required
name str required
data object required
inputs dict required
particle_ids list | None required
source str required
path Path required
png bytes | None None
dataclass

hg.Image

(pixels: 'bytes', width: 'int', height: 'int', channels: 'int') -> None

8-bit pixels, row-major HWC (1 or 3 channels).

Fields
Field Type Default
pixels bytes required
width int required
height int required
channels int required
Methods
Method Signature Description
png ()
save (path)
dataclass

hg.Audio

(samples: 'list', rate: 'int', channels: 'int' = 1) -> None

Mono or interleaved float samples in [-1, 1].

Fields
Field Type Default
samples list required
rate int required
channels int 1
Methods
Method Signature Description
save (path)
dataclass

hg.TrainResult

(run: 'Any', step: 'int' = 0, status: 'str' = 'completed', metrics: 'dict[str, Any]' = <factory>, checkpoint_path: 'Path | None' = None, stop_reason: 'str | None' = None) -> None

Encapsulates training execution results.

Fields
Field Type Default
run Any required
step int 0
status str 'completed'
metrics dict[str, Any] dict()
checkpoint_path Path | None None
stop_reason str | None None
Methods
Method Signature Description
run_dir (property)
run_id (property)
summary (property)
dataclass

hg.SampleResult

(path: 'Path', count: 'int' = 0, step: 'int' = 0, png: 'bytes | None' = None, data: 'Any' = None, inputs: 'dict[str, Any]' = <factory>) -> None

Encapsulates batch sampling output.

Fields
Field Type Default
path Path required
count int 0
step int 0
png bytes | None None
data Any None
inputs dict[str, Any] dict()
Methods
Method Signature Description
images (property)
output_path (property)
dataclass

hg.ModelDescription

(name: 'str' = '', family: 'str' = '', components: 'dict[str, Any]' = <factory>, losses: 'dict[str, Any]' = <factory>, optimizers: 'dict[str, Any]' = <factory>, prior: 'dict[str, Any]' = <factory>, training: 'dict[str, Any]' = <factory>, raw: 'dict[str, Any]' = <factory>) -> None

Encapsulates structured model description from describe().

Fields
Field Type Default
name str ''
family str ''
components dict[str, Any] dict()
losses dict[str, Any] dict()
optimizers dict[str, Any] dict()
prior dict[str, Any] dict()
training dict[str, Any] dict()
raw dict[str, Any] dict()
dataclass

hg.ValidationWarning

(message: 'str', field: 'str | None' = None, level: 'str' = 'warning')

Encapsulates diagnostic validation entries.

Fields
Field Type Default
message str required
field str | None None
level str 'warning'
dataclass

hg.RunStatus

(run_id: 'str', status: 'str', step: 'int | None' = None, total_steps: 'int | None' = None, percent: 'float | None' = None, steps_per_sec: 'float | None' = None, eta_seconds: 'float | None' = None, devices: 'str' = 'cpu', best_metric: 'dict[str, Any] | None' = None, recent_checkpoints: 'list[dict[str, Any]]' = <factory>, warnings: 'list[str]' = <factory>, slug: 'str | None' = None, raw: 'dict[str, Any]' = <factory>) -> None

Encapsulates status() inspection summary.

Fields
Field Type Default
run_id str required
status str required
step int | None None
total_steps int | None None
percent float | None None
steps_per_sec float | None None
eta_seconds float | None None
devices str 'cpu'
best_metric dict[str, Any] | None None
recent_checkpoints list[dict[str, Any]] list()
warnings list[str] list()
slug str | None None
raw dict[str, Any] dict()
Methods
Method Signature Description
device (property)
pid (property)
dataclass

hg.PsSnapshot

(runs: 'list[RunStatus]' = <factory>, queued: 'list[dict[str, Any]]' = <factory>, active_count: 'int' = 0, total_known: 'int' = 0) -> None

Encapsulates ps() listing enriched with process metrics.

Fields
Field Type Default
runs list[RunStatus] list()
queued list[dict[str, Any]] list()
active_count int 0
total_known int 0
Methods
Method Signature Description
total_count (property)
completed_count (property)
dataclass

hg.RunInfo

(run_id: 'str', run_dir: 'Path', created_at: 'Optional[str]' = None, status: 'str' = 'unknown', step: 'int' = 0, total_steps: 'Optional[int]' = None, config: 'Dict[str, Any]' = <factory>, latest_metrics: 'Dict[str, float]' = <factory>, best_metric: 'Optional[Dict[str, Any]]' = None, checkpoints: 'List[Dict[str, Any]]' = <factory>, health_alerts: 'List[str]' = <factory>, telemetry_trends: 'Dict[str, Any]' = <factory>, name: 'Optional[str]' = None, slug: 'Optional[str]' = None, short_id: 'Optional[str]' = None, pid: 'Optional[int]' = None, steps_per_second: 'Optional[float]' = None, eta_seconds: 'Optional[float]' = None, evaluations: 'List[Dict[str, Any]]' = <factory>, stop_reason: 'Optional[str]' = None) -> None

RunInfo(run_id: 'str', run_dir: 'Path', created_at: 'Optional[str]' = None, status: 'str' = 'unknown', step: 'int' = 0, total_steps: 'Optional[int]' = None, config: 'Dict[str, Any]' = <factory>, latest_metrics: 'Dict[str, float]' = <factory>, best_metric: 'Optional[Dict[str, Any]]' = None, checkpoints: 'List[Dict[str, Any]]' = <factory>, health_alerts: 'List[str]' = <factory>, telemetry_trends: 'Dict[str, Any]' = <factory>, name: 'Optional[str]' = None, slug: 'Optional[str]' = None, short_id: 'Optional[str]' = None, pid: 'Optional[int]' = None, steps_per_second: 'Optional[float]' = None, eta_seconds: 'Optional[float]' = None, evaluations: 'List[Dict[str, Any]]' = <factory>, stop_reason: 'Optional[str]' = None)

Fields
Field Type Default
run_id str required
run_dir Path required
created_at Optional[str] None
status str 'unknown'
step int 0
total_steps Optional[int] None
config Dict[str, Any] dict()
latest_metrics Dict[str, float] dict()
best_metric Optional[Dict[str, Any]] None
checkpoints List[Dict[str, Any]] list()
health_alerts List[str] list()
telemetry_trends Dict[str, Any] dict()
name Optional[str] None
slug Optional[str] None
short_id Optional[str] None
pid Optional[int] None
steps_per_second Optional[float] None
eta_seconds Optional[float] None
evaluations List[Dict[str, Any]] list()
stop_reason Optional[str] None
Methods
Method Signature Description
is_active (property)
to_dict () -> 'Dict[str, Any]'

Exceptions

4 symbols

Structured exception types raised by configuration validation, offline cache enforcement, and run control.