Liquid AI's LFM2.5-VL-Extract Outputs Clean JSON Directly From Images
Liquid AI's new Extract models skip the parsing layer entirely, returning clean JSON from images natively on any device
Takeaways
- Liquid AI released LFM2.5-VL-1.6B-Extract and LFM2.5-VL-450M-Extract, vision models that return structured JSON natively from images.
- You pass an image and a YAML field list; the model returns a populated JSON object with no free-form text or post-processing needed.
- The 1.6B model scores 99.6 JSON Validity and 90.6 VLM Judge Score, competitive with 4B-class models on structured extraction benchmarks.
- The 450M model targets phones and embedded SoCs, outperforming sub-1B VLMs and competitive with models 4× its size.
- Both are open-weight, run via Transformers v5.1+, vLLM, SGLang, and GGUF-quantized for Ollama and LM Studio.
- Models are scoped to single-image flat JSON extraction; multi-image reasoning and free-form VQA are out of scope by design.
Most vision pipelines have a dirty secret: after the model gives you its answer, you still need another layer of code to parse that answer into something your system can actually use. Liquid AI just shipped two models designed to make that problem disappear. LFM2.5-VL-1.6B-Extract and LFM2.5-VL-450M-Extract are vision-language models that take an image and a schema, and return a populated JSON object. No free-form text. No regex. No post-processing.
The problem they are solving
Standard vision-language models (VLMs) are generalists. Ask one to describe an invoice, and it will write you a paragraph. That paragraph is useful for a human, but it is a liability for a pipeline. Your downstream system expects a field called invoice_total, not a sentence that contains the number somewhere in it. Most edge AI applications require models that excel in one particular task. Typically, this requires fine-tuning general-purpose models for a given task, but fine-tuning remains a challenge for many users due to a lack of time, data, or compute. The Extract models are Liquid's answer to that gap.
How it works
You specify what to extract as a YAML field list in the system prompt, and the model returns a JSON object with those fields. Structured outputs integrate cleanly with rule-based systems and downstream pipelines. The interface is intentionally minimal:
- System prompt: a YAML list of field names and plain-English descriptions
- User message: the image
- Output: a strict JSON object, nothing else
The model also supports an enum constraint, where you provide a list of allowed values for a field and the model will only return one of those values. This is useful when you need categorical outputs like "smooth" | "rough" | "grainy" rather than free-form strings.
from transformers import AutoProcessor, AutoModelForImageTextToText
from transformers.image_utils import load_image
model_id = "LiquidAI/LFM2.5-VL-1.6B-Extract"
model = AutoModelForImageTextToText.from_pretrained(
model_id, device_map="auto", dtype="bfloat16", trust_remote_code=True
)
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
image = load_image("path/to/invoice.png")
fields_yaml = """invoice_total: The total amount due on the invoice
vendor_name: The name of the company issuing the invoice
due_date: The payment due date"""
system_prompt = f"""Extract the following from the image:
{fields_yaml}
Respond with only a JSON object."""
conversation = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": [{"type": "image", "image": image}]},
]
inputs = processor.apply_chat_template(
conversation, add_generation_prompt=True,
return_tensors="pt", return_dict=True, tokenize=True
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
response = processor.batch_decode(
outputs[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True
)[0]
print(response)
# {"invoice_total": "$1,240.00", "vendor_name": "Acme Corp", "due_date": "2026-07-01"}