Ragex.Embeddings.Bumblebee (Ragex v0.38.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 information about the EXLA execution backend and CUDA status.

Returns a specification to start this module under a supervisor.

Returns true when CUDA GPU acceleration is available via EXLA.

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.

backend_info()

@spec backend_info() :: map()

Returns information about the EXLA execution backend and CUDA status.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

cuda_available?()

@spec cuda_available?() :: boolean()

Returns true when CUDA GPU acceleration is available via EXLA.

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()