SauerkrautLM-GLiNEREL-314m
Joint named-entity recognition, PII detection and relation extraction in one encoder pass. It turns a 33-page PDF into a knowledge graph in 0.39 s on a GPU, where a 4B generative model needs 17.6 s for a single paragraph. Labels are free text, chosen at inference time. English, German, French, Italian, Spanish. Try it in the demo →
| Parameters | 314.2M (633 MB) |
| Origin | built on LFM2.5-Encoder-230M; parent of the pruned 128m and 72m |
| Overall score (4 relation benchmarks) | 66.4 |
| Latency per text | 2.83 ms NVIDIA H100 (fp16) · 73.8 ms CPU (Apple M3 Pro, 3.1× faster than the reference) |
| License | LFM Open License v1.0 |
| Demo | SauerkrautLM-GLiNEREL Interactive Knowledge Graph: PDF → knowledge graph, text extraction, benchmarks |
Try it: SauerkrautLM-GLiNEREL Interactive Knowledge Graph: upload a PDF, explore the graph and export it as JSON, CSV, GraphML or Cypher (Neo4j).
Quickstart: glinerel-fast
glinerel-fast is our new inference library for SauerkrautLM-GLiNEREL, written for CPUs: about 1,600 lines of plain PyTorch, no transformers; also runs on NVIDIA and Apple GPUs.
pip install -U glinerel-fast # private repo: hf auth login
from glinerel_fast import GLiNERel
model = GLiNERel.from_pretrained("VAGOsolutions/SauerkrautLM-GLiNEREL-314m") # device="cuda", precision="bf16" on GPUs
result = model.extract(
"Marie Curie was born in Warsaw. She married Pierre Curie, a professor at the University of Paris.",
entities=["person", "location", "organization"],
relations=["born in", "spouse", "works for"],
)
# {"entities": [{label, text, start, end, score}, ...], "relations": [{label, head, tail, score}, ...]}
model.redact("Call Laura Bianchi at +39 347 555 0192.", ["first name", "last name", "phone number"])
# 'Call [FIRST_NAME] [LAST_NAME] at [PHONE_NUMBER].'
What makes it fast
- Packed batches: the tokens of all texts are concatenated without padding; only attention sees a padded view.
- Fused matrices: q/k/v and the SwiGLU gate/up projections are one matrix product each; the LFM2 short convolutions run as three shifted multiply-adds that never cross text boundaries.
- No 4-D intermediate in span scoring: the FiLM layer is rewritten algebraically, so the texts × labels × spans × width tensor is never built.
- Cache-sized CPU batches: texts sorted by length, at most ~2,048 tokens per batch so activations stay in the CPU cache; tokenized words and label prompts are cached.
- Inference-only weights: training heads are dropped at load time, no
transformersmodel is built. - GPU (0.1.1): span selection on the GPU, an asynchronous pipeline and CUDA graphs for small batches: about 3 ms per text on an H100.
- Same predictions: in fp32 the output matches the reference implementation exactly (agreement F1 1.000).
Pruned versions
SauerkrautLM-GLiNEREL-128m and SauerkrautLM-GLiNEREL-72m are this model after structured width pruning and knowledge distillation (all 14 layers and heads kept).
Speed
One German document (1,065 characters), against gliner2.5 and 4B generative models.
Results
Development splits, zero-shot, against gliner2.5, gliner-relex, GPT-6 Luna and Qwen3.8-27B.
German relations (RED^FM test split).
German entities (RED^FM and MobIE test splits).
Tokens, latency and cost of the LLM baselines.
LLM baselines with reasoning and four prompts (600-record subset).
Thresholds are chosen per benchmark; LLMs get the same label sets with one fixed instruction at temperature 0.
Citation
@misc{sauerkrautlm_glinerel_2026,
title={SauerkrautLM-GLiNEREL: Joint Entity, PII and Relation Extraction in One Encoder Pass},
author={Michele Montebovi and Hakim Bedhief},
organization={VAGO Solutions},
url={https://huggingface.co/VAGOsolutions/SauerkrautLM-GLiNEREL-314m},
year={2026}
}
Family: SauerkrautLM-GLiNEREL-314m · SauerkrautLM-GLiNEREL-128m · SauerkrautLM-GLiNEREL-72m