MLServe.ModelSupervisor (MLServe v0.1.3)

Copy Markdown View Source

DynamicSupervisor holding one MLServe.ModelInstance per loaded {name, version}.

Models arrive and leave at runtime — from configuration at boot, from MLServe.load_model/2 during a deploy, from a version promotion — which is exactly what a dynamic supervisor is for. Because each child is a whole subtree, two versions of the same model coexist as independent siblings, which is what makes canary rollout and drain-on-unload possible.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the supervision subtree for a model version.

Stops the supervision subtree for a model version.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_model(spec)

Starts the supervision subtree for a model version.

stop_model(name, version)

@spec stop_model(atom(), String.t()) :: :ok | {:error, :not_found}

Stops the supervision subtree for a model version.