Model reference · open weights

BidirLM-Embedding

Available as managed deployment Embeddings BidirLM Embeddings 3 variants 1k dl/mo

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 byBidirLM
TypeEmbedding models
TaskEmbeddings
Parameters (lead)1000M
Context32k tokens
Runs withsentence-transformers
Based onBidirLM/BidirLM-1B-Base
Released2026-04-07
Popularity1k downloads / month
LicenceOpen weights

About

What BidirLM-Embedding is

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.

Read the full model card
ModelBase LLMParametersEmbedding DimMax TokensMTEB Multi. V2 (Mean Task)
BidirLM-270MGemma3-270M268M64051256.3
BidirLM-0.6BQwen3-0.6B596M102451260.0
BidirLM-1BGemma3-1B1001M1152512 (*)62.7
BidirLM-1.7BQwen3-1.7B1721M204851263.1
BidirLM-Omni-2.5BQwen3-1.7B2.5B204851263.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.

LongEmbed (Long-Context Retrieval)

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.

ModelLongEmbed (Mean nDCG@10)Eval Context
BidirLM-270M71.832k
BidirLM-0.6B71.98k
BidirLM-1B76.432k
BidirLM-1.7B73.48k

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.

Supported Tasks

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)

Usage

Sentence Transformers

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)

Fine-tuning for Downstream Tasks

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

Evaluation

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.

Supported Languages

Multilingual support across over 140 languages, inherited from the Gemma3 base model and reinforced through contrastive training with 87 languages.

Requirements

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 on main was patched to work with transformers>=5.0. For the original (pre-patch) version, which is compatible with transformers>=4.57.6,<5.0.0, use the transformers-v4 branch:

from sentence_transformers import SentenceTransformer
model = SentenceTransformer(
    "BidirLM/BidirLM-1B-Embedding",
    trust_remote_code=True,
    revision="transformers-v4",
)

FAQ

1. What pooling strategy does this model use?

The model uses mean pooling. This is handled automatically when using Sentence Transformers.

2. Do I need trust_remote_code=True?

Yes. BidirLM uses a custom bidirectional architecture (BidirLMModel) that requires loading custom code from the repository.

3. Why are my reproduced results slightly different from those reported in the model card?

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).

4. What is the relationship between BidirLM-1B and BidirLM-1B-Base?

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.

5. How is Bidir

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

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.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms