How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="LiquidAI/LFM2.5-Encoder-350M-Prompt-Router", trust_remote_code=True)
# Load model directly
from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-Encoder-350M-Prompt-Router", trust_remote_code=True)
model = AutoModel.from_pretrained("LiquidAI/LFM2.5-Encoder-350M-Prompt-Router", trust_remote_code=True, device_map="auto")
Quick Links
Liquid AI
Try LFMDocsLEAPDiscord

LFM2.5-Encoder-350-Prompt-Router

A full fine-tune of LFM2.5-Encoder-350M with a zero-shot routing head that scores a prompt against user-defined routing lanes in a single encoder pass.

Find more details about our encoders in our blog post.

💻 Demos: Try this fine-tuned model running in a CPU-only Hugging Face space: Zero-shot prompt routing — define your own routing lanes as free text. The model scores the whole prompt against every lane in one pass.

Usage

⚠️ Loads custom code via trust_remote_code=True (the model wraps a trust_remote_code encoder).

Install the required packages:

pip install torch transformers

Run zero-shot prompt routing:

from transformers import AutoModel, AutoTokenizer

model_id = "LiquidAI/LFM2.5-Encoder-350-Prompt-Router"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).eval()

routes = ["Coding", "Sales", "Creative writing", "General knowledge"]
prompt = "Can you help me debug a failing Python unit test?"

print(model.route(prompt, routes, tokenizer=tokenizer))

📬 Contact

Citation

@article{liquidAI2026Encoders,
  author = {Liquid AI},
  title = {LFM2.5-Encoders: Fast at Long Context, Even on CPU},
  journal = {Liquid AI Blog},
  year = {2026},
  note = {www.liquid.ai/blog/lfm2-5-encoders},
}
Downloads last month
3
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for LiquidAI/LFM2.5-Encoder-350M-Prompt-Router

Finetuned
(8)
this model

Space using LiquidAI/LFM2.5-Encoder-350M-Prompt-Router 1