We release two new best-in-class multilingual retrieval models:
LFM2.5-Embedding-350M — A dense bi-encoder, one vector per document. Smallest, fastest index.
LFM2.5-ColBERT-350M — A late-interaction model. One vector per token, matched via MaxSim. Higher accuracy and better generalization at the cost of index size.
Both models are 350M params and the first bidirectional members of the LFM family, built on LFM2.5-350M-Base. They can be used as a drop-in replacement for your current RAG pipeline and target fast, cheap, and reliable multilingual / cross-lingual search across 11 languages.
Find more details about the bidirectional architecture and training recipe in our blog post.
Load LFM2.5-Embedding-350M and encode your queries and documents separately, using the matching prompt name on each side. Cosine similarity (or a normalized dot product) ranks documents against queries:
from sentence_transformers import SentenceTransformer
# Load the model (trust_remote_code applies the bidirectional patches)
model = SentenceTransformer(
"LiquidAI/LFM2.5-Embedding-350M",
trust_remote_code=True,
)
queries = [
"What is the capital of France?",
"Which city is Japan's capital?",
]
documents = [
"Paris is the capital and largest city of France. Located on the Seine River in northern France, it serves as the country's political, economic, and cultural center.",
"Tokyo, officially the Tokyo Metropolis, is the capital of Japan. It is the most populous metropolitan area in the world and serves as Japan's administrative, financial, and commercial hub.",
"Berlin is the capital and largest city of Germany. Reunified in 1990 after the fall of the Berlin Wall, it now serves as a major cultural and political center in Europe.",
]
# Encode with the matching prompt name; normalize so the dot product == cosine similarity
q_emb = model.encode(queries, prompt_name="query", normalize_embeddings=True)
d_emb = model.encode(documents, prompt_name="document", normalize_embeddings=True)
scores = q_emb @ d_emb.T # shape: (n_queries, n_documents)
Always pass prompt_name="query" for queries and prompt_name="document" for passages — the model was trained with these prefixes, and omitting them silently degrades retrieval quality.
LFM2.5-Embedding-350M can run with FlashAttention-2 (requires flash-attn installed):
import torch
from sentence_transformers import SentenceTransformer
model = SentenceTransformer(
"LiquidAI/LFM2.5-Embedding-350M",
trust_remote_code=True,
model_kwargs={"attn_implementation": "flash_attention_2", "dtype": torch.bfloat16},
)
Verified equivalent to the default within bf16 noise (multilingual NanoBEIR ndcg@10 within 0.002 across 11 languages). At the model's 512-token max length the speed gain is small (~5%); FA2 mainly helps memory and throughput if you fine-tune or run the backbone at longer contexts.
End-to-end latency on MacBook Pro M4 Max via llama.cpp at fp16, measured at 32-token queries and 256-token documents. Docs cached means that the document embeddings are pre-computed and looked up (from an index).
For large-scale production-grade enterprise deployments, we also experiment with an internal GPU stack to deliver extremely low-latency serving under high inbound load. We observe latencies as low as 1 ms.
# custom terms: read the license before you download$ fw get LiquidAI/LFM2.5-Embedding-350M
# manifest sha256 24b054ec567a… · 714 MB · 14 files$ fw verify ./LFM2.5-Embedding-350M LiquidAI/LFM2.5-Embedding-350M
Terms that come with these files. LFM 1.0: commercial use only for organisations under US$10M annual revenue. Keep a copy of the license with the files.
Custom license (custom).Read the license text first. Open this panel to show the commands once you accept its terms.
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
import os
os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com"
from transformers import AutoModel, AutoTokenizer
tok = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-Embedding-350M", revision="f35ae2c91d687658dbf1f2b449382f0b019b9808")
model = AutoModel.from_pretrained("LiquidAI/LFM2.5-Embedding-350M", revision="f35ae2c91d687658dbf1f2b449382f0b019b9808", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os
os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com"
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("LiquidAI/LFM2.5-Embedding-350M", revision="f35ae2c91d687658dbf1f2b449382f0b019b9808")
vectors = model.encode(["Hello"])