Specifications
Edge Deployment
Runs on mobile devices
Low Latency
Fastest extraction model
Batch Processing
High-volume extraction
Prompting Recipe
System Prompt Format:Quick Start
- Transformers
- llama.cpp
Install:Run:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 New: LFM2.5-24B-A2B — our largest reasoning model for fast, private agents on-device! Learn more →
350M parameter extraction model (deprecated - use LFM2.5-350M instead)
| Property | Value |
|---|---|
| Parameters | 350M |
| Context Length | 32K tokens |
| Task | Structured Extraction |
| Output Formats | JSON, XML, YAML |
temperature=0 (greedy decoding) for best results. This model is intended for single-turn conversations only.Identify and extract information matching the following schema.
Return data as a JSON object. Missing data should be omitted.
field_name: Description of what to extract
nested_object:
nested_field: Description
pip install "transformers>=5.2.0" torch accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "LiquidAI/LFM2-350M-Extract"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
system_prompt = """Identify and extract information matching the following schema.
Return data as a JSON object. Missing data should be omitted.
product: Product name
price: Price in dollars
quantity: Number of items
"""
user_input = "Order: 5 units of Widget Pro at $29.99 each"
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_input}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0, do_sample=False)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
hf download LiquidAI/LFM2-350M-Extract-GGUF \
--local-dir ./LFM2-350M-Extract-GGUF
llama-cli -m ./LFM2-350M-Extract-GGUF/LFM2-350M-Extract-Q4_K_M.gguf \
-sys $'Identify and extract information matching the following schema.\nReturn data as a JSON object. Missing data should be omitted.\n\nproduct: Product name\nprice: Price in dollars\nquantity: Number of items' \
-p 'Order: 5 units of Widget Pro at $29.99 each' \
--temp 0
Was this page helpful?