---
title: all-MiniLM-L6-v2-8bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/all-MiniLM-L6-v2-8bit"
md_url: "https://www.modelscope.cn/models/mlx-community/all-MiniLM-L6-v2-8bit.md"
repository: mlx-community/all-MiniLM-L6-v2-8bit
last_updated: 2025-04-02
license: apache-2.0
pipeline_tag: sentence-similarity
tasks:
  - sentence-similarity
model_type:
  - bert
architectures:
  - BertModel
parameters: 6.4M
tensor_type:
  - U32
  - F16
library_name:
  - sentence-transformers
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
inference_backends:
  - "deploy_task emb"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 458
stars: 0
tags:
  - sentence-transformers
  - feature-extraction
  - sentence-similarity
  - transformers
  - mlx
---

# all-MiniLM-L6-v2-8bit

> all-MiniLM-L6-v2-8bit - mlx-community 在 ModelScope 开源的模型。mlx-community/all-MiniLM-L6-v2-8bit

mlx-community/all-MiniLM-L6-v2-8bit 是 ModelScope 魔搭社区上的 6.4M 参数sentence-similarity模型，采用 apache-2.0 许可，可用 deploy_task emb、sglang 0.5.2、vllm 0.9.2 部署。

- **Repository**: mlx-community/all-MiniLM-L6-v2-8bit
- **License**: apache-2.0
- **Tasks**: sentence-similarity
- **Parameters**: 6.4M
- **Inference backends**: deploy_task emb, sglang 0.5.2, vllm 0.9.2
- **Tags**: sentence-transformers, feature-extraction, sentence-similarity, transformers, mlx
- **Downloads**: 458
- **Stars**: 0
- **Last updated**: 2025-04-02

Source: https://www.modelscope.cn/models/mlx-community/all-MiniLM-L6-v2-8bit

---

# mlx-community/all-MiniLM-L6-v2-8bit

The Model [mlx-community/all-MiniLM-L6-v2-8bit](https://huggingface.co/mlx-community/all-MiniLM-L6-v2-8bit) was converted to MLX format from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) using mlx-lm version **0.0.3**.

## Use with mlx

```bash
pip install mlx-embeddings
```

```python
from mlx_embeddings import load, generate
import mlx.core as mx

model, tokenizer = load("mlx-community/all-MiniLM-L6-v2-8bit")

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


```
