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-24B-A2B — our largest model is now available! Learn more →
350M parameter extraction model for edge deployment
| 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.
Schema:
- field_name: "Description of what to extract"
- nested_object:
- nested_field: "Description"
pip install "transformers>=5.0.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.
Schema:
- 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, 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], 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 \
-p "Extract product info from: 3 laptops at $999 each" \
--temp 0
Was this page helpful?