Downloads · 30 days
824
26% of all-time downloads
vllm-sr/elephant-embeddings-v1-text-small
elephant-embeddings-v1-text-small is a sentence similarity model from vllm-sr. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
elephant-embeddings-v1-text-small is a multilingual long-context embedding model purpose-built for agent-native retrieval, memory, and decision workflows.
Downloads · 30 days
824
26% of all-time downloads
All-time downloads
3.2K
Public
Parameters
307M
648 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors614 MB · 95%
From the Hugging Face model README
elephant-embeddings-v1-text-small is a multilingual long-context embedding model purpose-built for agent-native retrieval, memory, and decision workflows.
It is designed for systems where embeddings sit on the semantic hot path rather than at the edge of the stack: memory lookup, knowledge retrieval, tool matching, task routing, long-horizon recall, clustering, and multilingual indexing. Its value is not just a benchmark score, but a practical operating profile that fits real agent runtimes: 32K context, 2D Matryoshka adaptability across dimensions and layers, 307M-class deployability, and strong latency-quality efficiency under repeated inference.
In short, elephant-embeddings-v1-text-small is built for teams that want one embedding space to support fast routing, scalable retrieval, and high-confidence semantic matching without paying the operational cost of a much larger model.
Agentic systems do not call embeddings once. They call them everywhere: before retrieval, during routing, when matching tools, when searching memory, and while compressing or re-ranking state. That means a useful agent embedding model must be more than accurate — it must also be flexible under tight runtime budgets.
elephant-embeddings-v1-text-small is designed around that reality.
This model supports Matryoshka embeddings, which means you can encode once at full size and truncate to smaller dimensions with limited quality loss.
That is especially useful for agent systems because different stages of the stack often need different budgets:
Instead of managing separate embedding models for each tier, you can keep one semantic space and choose the dimensional budget that matches the task.
The model is trained with 2D Matryoshka behavior:
This matters for agents because the same system often mixes:
A single model that can serve multiple latency / quality profiles is much easier to operate than a stack of unrelated specialized encoders.
Many agent workloads are not short isolated queries. They involve:
With 32,768 tokens of context length, elephant-embeddings-v1-text-small can represent larger semantic units before you are forced into aggressive chunking. That helps preserve cross-section meaning in long documents and richer memory entries.
At roughly 307M parameters, this model sits in a useful middle ground:
For agentic platforms, that usually means better economics and simpler scaling.
Agent systems are easier to operate when routing, retrieval, memory search, and semantic matching all live in the same vector space.
elephant-embeddings-v1-text-small is well suited to that pattern:
That means one model can cover multiple semantic stages without forcing the system to juggle incompatible encoders, duplicated indexes, or divergent retrieval behavior.
| Feature | Value |
|---|---|
| Parameters | 307M |
| Architecture | ModernBERT encoder with YaRN scaling |
| Hidden Size | 768 |
| Layers | 22 |
| Context Length | 32,768 tokens |
| Pooling | Mean pooling |
| Similarity | Cosine |
| Languages | Multilingual |
| Matryoshka Dimensions | 768, 512, 256, 128, 64 |
| Metric | Score |
|---|---|
| MTEB Mean (24 tasks) | 61.4 |
| STS Benchmark | 80.5 |
| Dimension Retention | 99% @ 256d, 98% @ 64d |
| Layer Speedup | 3.3× @ 6L, 5.8× @ 3L |
| Latency vs BGE-M3 | 1.6-3.1× faster on longer sequences / larger batches |
These numbers make the model particularly attractive for systems that must balance quality, latency, vector size, and deployment simplicity instead of optimizing only for leaderboard peak score.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("/path/to/elephant-embeddings-v1-text-small")
texts = [
"Find tool descriptions related to browser automation.",
"检索和用户历史偏好相关的记忆。",
"Retrieve notes about deployment failures in staging.",
]
embeddings = model.encode(texts)
print(embeddings.shape) # (3, 768)
import torch.nn.functional as F
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("/path/to/elephant-embeddings-v1-text-small")
embeddings = model.encode(texts, convert_to_tensor=True)
# Balanced retrieval tier
embeddings_256d = F.normalize(embeddings[:, :256], p=2, dim=1)
# Ultra-cheap routing / large memory-bank tier
embeddings_64d = F.normalize(embeddings[:, :64], p=2, dim=1)
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("/path/to/elephant-embeddings-v1-text-small")
model.max_seq_length = 8192 # can be increased up to 32768
long_note = "..."
embedding = model.encode(long_note)
A common agent stack has several retrieval-like stages:
Matryoshka lets one model support all three stages:
| Stage | Suggested Dim | Why |
|---|---|---|
| Broad routing / candidate generation | 64d | Maximize speed and minimize storage |
| Main retrieval | 256d | Strong balance of quality and cost |
| Final matching / offline indexing | 768d | Best semantic fidelity |
That is often a better operational story than mixing several incompatible embedding models across the same pipeline.
| Category | Score |
|---|---|
| STS (7 tasks) | 79.3 |
| Classification (6) | 62.4 |
| Pair Classification (2) | 76.2 |
| Reranking (2) | 64.4 |
| Clustering (4) | 36.9 |
| Retrieval (3) | 38.2 |
| Overall Mean | 61.4 |
| Model | Parameters | STS Score |
|---|---|---|
| Qwen3-Embed-0.6B | 600M | 76.17 |
| elephant-embeddings-v1-text-small | 307M | 80.5 |
| Qwen3-Embed-8B | 8B | 81.08 |
| Layers | 768d | 256d | 64d |
|---|---|---|---|
| 22L | 80.5 | 79.9 | 78.5 |
| 11L | 53.7 | 48.0 | 44.4 |
| 6L | 45.2 | 45.2 | 43.5 |
| 3L | 44.0 | 44.1 | 41.8 |
| Metric | Score |
|---|---|
| R@1 | 68.8% |
| R@10 | 81.2% |
| MRR | 71.9% |
| Layers | Throughput | Speedup |
|---|---|---|
| 22L | 477/s | 1.0× |
| 11L | 916/s | 1.9× |
| 6L | 1573/s | 3.3× |
| 3L | 2761/s | 5.8× |
Trained on BAAI/bge-m3-data with multilingual triplets across diverse domains.
Matryoshka2dLoss (combines adaptive layer loss and Matryoshka loss)[768, 512, 256, 128, 64]3276816 (effective 32 with gradient accumulation)2e-5elephant-embeddings-v1-text-small is especially well suited for:
elephant-embeddings-v1-text-small is derived from vllm-sr/mmbert-embed-32k-2d-matryoshka and distributed here as a lean Sentence Transformers / PyTorch package.
This build intentionally omits bundled ONNX artifacts so the model remains smaller and easier to move, mirror, cache, and deploy in environments that primarily rely on native Transformers runtimes.
If you use this model, please cite the upstream work it is derived from:
@misc{mmbert-embed-2d-matryoshka,
title={mmBERT-Embed: Multilingual Embedding Model with 2D Matryoshka Training},
author={vLLM Semantic Router Team},
year={2025},
url={https://huggingface.co/vllm-sr/mmbert-embed-32k-2d-matryoshka}
}
Apache 2.0