Instructions to use keras/mxbai_embed_large_v1_en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/mxbai_embed_large_v1_en with KerasHub:
import keras_hub # Load TextClassifier model text_classifier = keras_hub.models.TextClassifier.from_preset( "hf://keras/mxbai_embed_large_v1_en", num_classes=2, ) # Fine-tune text_classifier.fit(x=["Thilling adventure!", "Total snoozefest."], y=[1, 0]) # Classify text text_classifier.predict(["Not my cup of tea."])import keras_hub # Create a MaskedLM model task = keras_hub.models.MaskedLM.from_preset("hf://keras/mxbai_embed_large_v1_en")import keras_hub # Create a TextEmbedder model task = keras_hub.models.TextEmbedder.from_preset("hf://keras/mxbai_embed_large_v1_en")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/mxbai_embed_large_v1_en") - Keras
How to use keras/mxbai_embed_large_v1_en with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://keras/mxbai_embed_large_v1_en") - Notebooks
- Google Colab
- Kaggle
Model Overview
Model Overview
MxbAI Embed is a family of state-of-the-art sentence embedding models by mixedbread-ai. These models map text into high-quality dense vector representations suitable for semantic search, retrieval-augmented generation (RAG), clustering, and classification tasks.
All MxbAI Embed models support Matryoshka Representation Learning (MRL), which allows flexible dimensionality reduction — you can truncate the output embeddings to smaller sizes (e.g., 512, 256) while retaining strong performance. This enables a cost-performance tradeoff at inference time without retraining.
The family includes English, German, and efficiency-focused variants, ranging from ultra-compact (24M parameters) to large-scale (340M parameters).
Key features:
- High-quality dense sentence embeddings via BERT-based architectures
- Matryoshka Representation Learning for flexible embedding dimensions
- 2D-Matryoshka variant with both layer and dimension reduction
- Optimized for semantic search, retrieval, clustering, and classification
References:
More Details
- [Mxbai Embedding Quickstart Notebook](coming soon..!)
- Mxbai Embedding API Documentation
- Mxbai Embedding Model Card
- KerasHub Beginner Guide
- KerasHub Model Publishing Guide
Installation
Keras and KerasHub can be installed with:
pip install -U -q keras-hub
pip install -U -q keras
Jax, TensorFlow, and Torch come preinstalled in Kaggle Notebooks. For instructions on installing them in another environment see the Keras Getting Started page.
Preset Table
| Preset name | Parameters | Description | Base Architecture |
|---|---|---|---|
mxbai_embed_large_en |
335,141,888 | 24-layer MxbAI Embed large English model. Maps sentences to 1024-dimensional dense vectors with Matryoshka representation learning. Trained on high-quality English data. Top-ranked open-source embedding model on the MTEB leaderboard. | BERT-large |
mxbai_embed_2d_large_en |
335,141,888 | 24-layer MxbAI Embed 2D-Matryoshka large English model. Maps sentences to 1024-dimensional dense vectors. Supports both embedding dimension reduction and transformer layer reduction for flexible performance-efficiency tradeoffs. | BERT-large |
mxbai_embed_xsmall_en |
22,713,216 | 6-layer MxbAI Embed extra-small English model. Maps sentences to 384-dimensional dense vectors with Matryoshka representation learning. Ultra-fast and compact, based on MiniLM-L6-v2 architecture. | MiniLM-L6-v2 |
- Downloads last month
- -