Ragex.Embeddings.Bumblebee (Ragex v0.31.0)

View Source

Embedding adapter using Bumblebee with configurable models.

Supports multiple embedding models from the Registry:

  • all_minilm_l6_v2 (default): 384-dimensional, fast
  • all_mpnet_base_v2: 768-dimensional, high quality
  • codebert_base: 768-dimensional, code-specific
  • paraphrase_multilingual: 384-dimensional, multilingual

Model is configured via config.exs or RAGEX_EMBEDDING_MODEL environment variable. Model weights are downloaded on first use and cached locally.

Summary

Functions

Returns true when the optional ML dependencies (bumblebee, nx, exla) are compiled and loadable.

Returns a specification to start this module under a supervisor.

Returns the current model information.

Returns true if the model is loaded and ready.

Functions

available?()

@spec available?() :: boolean()

Returns true when the optional ML dependencies (bumblebee, nx, exla) are compiled and loadable.

These are native/NIF-backed dependencies that cannot be loaded from inside an escript archive, so callers embedding Ragex as a library should check this before relying on embedding/semantic-search features.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

model_info()

@spec model_info() :: map() | {:error, term()}

Returns the current model information.

ready?()

@spec ready?() :: boolean()

Returns true if the model is loaded and ready.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()