elixir-nx/bumblebee

Pre-trained Neural Network models in Axon (+ 🤗 Models integration)

What it solves

Bumblebee allows Elixir developers to use pre-trained neural network models without needing to write complex machine learning code from scratch. It acts as an Elixir counterpart to the Python Transformers library, enabling the loading and execution of models from the Hugging Face Hub.

How it works

Bumblebee builds on top of Axon and integrates with the Hugging Face Hub to download model configurations and trained parameters. It supports importing models in PyTorch and Safetensors formats. To run models efficiently, it uses EXLA for just-in-time compilation and execution on CPUs or GPUs.

Who it’s for

Elixir developers who want to integrate machine learning tasks—such as text classification, image classification, and text generation—into their applications (e.g., Phoenix and LiveView apps) or interactive notebooks like Livebook.

Highlights

  • Hugging Face Integration: Directly load models and tokenizers from the Hugging Face Hub using a few lines of code.
  • Hardware Acceleration: Supports GPU execution via EXLA.
  • End-to-End Pipelines: Provides high-level APIs for common tasks (e.g., Bumblebee.Text.fill_mask) and serving pipelines for easy deployment.
  • Broad Model Support: Implements various neural network architectures, including BERT and Stable Diffusion, allowing users to load matching pre-trained weights.

Related