Manages embedding and LLM models for vector search and summarization.
Handles model download, caching, lazy loading, and inference.
Summary
Functions
The resolved ML backend (:exla or :emlx).
Returns a specification to start this module under a supervisor.
Generates embeddings for the given texts.
Returns the status of both models.
Generates a summary for the given prompt.
Types
@type model_ref() :: %{ tokenizer: Bumblebee.Tokenizer.t(), model: term(), config: map(), serving: module(), chat_template: String.t() }
Functions
@spec backend() :: :exla | :emlx
The resolved ML backend (:exla or :emlx).
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec embed([String.t()]) :: {:ok, [Nx.Tensor.t()]} | {:error, term()}
Generates embeddings for the given texts.
Returns {:error, :model_loading} when the model is not ready and has not
become ready within the configured load grace (Config.model_load_grace_ms/0). That is distinct from a
load that failed, and the call is safe to repeat.
@spec model_status() :: map()
Returns the status of both models.
@spec start_link(keyword()) :: GenServer.on_start()
Generates a summary for the given prompt.
Returns {:error, :model_loading} when the model is not ready and has not
become ready within the configured load grace (Config.model_load_grace_ms/0).