nomicai-modernbert-embed-base-4bit

295
4.0B
2 languages
license:apache-2.0
by
mlx-community
Embedding Model
OTHER
4B params
New
295 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
9GB+ RAM
Mobile
Laptop
Server
Quick Summary

The Model mlx-community/nomicai-modernbert-embed-base-4bit was converted to MLX format from nomic-ai/modernbert-embed-base using mlx-lm version 0.

Device Compatibility

Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
4GB+ RAM

Code Examples

Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxbash
pip install mlx-embeddings
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)
Use with mlxpython
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/nomicai-modernbert-embed-base-4bit")

# For text embeddings
output = generate(model, processor, texts=["I like grapes", "I like fruits"])
embeddings = output.text_embeds  # Normalized embeddings

# Compute dot product between normalized embeddings
similarity_matrix = mx.matmul(embeddings, embeddings.T)

print("Similarity matrix between texts:")
print(similarity_matrix)

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.