Imp.Clients.TRLDeployment (Imp v0.5.0)

Copy Markdown View Source

Runs a verified TRL LoRA artifact through a caller-supplied trusted runtime.

A saved TrainingJob owns the immutable artifact and base-model identity. The caller reconstructs the pinned TRLTrainer runtime explicitly; executable paths are never restored from the saved job. Startup verifies the complete artifact in Elixir, initializes the exact trainer model, and asks the pinned worker to load the saved adapter. The worker must report the same artifact identity and adapter-tensor digest retained at training time before the returned LM can generate.

Summary

Functions

Loads a verified completed TRL job into a trusted pinned trainer runtime.

Starts the exact pinned base policy for evaluation before training.

Stops the worker serving a deployment or completed TRL job.

Types

t()

@type t() :: %Imp.Clients.TRLDeployment{
  adapter_sha256: String.t() | nil,
  artifact_path: Path.t(),
  artifact_sha256: String.t(),
  kind: :base | :adapter,
  lm: Imp.Clients.TRLLM.t(),
  worker: pid()
}

Functions

start(job, trainer)

@spec start(Imp.Clients.TrainingJob.t(), Imp.Clients.TRLTrainer.t()) ::
  {:ok, t()} | {:error, term()}

Loads a verified completed TRL job into a trusted pinned trainer runtime.

start_base(trainer)

@spec start_base(Imp.Clients.TRLTrainer.t()) :: {:ok, t()} | {:error, term()}

Starts the exact pinned base policy for evaluation before training.

stop(job)

@spec stop(t() | Imp.Clients.TrainingJob.t()) :: :ok | {:error, term()}

Stops the worker serving a deployment or completed TRL job.