Registry / ai-ml / mlx-embeddings

mlx-embeddings

JSON →
library0.1.0pypypiunverified

MLX-Embeddings is a Python package for generating text and vision embeddings locally on Apple Silicon Macs using MLX. It supports models like BERT, CLIP, and SigLIP, optimized for Apple's Metal Performance Shaders. Version 0.1.0 is the initial release, with modular backends.

pip install mlx-embeddings
INSTALL
IMPORT
SIG · MLX-EMBEDDINGS
M
mlx-embeddings
ai-mlpythonv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TextEmbedding
from mlx_embeddings import TextEmbedding
from mlx_embeddings import TextEmbedding

Quickstart example: create a text embedding model and encode a sentence.

from mlx_embeddings import TextEmbedding import os # Create a text embedding object for a BERT model embedder = TextEmbedding(model_name="bert-base-uncased") # Generate embeddings for a sentence embeddings = embedder.embed(["Hello world"]) print(embeddings.shape) # For vision models: # from mlx_embeddings import ImageEmbedding # image_embedder = ImageEmbedding(model_name="openai/clip-vit-base-patch32") # image_embeddings = image_embedder.embed(["path/to/image.jpg"])
Debug
Known issues
gotchaMLX-Embeddings only works on Apple Silicon (M1/M2/M3) Macs. Execution on Intel Macs or other platforms will fail with a runtime error.
fix
Ensure you are on a Mac with Apple Silicon (ARM64).
affects: 0.1.0
gotchaThe package auto-downloads model weights from Hugging Face. The first run for each model will download several hundred MB to GB of data, which may fail without an internet connection or sufficient disk space.
fix
Pre-download models using huggingface_hub or ensure stable internet on first use.
affects: 0.1.0
gotchaVision models (ImageEmbedding) require Pillow. Without it, importing or using ImageEmbedding may raise ModuleNotFoundError.
fix
Install optional dependency: pip install mlx-embeddings[vision] or pip install pillow.
affects: 0.1.0
Upgrade
Version history
0.1.0latest on PyPI · released Mar 24, 2026
Audit
Dependencies
mlxrequiredRequired for running models on Apple Silicon.
pillowoptionalRequired for image processing in vision models.
Agent activity
15 hits · last 30 days
node
8
Amazon
1
Resources
mlx-embeddings — pip install mlx-embeddings · libregistry