Model reference · open weights
BidirLM-Embedding is an open-weight embedding model from BidirLM. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | BidirLM |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 1000M |
| Context | 32k tokens |
| Runs with | sentence-transformers |
| Based on | BidirLM/BidirLM-1B-Base |
| Released | 2026-04-07 |
| Popularity | 1k downloads / month |
| Licence | Open weights |
About
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.
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys bidirlm-embedding for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (bidirlm-embedding below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"bidirlm-embedding","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.