Sentence Similarity
sentence-transformers
Safetensors
German
English
hyper3_embed
feature-extraction
text-embeddings
german
late-interaction
mteb
custom_code
Instructions to use hyper3labs/hyper3-embed-deu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use hyper3labs/hyper3-embed-deu with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("hyper3labs/hyper3-embed-deu", trust_remote_code=True) sentences = [ "Das ist eine glückliche Person", "Das ist ein glücklicher Hund", "Das ist eine sehr glückliche Person", "Heute ist ein sonniger Tag" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
File size: 5,116 Bytes
88b959f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | ---
license: openmdw-1.1
language:
- de
- en
library_name: sentence-transformers
pipeline_tag: sentence-similarity
base_model: google/gemma-4-E2B-it
base_model_relation: finetune
tags:
- sentence-transformers
- feature-extraction
- text-embeddings
- german
- late-interaction
- mteb
---
<div align="center">
<a href="https://hyper3labs.com">
<img src="https://hyper3labs.com/brand-assets/hyper3labs-logo-primary.svg" width="64" height="64" alt="hyper³labs logo">
</a>
<p><strong>hyper³labs</strong></p>
<h1>hyper3-embed-deu</h1>
<p>
<a href="https://hyper3labs.com">Website</a> ·
<a href="https://github.com/Hyper3Labs">GitHub</a> ·
<a href="https://huggingface.co/hyper3labs">Hugging Face</a> ·
<a href="https://discord.gg/Za3rBkTPSf">Discord</a> ·
<a href="https://x.com/hyper3labs">X</a>
</p>
</div>
**hyper3-embed-deu** is a German text embedding model from [hyper³labs](https://hyper3labs.com), fine-tuned from [Gemma 4 E2B](https://huggingface.co/google/gemma-4-E2B-it). A single bidirectional encoder produces **1,536-dimensional dense embeddings** for vector search, clustering, and classification, alongside **128-dimensional token vectors** for fused dense + MaxSim retrieval over long documents.
| Property | Value |
|---|---|
| Parameters | 4.66B total (1.91B active transformer + heads; 2.75B embeddings) |
| Dense output | 1,536 dimensions, L2-normalized, cosine similarity (4,096-token limit) |
| Fused retrieval | 0.25 dense + 0.75 MaxSim, mixing full document (4,096 tok) and best 512-token window (stride 256) |
| Weights | BF16 backbone, FP32 heads (~8.75 GiB GPU memory; ~9.43 GB download) |
| Languages | German; English in cross-lingual pairs |
## Quick start
```bash
pip install torch==2.14.0 transformers==5.17.0 sentence-transformers==6.1.0 \
huggingface_hub==1.33.0 safetensors==0.8.0 tokenizers==0.23.3
```
### Dense embeddings
Use with any vector database (Qdrant, Milvus, pgvector) or for clustering, classification, and similarity:
```python
from sentence_transformers import SentenceTransformer
model = SentenceTransformer(
"hyper3labs/hyper3-embed-deu",
revision="v1",
trust_remote_code=True,
)
queries = ["Welche Unterlagen brauche ich für die Anmeldung einer Wohnung?"]
documents = [
"Für die Anmeldung benötigen Sie einen Ausweis und die Wohnungsgeberbestätigung.",
"Die Bibliothek ist montags bis freitags geöffnet.",
]
q = model.encode_query(queries)
d = model.encode_document(documents)
print(model.similarity(q, d))
```
Retrieval queries automatically receive a search instruction; documents use no prefix. For symmetric or classification tasks, pass `prompt_name="sts"`, `"clustering"`, `"classification"`, `"pair_classification"`, or a task name from [`config.json`](config.json).
### Fused long-document retrieval
Score a candidate set using both the dense embedding and token-level MaxSim across overlapping 512-token windows:
```python
scores = model[0].model.score_multivector(queries, documents, batch_size=8)
print(scores.cpu().tolist())
```
<details>
<summary><strong>Index a corpus once, or load via Transformers AutoModel</strong></summary>
To precompute document and window representations once and score incoming queries against them:
```python
import torch
core = model[0].model
doc_dense, doc_tokens = core.encode_with_tokens(documents)
windows, owner = core.document_windows(documents)
win_dense, win_tokens = core.encode_with_tokens(windows, max_length=576)
owner_t = torch.tensor(owner)
q_dense, q_tokens = core.encode_with_tokens(queries, prompt_name="query", max_length=1024)
scores = core.fuse_scores(
dense_full=q_dense @ doc_dense.T,
dense_window=core.best_per_document(q_dense @ win_dense.T, owner_t, len(documents)),
maxsim_full=core.maxsim_scores(q_tokens, doc_tokens),
maxsim_window=core.best_per_document(core.maxsim_scores(q_tokens, win_tokens), owner_t, len(documents)),
)
```
To load directly through `transformers` instead of Sentence Transformers:
```python
import torch
from transformers import AutoModel
core = AutoModel.from_pretrained("hyper3labs/hyper3-embed-deu", revision="v1", trust_remote_code=True)
core.to("cuda" if torch.cuda.is_available() else "cpu")
embeddings = core.encode(queries, prompt_name="query")
```
On CUDA hosts, the backbone loads in BF16 (~8.75 GiB); on CPU-only hosts it defaults to FP32 (~17.4 GiB). To set precision explicitly, pass `model_kwargs={"dtype": torch.bfloat16}` (do not call `.half()`, as pooling and MaxSim heads run in FP32).
</details>
## License
Weights, code, and documentation are released under [OpenMDW-1.1](LICENSE) (which includes the Apache-2.0 license for the Gemma 4 base model).
## Citation
```bibtex
@misc{hyper3embeddeu2026,
title = {hyper3-embed-deu: German Text Embeddings from Gemma 4},
author = {hyper3labs},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/hyper3labs/hyper3-embed-deu}
}
```
[Website](https://hyper3labs.com) · [Discord](https://discord.gg/Za3rBkTPSf) · [GitHub](https://github.com/Hyper3Labs)
|