Skip to main content

LFM-2.5 Encoders: Hugging Face Brings Fast, Long‑Context Embedding to CPU – What Europe Needs to Know

Ilustrační obrázek
Liquid AI has just released a new family of encoder-only models that can handle up to 128 000 tokens on a plain consumer CPU – and they are one click away on Hugging Face. The LFM-2.5 Encoders combine the long‑context efficiency of linear recurrences with the familiar Hugging Face ecosystem, putting privacy‑first embedding pipelines within easy reach of European developers.

What’s new: LFM‑2.5 Encoders on Hugging Face

On 29 July 2026, Hugging Face published a technical blog authored with Liquid AI announcing the LFM‑2.5 Encoders, three text‑embedding models specialised in extremely long contexts and explicitly designed to run at production speed without a GPU. The models – a Base, Medium and Large variant – follow Liquid AI’s LFM‑2 series from spring 2025 but abandon the generative decoder head in favour of pure, high‑throughput encoding.

By stripping away the decoder, the team has optimised the mixture‑of‑linear‑recurrences architecture (a cousin to Mamba‑style state‑space models) for one job: turning documents into dense vectors in near‑constant computation per token, regardless of sequence length. The result is a set of models that promise to embed a full 128 k‑token legal contract or EU‑regulation document in less than two seconds on a modern Intel Core i7 – a performance level that makes on‑device semantic search realistic for the first time.

From quadratic attention to linear recurrence – why it runs on CPU

Standard transformer encoders such as BERT or BGE pay an ever‑growing computational price as context expands – every new token must attend to all previous ones, blowing up compute and memory. Linear‑recurrence models use a fixed‑size hidden state that summarises the past, so the cost stays constant per token. That property lets LFM‑2.5 encoders process 128 k‑token inputs on a laptop CPU while keeping RAM use under 2 GB for the largest 3.1 B‑parameter variant.

The practical consequence is that a complete on‑premise retrieval pipeline – chunking, embedding, storage – can now run entirely on a €30‑per‑month cloud VM or even a repurposed office workstation. For European companies that must keep client data away from third‑party APIs, this changes the economics of RAG dramatically.

EU availability, data sovereignty and GDPR

All LFM‑2.5 encoder weights are hosted on Hugging Face’s platform – a company headquartered in Paris, France. European users can download the models directly and run them locally with the sentence‑transformers library or Hugging Face’s text‑embeddings‑inference server. Hugging Face also offers EU‑hosted Inference Endpoints (AWS Frankfurt, Azure West Europe) that keep processing inside the European Economic Area, turning these encoders into a GDPR‑compliant service straight away.

For organisations subject to the EU AI Act’s transparency obligations, the fact that the encoders are open‑weight and fully inspectable is an extra advantage. Unlike calling a black‑box cloud API, you can validate the model behaviour and – critically – keep personal data off US‑controlled servers.

One caveat for multilingual Europe: The LFM‑2.5 family was pre‑trained predominantly on English data. Early tests show reasonable zero‑shot performance on French, German and Spanish, but anyone working with less‑represented EU languages will need to fine‑tune the encoders on their own parallel or mono‑lingual texts. Liquid AI’s architecture, however, supports parameter‑efficient fine‑tuning, keeping the cost manageable.

Cost comparison: self‑hosted LFM‑2.5 vs. mainstream embedding APIs

Since electricity and cloud‑instance costs are easier to control in a business plan than per‑token API bills, we’ve done a back‑of‑the‑envelope calculation for a typical high‑volume EU use case: embedding 10 million tokens per day (roughly 300 000 pages per month). The table below compares LFM‑2.5‑Encoder‑Large with three popular managed APIs, converting all figures to euros at the 30 July 2026 rate of €0.92 = $1.

Model Max context Cost per 1 M tokens (API) Self‑hosted cost
(Hetzner CX41, 1 M tokens)
OpenAI text‑embedding‑3‑small 8 192 tokens $0.02 (€0.018) N/A
Cohere Embed v3 (English) 32 k tokens $0.10 (€0.092) N/A
Jina embeddings v3 8192 tokens free tier → $0.15 (€0.14) N/A
LFM‑2.5‑Encoder‑Large 128 k tokens N/A (open weights) ~€0.0002
(2 s per 32 k doc, €0.018/h instance)

When you compare the numbers, self‑hosting LFM‑2.5 on an inexpensive VPS becomes roughly 90 times cheaper than OpenAI’s cheapest embedding API at scale, even before you factor in the privacy benefits. Of course you have to manage the infrastructure yourself, but with the model’s CPU‑only requirement, that is little more than spinning up a container.

Getting started: from Hugging Face to your first embedding

The models live under the LiquidAI/ namespace on Hugging Face Hub. You can pull the large variant with two lines of Python:

from sentence_transformers import SentenceTransformer
model = SentenceTransformer("LiquidAI/LFM-2.5-Encoder-Large")
embeddings = model.encode(["Your long text here …"], show_progress_bar=True)

If you prefer a dedicated inference server, Hugging Face’s text‑embeddings‑inference already ships with built‑in support for the LFM‑2.5 family. Deploying with Docker on a CPU node takes under five minutes.

What this means for Europe’s AI landscape

LFM‑2.5 encoders arrive at a moment when European enterprises are searching for GPU‑independent, privacy‑preserving AI components. The combination of linear‑recurrence efficiency, Hugging Face’s European cloud infrastructure, and the ability to side‑step US‑based APIs makes the release more than just a technical curiosity. For retrieval‑augmented generation, semantic deduplication, or internal enterprise search, it gives EU teams a credible, cost‑controlled alternative to the hyperscalers.

Can I use LFM‑2.5 encoders for a GDPR‑compliant RAG pipeline that handles personal data?

Yes. Because you can download the model and run it entirely on your own hardware or on a Hugging Face Inference Endpoint located in the EU, no personal data needs to leave a GDPR‑adequate region. Just ensure you pick an EU‑region endpoint (Frankfurt or Amsterdam) and sign the standard Data Processing Agreement that Hugging Face offers.

Do the LFM‑2.5 encoders support European languages like German, French or Polish?

The official models are English‑first; multilingual transfer performance varies. German and French texts work decently out‑of‑the‑box, but for languages with less Latin‑script training data – Greek, Czech, Finnish – we recommend fine‑tuning on a small set of in‑domain sentence pairs. The architecture supports LoRA fine‑tuning with minimal GPU time.

How do LFM‑2.5 encoders compare with open‑source alternatives such as BGE‑M3 or E5‑mistral?

Context length is the key differentiator: BGE‑M3 and E5‑mistral‑7b are capped at 8192 tokens, while LFM‑2.5 handles 128 k. On CPU, LFM‑2.5 is also dramatically faster for long sequences thanks to its linear‑recurrence design. For shorter documents (2 k tokens) and pure multilingual retrieval, BGE‑M3 still holds a slight accuracy edge, so the choice depends on your use case.

We’ll put the LFM‑2.5 encoders through their paces in our AI Arena soon – stay tuned for measured latency numbers from our own test bench.

X

Don't miss out!

Subscribe for the latest news and updates.