Supervised local serving for a verified fused MLXLMTrainer artifact.
start/2 revalidates the complete fused tree, launches the pinned
mlx_lm.server command recorded by the training job, and succeeds only when
/v1/models advertises the exact fused path. The returned ReqLLM is therefore
bound to verified trained bytes rather than a model-name substitution.
Every launch receives a new empty, deployment-owned Hugging Face, Transformers, and XDG cache environment. The server still receives the verified local artifact path explicitly; ambient model catalogs cannot add a second advertised identity. The owned cache is removed after startup failure, explicit stop, server exit, or application shutdown.
Deployments are shared per fused artifact inside the Imp application and can
be stopped explicitly with stop/1. Application shutdown also terminates the
supervised external process group.
Summary
Functions
Returns the live deployment for a job, if one exists.
Starts or reuses the supervised server for a completed fused MLX job.
Stops the supervised server for a deployment or completed MLX job.
Types
@type t() :: %Imp.Clients.MLXLMDeployment{ artifact_path: Path.t(), artifact_sha256: String.t(), base_url: String.t(), lm: Imp.Clients.ReqLLM.t(), pid: pid() }
Functions
@spec lookup(Imp.Clients.TrainingJob.t()) :: {:ok, t()} | :error
Returns the live deployment for a job, if one exists.
@spec start(Imp.Clients.TrainingJob.t(), keyword()) :: {:ok, t()} | {:error, term()}
Starts or reuses the supervised server for a completed fused MLX job.
@spec stop(t() | Imp.Clients.TrainingJob.t()) :: :ok | {:error, term()}
Stops the supervised server for a deployment or completed MLX job.