MLServe.Bootstrap (MLServe v0.1.3)

Copy Markdown View Source

Loads the models declared in application configuration when MLServe starts.

A transient one-shot process rather than logic inside the application callback. Loading models from start/2 would mean a bad model configuration prevents the whole application from booting — including the parts that have nothing to do with inference, and including the health-check endpoint that would tell you why.

In :async mode (the default) it registers each model and returns immediately; models load in the background and report through MLServe.model_status/2. In :sync mode it waits for every model to become ready or fail, which is what you want in tests and short-lived scripts.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

arg is passed as the argument to Task.start_link/1 in the :start field of the spec.

For more information, see the Supervisor module, the Supervisor.child_spec/2 function and the Supervisor.child_spec/0 type.