Model reference · open weights
BidirLM-Embedding is an open-weight embedding model from BidirLM. BidirLM-1B-Embedding (BF16) weighs 2.0 GB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the BidirLM/BidirLM-1B-Embedding model card, 2026-10-01
What it is
| Released by | BidirLM |
|---|---|
| Released | 2026-04-07 |
| Parameters | 1.0B |
| VRAM | 2.0 GB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
Builds
| Build | Params | Precision | Weights | Smallest setup |
|---|---|---|---|---|
| BidirLM-1B-Embedding (above) ↗ | 1.0B | BF16 | 2.0 GB | RTX 3060 12 GB |
| BidirLM-0.6B-Embedding ↗ | 596M | BF16 | 1.2 GB | RTX 3060 12 GB |
| BidirLM-1.7B-Embedding ↗ | 1.7B | BF16 | 3.4 GB | RTX 3060 12 GB |
From the model card
BidirLM is a family of 5 frontier bidirectional encoders, including an omnimodal variant at 2.5B, adapted from causal decoder LLMs. Contrary to contrastive-only models, BidirLM relies on a prior masking phase (MNTP) that enables state-of-the-art results on task-specific fine-tuning (NER, classification, NLI) while achieving frontier performance on embedding benchmarks (MTEB) against open-source alternatives.
From the paper. MTEB(Multilingual, v2) below matches the paper; the LongEmbed table reports additional long-context results.
| Model | Base LLM | Parameters | Embedding Dim | Max Tokens | MTEB Multi. V2 (Mean Task) |
|---|---|---|---|---|---|
| BidirLM-270M | Gemma3-270M | 268M | 640 | 512 | 56.3 |
| BidirLM-0.6B | Qwen3-0.6B | 596M | 1024 | 512 | 60.0 |
| BidirLM-1B | Gemma3-1B | 1001M | 1152 | 512 (*) | 62.7 |
| BidirLM-1.7B | Qwen3-1.7B | 1721M | 2048 | 512 | 63.1 |
| BidirLM-Omni-2.5B | Qwen3-1.7B | 2.5B | 2048 | 512 | 63.1 |
(*) Evaluated at max_seq_length=512, matching the paper. The architecture supports much longer context (see the LongEmbed table below); on the MTEB leaderboard the shared LEMBPasskeyRetrieval task is scored at long context, making the leaderboard MTEB(Multilingual, v2) ~0.4 higher than this table.
Mean nDCG@10 over the 6 LongEmbed retrieval tasks. Each model is reported at the context length (8k or 32k) that maximizes its average; the architecture supports the base model's full context.
| Model | LongEmbed (Mean nDCG@10) | Eval Context |
|---|---|---|
| BidirLM-270M | 71.8 | 32k |
| BidirLM-0.6B | 71.9 | 8k |
| BidirLM-1B | 76.4 | 32k |
| BidirLM-1.7B | 73.4 | 8k |
Note: Extending the evaluation context from 8k to 32k helped the Gemma-based models (270M, 1B) but not the Qwen-based models (0.6B, 1.7B), which scored best at 8k.
General embeddings (via Sentence Transformers): retrieval, semantic similarity (STS), clustering, classification, pair classification, reranking, bitext mining, multilabel classification
Downstream fine-tuning (via Transformers): sequence classification (e.g. MNLI, XNLI, PAWS-X, MathShepherd), token classification (e.g. PAN-X, POS), information retrieval (e.g. MIRACL, CodeSearchNet), sequence regression (e.g. Seahorse)
Use Sentence Transformers to compute embeddings for any text representation task.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("BidirLM/BidirLM-1B-Embedding", trust_remote_code=True)
queries = [
"What is the capital of France?",
"How does photosynthesis work?",
]
documents = [
"Paris is the capital and largest city of France, situated on the river Seine.",
"Photosynthesis is the process by which plants convert sunlight, water, and CO2 into glucose and oxygen.",
]
query_embeddings = model.encode(queries)
document_embeddings = model.encode(documents)
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
BidirLM can be directly fine-tuned for downstream tasks:
from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("BidirLM/BidirLM-1B-Embedding", trust_remote_code=True)
# Sequence classification (e.g., NLI: entailment, neutral, contradiction)
seq_model = AutoModelForSequenceClassification.from_pretrained(
"BidirLM/BidirLM-1B-Embedding",
trust_remote_code=True,
num_labels=3,
)
# Token classification (e.g., NER)
tok_model = AutoModelForTokenClassification.from_pretrained(
"BidirLM/BidirLM-1B-Embedding",
trust_remote_code=True,
num_labels=7,
)
# Fine-tune with HuggingFace Trainer
Please follow the mteb repository on how to reproduce our scores. The evaluation prompts used for each task are also available at mteb_v2_eval_prompts.json.
Multilingual support across over 140 languages, inherited from the Gemma3 base model and reinforced through contrastive training with 87 languages.
This model requires trust_remote_code=True as it uses a custom bidirectional architecture.
transformers>=5.0
sentence-transformers>=5.0.0
Note: This model was trained with
transformers==4.57.6(transformers 4.x). The version onmainwas patched to work withtransformers>=5.0. For the original (pre-patch) version, which is compatible withtransformers>=4.57.6,<5.0.0, use thetransformers-v4branch:from sentence_transformers import SentenceTransformer model = SentenceTransformer( "BidirLM/BidirLM-1B-Embedding", trust_remote_code=True, revision="transformers-v4", )
The model uses mean pooling. This is handled automatically when using Sentence Transformers.
trust_remote_code=True?Yes. BidirLM uses a custom bidirectional architecture (BidirLMModel) that requires loading custom code from the repository.
Different versions of transformers and pytorch could cause negligible but non-zero performance differences. This model should be used with transformers>=5.0 (evaluated with transformers==5.5.4 and pytorch==2.6.0).
BidirLM/BidirLM-1B-Base is the intermediate MNTP-adapted checkpoint (bidirectional pretraining stage). BidirLM-1B is the final contrastive fine-tuned version optimized for both sentence embeddings and downstream fine-tuning.
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.