Model reference · open weights

LFM2-Extract

Available as managed deployment Licence fee LLMs LiquidAI Text gen 2 variants 2k dl/mo

LFM2-Extract is an open-weight language model from LiquidAI. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

Released byLiquidAI
TypeLanguage models
TaskText gen
Parameters (lead)1.2B
Context125k tokens
Runs withtransformers
Based onLiquidAI/LFM2-1.2B
Released2025-08-22
Popularity2k downloads / month
LicenceCommercial licence needed

About

What LFM2-Extract is

src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/2b08LKpev0DNEk6DlnWkY.png" alt="Liquid AI" style="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;" />

Read the full model card

LFM2-1.2B-Extract

Based on LFM2-1.2B, LFM2-1.2B-Extract is designed to extract important information from a wide variety of unstructured documents (such as articles, transcripts, or reports) into structured outputs like JSON, XML, or YAML.

Use cases:

  • Extracting invoice details from emails into structured JSON.
  • Converting regulatory filings into XML for compliance systems.
  • Transforming customer support tickets into YAML for analytics pipelines.
  • Populating knowledge graphs with entities and attributes from unstructured reports.

You can find more information about other task-specific models in this blog post.

📄 Model details

Generation parameters: We strongly recommend using greedy decoding with a temperature=0.

System prompt: If no system prompt is provided, the model will default to JSON outputs. We recommend providing a system prompt with a specific format (JSON, XML, or YAML) and a given schema to improve accuracy (see the following example).

Supported languages: English, Arabic, Chinese, French, German, Japanese, Korean, Portuguese, and Spanish.

Chat template: LFM2 uses a ChatML-like chat template as follows:

Return data as a JSON object with the following schema:\n[...]
Caenorhabditis elegans is a free-living transparent nematode about 1 mm in length that lives in temperate soil environments.
{
"species": "C. elegans",
"genus": "Caenorhabditis",
"description": "A free-living transparent nematode about 1 mm in length that lives in temperate soil environments.",
[...]{

You can automatically apply it using the dedicated .apply_chat_template() function from Hugging Face transformers.

[!WARNING] ⚠️ The model is intended for single-turn conversations.

The data used for training these models was primarily synthetic, which allowed us to ensure a diverse data mix. We used a range of document types, domains, styles, lengths, and languages. We also varied the density and distribution of relevant text in the documents. In some cases, the extracted information was clustered in one part of the document; in others, it’s spread throughout. We applied the same approach of ensuring diversity when creating synthetic user requests and designing the structure of the model outputs. The data generation process underwent many iterations, incorporating ideas and feedback from across the Liquid AI team.

📈 Performance

We evaluated LFM2-Extract on a dataset of 5,000 documents, covering over 100 topics with a mix of writing styles, ambiguities, and formats. We used a combination of five metrics to capture a balanced view on syntax, accuracy, and faithfulness:

  • Syntax score: Checks whether outputs parse cleanly as valid JSON, XML, or YAML.
  • Format accuracy: Verifies that outputs match the requested format (e.g., JSON when JSON is requested).
  • Keyword faithfulness: Measures whether values in the structured output actually appear in the input text.
  • Absolute scoring: A judge LLM scores quality on a 1-5 scale, assessing completeness and correctness of extractions.
  • Relative scoring: We ask a judge LLM to choose the best answer between the extraction model’s output and the ground-truth answer.

LFM2-1.2B-Extract can output complex objects in different languages on a level higher than Gemma 3 27B, a model 22.5 times its size.

🏃 How to run

You can use the following Colab notebooks for easy inference and fine-tuning:

NotebookDescriptionLink
InferenceRun the model with Hugging Face's transformers library.
SFT (TRL)Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using TRL.
DPO (TRL)Preference alignment with Direct Preference Optimization (DPO) using TRL.
SFT (Axolotl)Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using Axolotl.
SFT (Unsloth)Supervised Fine-Tuning (SFT) notebook with a LoRA adapter using Unsloth.

📬 Contact

  • If you are interested in custom solutions with edge deployment, please contact our sales team.

Citation

@article{liquidai2025lfm2,
 title={LFM2 Technical Report},
 author={Liquid AI},
 journal={arXiv preprint arXiv:2511.23404},
 year={2025}
}

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys lfm2-extract for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (lfm2-extract below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/chat/completions \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"lfm2-extract","messages":[{"role":"user","content":"Hello"}]}'

Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms