Skip to main content

Model guide

LFM2.5 Embedding 350M

LFM2.5 Embedding 350M produces a single vector for short text passages and queries. Its documented 512-token document length makes chunking important even though the related encoder models have different limits. Use it for a compact multilingual search index and test relevance before increasing the collection size.

0.35BEmbedding512 token contextView the model card →

At a glance

Parameters
0.35B
Accepts
Text
Returns
Vectors
Published context limit
512 tokens
Model format
safetensors · GGUF
Software and download hosts
sentence-transformers · llama.cpp. Follow the exact setup below; this list does not establish support for every format, input type or software version.
Suggested compression
Q4_K_M
Model-weight download
Q4_K_M weights · 0.23 GBLiquidAI (model publisher)LFM2.5-Embedding-350M-Q4_K_M.gguf
Languages
Arabic · German · English · Spanish · French · Italian · Japanese · Korean · Norwegian · Portuguese · Swedish
License
LFM Open License v1.0 (commercial use is subject to the US$10 million annual-revenue threshold in section 5)

Record memory while indexing a batch of your usual passage length. Time one query separately.

Best for

  • Index short passages as one vector each. Query a known fact and measure the first relevant rank before expanding the collection.

Choose something else when

  • Split entries above the 512-token limit and keep query and document prompts consistent.

Using this model for document search

Select this model for the document-search step in an app that supports it. Keep the model that generates answers separate. Check document chunk length and any required query or document prefixes in the model’s instructions.

Changing the embedding model changes the document vectors. Rebuild the document index rather than mixing vectors from different models.

First setup

The Python workflow loads LiquidAI/LFM2.5-Embedding-350M (0.71 GB for the safetensors weights, plus tokenizer/configuration files). The 0.23 GB Q4_K_M GGUF is a separate download for a compatible GGUF model runner; the Python example does not load it. Loaded memory depends on dtype, input length, batch size and model runner.

Install sentence-transformers with python -m pip install -U sentence-transformers. This example uses CPU and short text. The publisher requires custom Python code: trust_remote_code=True permits that code to run on your computer; read it before using sensitive material.

from sentence_transformers import SentenceTransformer
model = SentenceTransformer("LiquidAI/LFM2.5-Embedding-350M", device="cpu", trust_remote_code=True)
query = model.encode(["When does the meeting start?"], prompt_name="query", batch_size=1)
documents = model.encode(["The meeting starts at 10:30.", "Lunch is at noon."], prompt_name="document", batch_size=1)
print(query.shape, documents.shape)
print(model.similarity(query, documents))

Expect one query vector, two document vectors and two similarity values. Check whether the meeting passage ranks above the lunch passage. These values do not establish that a generated answer is correct. Keep query and document prompting consistent when building a real index; rebuild it when changing the model.

Save the Python example as example.py, then run python example.py in the environment where you installed its packages. The first run downloads model files; later local execution still needs the cached files. Start with these short inputs and batch size 1. If loading runs out of memory, close other model processes or use a smaller model; do not interpret missing output as an empty search result. See the publisher model card for the full workflow.

Other models for this task