Sentence Similarity
sentence-transformers
Safetensors
nandi_encoder
embeddings
feature-extraction
mteb
retrieval
multilingual
indic
long-context
frontiersmind
nandi
custom_code
Instructions to use FrontiersMind/EmbeddingNandi-450M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use FrontiersMind/EmbeddingNandi-450M with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("FrontiersMind/EmbeddingNandi-450M", trust_remote_code=True) sentences = [ "task: sentence similarity | query: How do I return a damaged product?", "task: sentence similarity | query: खराब सामान वापस कैसे करें?", "task: sentence similarity | query: damaged product wapas kaise kare?", "task: sentence similarity | query: What is the weather like today?" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Model card: harrier-oss Indic only, move harrier and multilingual-e5 to end of tables
Browse files
README.md
CHANGED
|
@@ -18,15 +18,13 @@ language:
|
|
| 18 |
- ar
|
| 19 |
- id
|
| 20 |
- ms
|
| 21 |
-
library_name:
|
| 22 |
-
pipeline_tag:
|
| 23 |
base_model: FrontiersMind/NandiBERT-450M
|
| 24 |
tags:
|
| 25 |
- embeddings
|
| 26 |
- sentence-transformers
|
| 27 |
- sentence-similarity
|
| 28 |
-
- feature-extraction
|
| 29 |
-
- mteb
|
| 30 |
- retrieval
|
| 31 |
- multilingual
|
| 32 |
- indic
|
|
@@ -52,7 +50,7 @@ tags:
|
|
| 52 |
<b>Authors:</b> <a href="https://frontiersmind.ai">FrontiersMind</a>
|
| 53 |
</p>
|
| 54 |
|
| 55 |
-
EmbeddingNandi is a family of open, long-context embedding models for English, Indic and
|
| 56 |
|
| 57 |
| Model | Parameters | Hidden | Context | Base encoder | Description |
|
| 58 |
|---|---|---|---|---|---|
|
|
@@ -61,7 +59,7 @@ EmbeddingNandi is a family of open, long-context embedding models for English, I
|
|
| 61 |
|
| 62 |
## Description
|
| 63 |
|
| 64 |
-
- **One Model. From English to Indic and Beyond:** Built on NandiBERT-450M, which covers English,
|
| 65 |
- **32K context:** A 32,768-token window, so full contracts, reports and papers can be embedded in a single pass without chunking, with the 100K-token multilingual vocabulary shared across the NandiBERT family.
|
| 66 |
- **Deep, with efficient attention:** Inherited from NandiBERT-450M: 28 layers at 1,024 hidden size, with QK-norm and SwiGLU. Grouped-query attention with 8 query heads and 2 key-value heads keeps memory low on long inputs. The 100K-token vocabulary is stored as a rank-512 factorized embedding.
|
| 67 |
- **Embedding output:** 1,024-dimensional vectors. Mean pooling over all tokens (task prompt included), then L2 normalization, compared with cosine similarity. Trained with Matryoshka Representation Learning, so vectors can be cut to 768, 512, 256 or 128 dimensions.
|
|
@@ -71,69 +69,63 @@ EmbeddingNandi is a family of open, long-context embedding models for English, I
|
|
| 71 |
|
| 72 |
## Benchmark Results
|
| 73 |
|
| 74 |
-
Mean task scores on MTEB
|
| 75 |
|
| 76 |
-
| Model | MTEB(eng, v2) | MTEB(Code, v1) | MTEB(Indic, v1) | Average (all three) |
|
| 77 |
|---|---|---|---|---|
|
| 78 |
-
| **EmbeddingNandi-450M (
|
| 79 |
-
| EmbeddingGemma 2 (271M) | 67.53 | **
|
| 80 |
-
| Qwen3-Embedding-0.6B (596M) | 70.
|
| 81 |
-
|
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
| multilingual-e5-large-instruct (560M) | 65.
|
| 85 |
-
| LFM2.5-Embedding-350M (354M) | 60.33 | 44.27 | 34.94 | 46.51 |
|
| 86 |
|
| 87 |
<details>
|
| 88 |
-
<summary>MTEB(
|
| 89 |
|
| 90 |
-
| Model | Mean (
|
| 91 |
|---|---|---|---|---|---|---|---|---|
|
| 92 |
-
| **EmbeddingNandi-450M (
|
| 93 |
-
| EmbeddingGemma 2 (271M) |
|
| 94 |
-
| Qwen3-Embedding-0.6B (596M) |
|
| 95 |
-
|
|
| 96 |
-
|
|
| 97 |
-
| pplx-embed-v1-0.6b (596M) | 63.83 | 68.60 | 62.91 | 26.56 | 64.34 | 86.30 | 83.54 | 40.22 |
|
| 98 |
-
| multilingual-e5-large-instruct (560M) | 69.64 | 80.25 | 66.62 | 51.41 | 74.54 | 85.89 | 84.51 | 51.94 |
|
| 99 |
-
| LFM2.5-Embedding-350M (354M) | 34.94 | 3.73 | 47.10 | 3.53 | 51.84 | 45.67 | 16.11 | -7.06 |
|
| 100 |
|
| 101 |
</details>
|
| 102 |
|
| 103 |
<details>
|
| 104 |
-
<summary>MTEB(
|
| 105 |
|
| 106 |
-
|
|
| 107 |
-
|---|---|---|---|---|---|---|
|
| 108 |
-
|
|
| 109 |
-
|
|
| 110 |
-
|
|
| 111 |
-
|
|
| 112 |
-
|
|
| 113 |
-
|
|
| 114 |
-
|
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
</details>
|
| 118 |
|
| 119 |
<details>
|
| 120 |
-
<summary>MTEB(
|
| 121 |
|
| 122 |
-
|
|
| 123 |
|---|---|---|---|---|---|---|---|---|
|
| 124 |
-
|
|
| 125 |
-
|
|
| 126 |
-
|
|
| 127 |
-
|
|
| 128 |
-
|
|
| 129 |
-
|
|
| 130 |
-
| CodeSearchNetRetrieval | 89.42 | **90.78** | 89.95 | 82.75 | 88.58 | 89.80 | 85.29 | 72.48 |
|
| 131 |
-
| CodeTransOceanContest | 85.87 | 83.67 | 86.21 | 81.05 | **89.12** | 86.35 | 74.73 | 56.90 |
|
| 132 |
-
| CodeTransOceanDL | 36.36 | 36.36 | 33.23 | 36.10 | **37.48** | 36.83 | 31.09 | 22.33 |
|
| 133 |
-
| CosQA | 43.11 | **51.40** | 40.65 | 34.92 | 39.84 | 43.60 | 36.36 | 29.14 |
|
| 134 |
-
| COIRCodeSearchNetRetrieval | 85.84 | **86.89** | 84.19 | 75.42 | 82.13 | 82.38 | 62.33 | 37.94 |
|
| 135 |
-
| StackOverflowQA | 92.98 | 87.38 | 89.23 | 89.08 | **93.75** | 90.69 | 91.11 | 81.60 |
|
| 136 |
-
| SyntheticText2SQL | 69.76 | 65.96 | 73.85 | 64.79 | **74.39** | 59.12 | 62.56 | 40.95 |
|
| 137 |
|
| 138 |
</details>
|
| 139 |
|
|
@@ -222,19 +214,9 @@ print(model.similarity(embs, embs))
|
|
| 222 |
|
| 223 |
### 2. Matryoshka Dimension Truncation
|
| 224 |
|
| 225 |
-
EmbeddingNandi-450M is trained with Matryoshka Representation Learning, so the 1,024-dimensional vector can be shortened by keeping only its first values. The supported sizes are 1024, 768, 512, 256 and 128
|
| 226 |
-
|
| 227 |
-
Scores at each size on a 28-task subset of the three benchmarks (13 English, 6 Code and 9 Indic tasks; `bfloat16`, inputs up to 1,024 tokens, vectors re-normalized after truncation):
|
| 228 |
|
| 229 |
-
|
| 230 |
-
|---|---|---|---|---|---|---|
|
| 231 |
-
| 1024 | 100% | **67.41** | **73.73** | **80.29** | **73.81** | 0.00 |
|
| 232 |
-
| 768 | 75% | 67.23 | 73.56 | 80.09 | 73.63 | -0.18 |
|
| 233 |
-
| 512 | 50% | 66.99 | 73.20 | 79.89 | 73.36 | -0.45 |
|
| 234 |
-
| 256 | 25% | 66.80 | 72.60 | 79.33 | 72.91 | -0.90 |
|
| 235 |
-
| 128 | 12.5% | 65.86 | 70.89 | 78.05 | 71.60 | -2.21 |
|
| 236 |
-
|
| 237 |
-
* **Re-normalize after truncating:** a cut unit-length vector is no longer unit length, so normalize it again before you store it or compare it with a dot product. Cosine similarity gives the same ranking either way. In our checks, cut vectors compared with a dot product without re-normalizing lost 0.5 to 2 points.
|
| 238 |
* **Queries and documents must use the same size.**
|
| 239 |
|
| 240 |
Pass `truncate_dim` and `normalize_embeddings=True` to let Sentence Transformers do both:
|
|
@@ -246,13 +228,10 @@ print(query_embs.shape)
|
|
| 246 |
# (3, 256)
|
| 247 |
```
|
| 248 |
|
| 249 |
-
Or set the size once when loading the model
|
| 250 |
|
| 251 |
```python
|
| 252 |
model_256 = SentenceTransformer("FrontiersMind/EmbeddingNandi-450M", trust_remote_code=True, truncate_dim=256)
|
| 253 |
-
query_embs = model_256.encode_query(queries, normalize_embeddings=True)
|
| 254 |
-
print(query_embs.shape)
|
| 255 |
-
# (3, 256)
|
| 256 |
```
|
| 257 |
|
| 258 |
### 3. Long Inputs
|
|
@@ -265,7 +244,7 @@ model.max_seq_length = 1024
|
|
| 265 |
|
| 266 |
### 4. Numerical Precision
|
| 267 |
|
| 268 |
-
Run inference in `bfloat16` or `float32`. The weights are stored in `bfloat16`. Use `float32` on CPU and for very long inputs (16K tokens or more).
|
| 269 |
|
| 270 |
```python
|
| 271 |
import torch
|
|
@@ -339,29 +318,11 @@ print(scores)
|
|
| 339 |
|
| 340 |
</details>
|
| 341 |
|
| 342 |
-
## Model Description
|
| 343 |
-
|
| 344 |
-
| | |
|
| 345 |
-
|---|---|
|
| 346 |
-
| Base model | [NandiBERT-450M](https://huggingface.co/FrontiersMind/NandiBERT-450M) |
|
| 347 |
-
| Parameters | 445M |
|
| 348 |
-
| Layers / hidden size | 28 / 1,024 |
|
| 349 |
-
| Attention | Grouped-query, 8 query heads and 2 key-value heads |
|
| 350 |
-
| Embedding dimension | 1,024 (Matryoshka: 768, 512, 256, 128) |
|
| 351 |
-
| Pooling | Mean over all tokens, task prompt included |
|
| 352 |
-
| Similarity | Cosine (L2-normalized output) |
|
| 353 |
-
| Max sequence length | 32,768 tokens |
|
| 354 |
-
| Vocabulary | 100,352 tokens |
|
| 355 |
-
| Weights | `bfloat16` |
|
| 356 |
-
| Prompt format | `task: {task} \| query: {text}` for queries and symmetric tasks, `title: none \| text: {text}` for documents |
|
| 357 |
-
| Languages | English; 13 Indic languages in native script (Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Odia, Punjabi, Tamil, Telugu, Urdu) and romanized Indic text such as Hinglish; Arabic, Indonesian, Malay |
|
| 358 |
-
| License | Apache 2.0 |
|
| 359 |
-
|
| 360 |
## Citation
|
| 361 |
|
| 362 |
```bibtex
|
| 363 |
@misc{frontiersmind2026embeddingnandi,
|
| 364 |
-
title = {EmbeddingNandi: Open Long-Context Embedding Models for English, Indic and
|
| 365 |
author = {{FrontiersMind}},
|
| 366 |
year = {2026},
|
| 367 |
howpublished = {\url{https://huggingface.co/FrontiersMind/EmbeddingNandi-450M}}
|
|
|
|
| 18 |
- ar
|
| 19 |
- id
|
| 20 |
- ms
|
| 21 |
+
library_name: transformers
|
| 22 |
+
pipeline_tag: feature-extraction
|
| 23 |
base_model: FrontiersMind/NandiBERT-450M
|
| 24 |
tags:
|
| 25 |
- embeddings
|
| 26 |
- sentence-transformers
|
| 27 |
- sentence-similarity
|
|
|
|
|
|
|
| 28 |
- retrieval
|
| 29 |
- multilingual
|
| 30 |
- indic
|
|
|
|
| 50 |
<b>Authors:</b> <a href="https://frontiersmind.ai">FrontiersMind</a>
|
| 51 |
</p>
|
| 52 |
|
| 53 |
+
EmbeddingNandi is a family of open, long-context embedding models for English, Indic and South-East Asian languages, built on the [NandiBERT](https://huggingface.co/FrontiersMind/NandiBERT-450M) bidirectional encoders. They turn text in English, Indic languages and other widely used languages into dense vectors for semantic search, retrieval-augmented generation, clustering and similarity.
|
| 54 |
|
| 55 |
| Model | Parameters | Hidden | Context | Base encoder | Description |
|
| 56 |
|---|---|---|---|---|---|
|
|
|
|
| 59 |
|
| 60 |
## Description
|
| 61 |
|
| 62 |
+
- **One Model. From English to Indic and Beyond:** Built on NandiBERT-450M, which covers English, 11 Indic languages in native script and romanized form, with Southeast Asian languages and Middle-East Languages, so a single embedding model serves queries and documents across these languages.
|
| 63 |
- **32K context:** A 32,768-token window, so full contracts, reports and papers can be embedded in a single pass without chunking, with the 100K-token multilingual vocabulary shared across the NandiBERT family.
|
| 64 |
- **Deep, with efficient attention:** Inherited from NandiBERT-450M: 28 layers at 1,024 hidden size, with QK-norm and SwiGLU. Grouped-query attention with 8 query heads and 2 key-value heads keeps memory low on long inputs. The 100K-token vocabulary is stored as a rank-512 factorized embedding.
|
| 65 |
- **Embedding output:** 1,024-dimensional vectors. Mean pooling over all tokens (task prompt included), then L2 normalization, compared with cosine similarity. Trained with Matryoshka Representation Learning, so vectors can be cut to 768, 512, 256 or 128 dimensions.
|
|
|
|
| 69 |
|
| 70 |
## Benchmark Results
|
| 71 |
|
| 72 |
+
Mean task scores on MTEB. EmbeddingNandi-450M is evaluated with the task prompts saved in the model. Scores for the other models (up to 600M parameters) are their official MTEB results; "-" means the model has not reported every task of that benchmark. Average is the mean of the three benchmark scores, for models that report all three. Best score in each column is in bold.
|
| 73 |
|
| 74 |
+
| Model | MTEB(eng, v2), 41 tasks | MTEB(Code, v1), 12 tasks | MTEB(Indic, v1), 20 tasks | Average (all three) |
|
| 75 |
|---|---|---|---|---|
|
| 76 |
+
| **EmbeddingNandi-450M (450M)** | 67.34 | 76.68 | **76.68** | **73.57** |
|
| 77 |
+
| EmbeddingGemma 2 (271M) | 67.53 | **77.88** | - | - |
|
| 78 |
+
| Qwen3-Embedding-0.6B (596M) | **70.47** | 75.42 | 65.32 | 70.40 |
|
| 79 |
+
| pplx-embed-v1-0.6b (596M) | - | 75.85 | - | - |
|
| 80 |
+
| granite-embedding-311m-multilingual-r2 (312M) | - | 63.84 | - | - |
|
| 81 |
+
| harrier-oss-v1-0.6b (596M) | - | - | 70.78 | - |
|
| 82 |
+
| multilingual-e5-large-instruct (560M) | 65.56 | - | 70.15 | - |
|
|
|
|
| 83 |
|
| 84 |
<details>
|
| 85 |
+
<summary>MTEB(eng, v2) by task type</summary>
|
| 86 |
|
| 87 |
+
| Model | Mean (41) | Classification (8) | Clustering (8) | Pair Classification (3) | Reranking (2) | Retrieval (10) | STS (9) | Summarization (1) |
|
| 88 |
|---|---|---|---|---|---|---|---|---|
|
| 89 |
+
| **EmbeddingNandi-450M (450M)** | 67.34 | **89.43** | 52.02 | 83.49 | 47.72 | 52.39 | 81.49 | 26.31 |
|
| 90 |
+
| EmbeddingGemma 2 (271M) | 67.53 | 88.82 | 51.70 | **86.39** | 46.03 | 51.33 | 82.75 | **35.09** |
|
| 91 |
+
| Qwen3-Embedding-0.6B (596M) | **70.47** | 84.56 | **54.05** | 84.37 | 48.18 | **61.83** | **86.57** | 33.43 |
|
| 92 |
+
| granite-embedding-311m-multilingual-r2 (312M) | - | - | - | - | - | 52.55 | - | - |
|
| 93 |
+
| multilingual-e5-large-instruct (560M) | 65.56 | 75.71 | 49.89 | 86.24 | **48.74** | 53.47 | 84.72 | 29.89 |
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
</details>
|
| 96 |
|
| 97 |
<details>
|
| 98 |
+
<summary>MTEB(Code, v1) by task</summary>
|
| 99 |
|
| 100 |
+
| Task | **EmbeddingNandi-450M (450M)** | EmbeddingGemma 2 (271M) | Qwen3-Embedding-0.6B (596M) | pplx-embed-v1-0.6b (596M) | granite-embedding-311m-multilingual-r2 (312M) | multilingual-e5-large-instruct (560M) |
|
| 101 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 102 |
+
| Mean (12) | 76.68 | **77.88** | 75.42 | 75.85 | 63.84 | - |
|
| 103 |
+
| AppsRetrieval | 77.95 | **89.29** | 75.34 | 78.66 | 60.63 | 34.89 |
|
| 104 |
+
| COIRCodeSearchNetRetrieval | 85.84 | **86.91** | 84.69 | 82.38 | 77.63 | - |
|
| 105 |
+
| CodeEditSearchRetrieval | **80.88** | 80.50 | 64.42 | 76.36 | 56.17 | 58.80 |
|
| 106 |
+
| CodeFeedbackMT | 86.95 | 88.22 | **90.82** | 82.96 | 56.96 | 39.87 |
|
| 107 |
+
| CodeFeedbackST | **88.67** | 82.12 | 86.39 | 84.73 | 77.25 | 75.89 |
|
| 108 |
+
| CodeSearchNetCCRetrieval | 92.15 | **96.64** | 91.72 | 88.10 | 55.47 | 78.70 |
|
| 109 |
+
| CodeSearchNetRetrieval | 89.38 | 90.83 | **91.01** | 89.86 | 86.87 | 83.09 |
|
| 110 |
+
| CodeTransOceanContest | 84.25 | 83.74 | **86.05** | 85.03 | 83.23 | 83.36 |
|
| 111 |
+
| CodeTransOceanDL | 34.84 | **36.59** | 31.36 | 35.16 | 34.44 | 29.01 |
|
| 112 |
+
| CosQA | 43.67 | **51.35** | 36.48 | 43.32 | 35.38 | 37.75 |
|
| 113 |
+
| StackOverflowQA | **92.62** | 87.32 | 89.99 | 90.65 | 86.32 | 85.82 |
|
| 114 |
+
| SyntheticText2SQL | 63.00 | 61.10 | **76.74** | 72.98 | 55.71 | 58.86 |
|
| 115 |
|
| 116 |
</details>
|
| 117 |
|
| 118 |
<details>
|
| 119 |
+
<summary>MTEB(Indic, v1) by task type</summary>
|
| 120 |
|
| 121 |
+
| Model | Mean (20) | Bitext Mining (2) | Classification (12) | Clustering (1) | Pair Classification (1) | Reranking (1) | Retrieval (2) | STS (1) |
|
| 122 |
|---|---|---|---|---|---|---|---|---|
|
| 123 |
+
| **EmbeddingNandi-450M (450M)** | **76.68** | **88.84** | **73.76** | **58.81** | **85.16** | 87.08 | **90.89** | **58.06** |
|
| 124 |
+
| EmbeddingGemma 2 (271M) | - | - | - | 32.15 | 75.13 | 85.19 | - | 36.82 |
|
| 125 |
+
| Qwen3-Embedding-0.6B (596M) | 65.32 | 67.17 | 64.71 | 39.41 | 77.23 | 82.48 | 78.71 | 38.98 |
|
| 126 |
+
| granite-embedding-311m-multilingual-r2 (312M) | - | - | - | 36.03 | 61.34 | 82.94 | - | 37.17 |
|
| 127 |
+
| harrier-oss-v1-0.6b (596M) | 70.78 | 80.32 | 68.85 | 51.56 | 79.47 | 82.02 | 81.19 | 53.28 |
|
| 128 |
+
| multilingual-e5-large-instruct (560M) | 70.15 | 80.37 | 66.96 | 51.67 | 76.31 | **87.46** | 84.86 | 53.69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
</details>
|
| 131 |
|
|
|
|
| 214 |
|
| 215 |
### 2. Matryoshka Dimension Truncation
|
| 216 |
|
| 217 |
+
EmbeddingNandi-450M is trained with Matryoshka Representation Learning, so the 1,024-dimensional vector can be shortened by keeping only its first values. The supported sizes are 1024, 768, 512, 256 and 128. Shorter vectors use less storage and make search faster, at some cost in quality.
|
|
|
|
|
|
|
| 218 |
|
| 219 |
+
* **Re-normalize after truncating:** a cut unit-length vector is no longer unit length, so normalize it again before using it for cosine similarity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
* **Queries and documents must use the same size.**
|
| 221 |
|
| 222 |
Pass `truncate_dim` and `normalize_embeddings=True` to let Sentence Transformers do both:
|
|
|
|
| 228 |
# (3, 256)
|
| 229 |
```
|
| 230 |
|
| 231 |
+
Or set the size once when loading the model:
|
| 232 |
|
| 233 |
```python
|
| 234 |
model_256 = SentenceTransformer("FrontiersMind/EmbeddingNandi-450M", trust_remote_code=True, truncate_dim=256)
|
|
|
|
|
|
|
|
|
|
| 235 |
```
|
| 236 |
|
| 237 |
### 3. Long Inputs
|
|
|
|
| 244 |
|
| 245 |
### 4. Numerical Precision
|
| 246 |
|
| 247 |
+
Run inference in `bfloat16` or `float32`. The weights are stored in `bfloat16`, the precision used for the benchmark results. Use `float32` on CPU and for very long inputs (16K tokens or more).
|
| 248 |
|
| 249 |
```python
|
| 250 |
import torch
|
|
|
|
| 318 |
|
| 319 |
</details>
|
| 320 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
## Citation
|
| 322 |
|
| 323 |
```bibtex
|
| 324 |
@misc{frontiersmind2026embeddingnandi,
|
| 325 |
+
title = {EmbeddingNandi: Open Long-Context Embedding Models for English, Indic and South-East Asian Languages},
|
| 326 |
author = {{FrontiersMind}},
|
| 327 |
year = {2026},
|
| 328 |
howpublished = {\url{https://huggingface.co/FrontiersMind/EmbeddingNandi-450M}}
|