LiquidAI / LFM2.5-Encoder-350M-Policy-Linter

huggingface.co
Total runs: 518
24-hour runs: 0
7-day runs: 292
30-day runs: 514
Model's Last Updated: July 28 2026
token-classification

Introduction of LFM2.5-Encoder-350M-Policy-Linter

Model Details of LFM2.5-Encoder-350M-Policy-Linter

LFM2.5-Encoder-350-Policy-Linter

A full fine-tune of LFM2.5-Encoder-350M with a rule-matching head that scores every text token against free-text policy rules 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 policy linting ** — check text against your company's rules, written as free text. It scores every token against every rule 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 policy linting:

import sys
from pathlib import Path

import torch
from transformers import AutoTokenizer

repo = Path(".")
sys.path.insert(0, str(repo))

from train_bizlint_v02 import Lfm2BidirForRuleMatching

rules = [
    "Flag direct mentions of competitor companies.",
    "Flag promises about guaranteed financial returns.",
]
text = "Our product is better than AcmeAI and will guarantee 30% savings."

prefix = "Policy:\n" + "\n".join(f"- {rule}" for rule in rules) + "\n\nText:\n"
full_text = prefix + text

tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = Lfm2BidirForRuleMatching.from_pretrained(repo, trust_remote_code=True).eval()

enc = tokenizer(full_text, return_offsets_mapping=True, return_tensors="pt")
offsets = enc.pop("offset_mapping")[0].tolist()

rule_pool = torch.zeros(1, len(rules), len(offsets))
pos = len("Policy:\n")

for rule_idx, rule in enumerate(rules):
    start = pos + 2
    end = start + len(rule)
    token_idxs = [
        i for i, (a, b) in enumerate(offsets)
        if a < end and b > start and a != b
    ]
    rule_pool[0, rule_idx, token_idxs] = 1 / len(token_idxs)
    pos = end + 1

with torch.no_grad():
    probs = model(**enc, rule_pool=rule_pool)["logits"].sigmoid()[0]

text_start = len(prefix)

for token_idx, (a, b) in enumerate(offsets):
    if b <= text_start or a == b:
        continue

    token_text = full_text[a:b]
    for rule_idx, prob in enumerate(probs[token_idx]):
        if prob.item() > 0.5:
            print(f"{token_text!r} -> {prob.item():.3f}: {rules[rule_idx]}")
📬 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},
}

Runs of LiquidAI LFM2.5-Encoder-350M-Policy-Linter on huggingface.co

518
Total runs
0
24-hour runs
274
3-day runs
292
7-day runs
514
30-day runs

More Information About LFM2.5-Encoder-350M-Policy-Linter huggingface.co Model

More LFM2.5-Encoder-350M-Policy-Linter license Visit here:

https://choosealicense.com/licenses/lfm1.0

LFM2.5-Encoder-350M-Policy-Linter huggingface.co

LFM2.5-Encoder-350M-Policy-Linter huggingface.co is an AI model on huggingface.co that provides LFM2.5-Encoder-350M-Policy-Linter's model effect (), which can be used instantly with this LiquidAI LFM2.5-Encoder-350M-Policy-Linter model. huggingface.co supports a free trial of the LFM2.5-Encoder-350M-Policy-Linter model, and also provides paid use of the LFM2.5-Encoder-350M-Policy-Linter. Support call LFM2.5-Encoder-350M-Policy-Linter model through api, including Node.js, Python, http.

LFM2.5-Encoder-350M-Policy-Linter huggingface.co Url

https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Policy-Linter

LiquidAI LFM2.5-Encoder-350M-Policy-Linter online free

LFM2.5-Encoder-350M-Policy-Linter huggingface.co is an online trial and call api platform, which integrates LFM2.5-Encoder-350M-Policy-Linter's modeling effects, including api services, and provides a free online trial of LFM2.5-Encoder-350M-Policy-Linter, you can try LFM2.5-Encoder-350M-Policy-Linter online for free by clicking the link below.

LiquidAI LFM2.5-Encoder-350M-Policy-Linter online free url in huggingface.co:

https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Policy-Linter

LFM2.5-Encoder-350M-Policy-Linter install

LFM2.5-Encoder-350M-Policy-Linter is an open source model from GitHub that offers a free installation service, and any user can find LFM2.5-Encoder-350M-Policy-Linter on GitHub to install. At the same time, huggingface.co provides the effect of LFM2.5-Encoder-350M-Policy-Linter install, users can directly use LFM2.5-Encoder-350M-Policy-Linter installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LFM2.5-Encoder-350M-Policy-Linter install url in huggingface.co:

https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Policy-Linter

Url of LFM2.5-Encoder-350M-Policy-Linter

LFM2.5-Encoder-350M-Policy-Linter huggingface.co Url

Provider of LFM2.5-Encoder-350M-Policy-Linter huggingface.co

LiquidAI
ORGANIZATIONS

Other API from LiquidAI

huggingface.co

Total runs: 119.0K
Run Growth: 76.2K
Growth Rate: 64.05%
Updated:April 02 2026
huggingface.co

Total runs: 104.2K
Run Growth: 78.6K
Growth Rate: 75.40%
Updated:March 30 2026
huggingface.co

Total runs: 100.4K
Run Growth: 58.9K
Growth Rate: 58.70%
Updated:February 13 2026
huggingface.co

Total runs: 94.9K
Run Growth: 25.8K
Growth Rate: 27.18%
Updated:March 30 2026
huggingface.co

Total runs: 20.2K
Run Growth: -12.8K
Growth Rate: -63.43%
Updated:March 30 2026
huggingface.co

Total runs: 19.1K
Run Growth: 14.4K
Growth Rate: 85.98%
Updated:October 08 2026
huggingface.co

Total runs: 15.0K
Run Growth: -24.0K
Growth Rate: -159.48%
Updated:March 30 2026
huggingface.co

Total runs: 11.9K
Run Growth: -170
Growth Rate: -1.43%
Updated:March 30 2026
huggingface.co

Total runs: 9.6K
Run Growth: -1.9K
Growth Rate: -19.52%
Updated:March 30 2026
huggingface.co

Total runs: 6.5K
Run Growth: 449
Growth Rate: 6.86%
Updated:March 30 2026
huggingface.co

Total runs: 3.8K
Run Growth: -692
Growth Rate: -18.35%
Updated:March 30 2026