Liquid Image to JSON: Structured Extraction with LFM2.5-VL-1.6B-Extract
Liquid image-to-JSON extraction turns a photo into user-defined JSON with LFM2.5-VL-1.6B-Extract. This guide explains the YAML field list, enum syntax, a runnable Transformers example, serving options, benchmark scores with their setup, and the model's flat-JSON and single-image limits. Readers searching for "Liquid Image to JSON" will find a source-checked answer here.
View 1 referenceAllow the functional cookie to save your likes. Privacy details
What does Liquid Image to JSON mean?
Liquid Image to JSON is a task-specific workflow built around LFM2.5-VL-1.6B-Extract, a compact vision-language model from Liquid AI. You supply an image and a list of fields; the model returns a JSON object containing only those fields. It is built for structured extraction, not open-ended image chat. Model card
How do you describe the fields to extract?
Fields are written as a YAML-style list in the system prompt, one name: description pair per line. You add enum choices in plain language inside the description, such as 'select from smooth, rough, or grainy'. The model then returns a flat JSON object whose keys match those field names.
wood_color: The overall coloration of the wood surface
wood_texture: The tactile quality of the wood surface, select from smooth, rough, or grainy
wood_pattern: The pattern types visible on the wood surface
Can you show a minimal Liquid Image to JSON example?
Yes. The model card's example uses Transformers v5.1 or newer with AutoModelForImageTextToText. It loads an image, places the field list in the system prompt and asks for JSON only. Greedy decoding is recommended, so do_sample is false in the working example.
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("https://huggingface.co/LiquidAI/LFM2.5-VL-1.6B-Extract/resolve/main/sample_image.png")
fields_yaml = """wood_color: The overall coloration of the wood surface
wood_texture: The tactile quality of the wood surface
wood_pattern: The pattern types visible on the wood surface"""
system_prompt = f"Extract the following from the image:\n\n{fields_yaml}\n\nRespond with only a JSON object. Do not include any text outside the JSON."
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)
print(processor.batch_decode(outputs[:, inputs["input_ids"].shape[1]:],
skip_special_tokens=True)[0])
Which backends can run the extraction model?
LFM2.5-VL-1.6B-Extract runs through Transformers, vLLM, SGLang and Docker Model Runner. Quantized builds are available for llama.cpp, Ollama and LM Studio. The model card says it is not deployed by any hosted inference provider, so you will run it locally or on infrastructure you control.
pip install vllm
vllm serve "LiquidAI/LFM2.5-VL-1.6B-Extract"
pip install sglang
python3 -m sglang.launch_server --model-path "LiquidAI/LFM2.5-VL-1.6B-Extract" --host 0.0.0.0 --port 30000
docker model run hf.co/LiquidAI/LFM2.5-VL-1.6B-Extract
How accurate is Liquid's image-to-JSON extraction?
Liquid evaluated the model on 2,000 (image, schema, JSON) triples, with reference labels from an ensemble of frontier multimodal models and a separate vision judge. The extract model scored 99.6 on JSON validity, 99.6 on schema F1 and 90.6 on the VLM judge, ahead of similarly sized open models. Model card
| Model | Params | JSON validity | Schema F1 | VLM judge |
|---|---|---|---|---|
| LFM2.5-VL-1.6B-Extract | 1.6B | 99.6 | 99.6 | 90.6 |
| LFM2.5-VL-1.6B | 1.6B | 91.8 | 75.8 | 66.0 |
| SmolVLM2-2.2B-Instruct | 2.25B | 84.4 | 82.9 | 64.8 |
| Qwen3.5-2B | 2.27B | 97.9 | 97.7 | 89.7 |
| (ref) Qwen3-VL-4B-Instruct | 4.44B | 99.8 | 99.7 | 92.0 |
The judge was Qwen/Qwen3.5-35B-A3B, and the full evaluation pipeline ships in the repository's model_eval/ directory.
What are the limits of this approach?
The benchmark only describes a single image, a YAML field list and a flat JSON object. Liquid says performance is not expected to transfer to multi-image reasoning or free-form visual question answering. The model is intended for single-turn use with greedy decoding, and accepts one image at dynamic resolution with a 128,000-token context.
When should you use a general VLM instead?
Choose a general vision-language model when you need multi-image reasoning, open-ended answers or nested document structures. Choose Liquid's extract model when the output must be schema-stable JSON for a downstream pipeline, such as product attributes, safety events or object counts. The difference is predictability, not raw capability.
| Need | Better fit |
|---|---|
| Flat JSON with fixed field names | LFM2.5-VL-1.6B-Extract |
| Multi-image comparison | General VLM |
| Free-form visual explanation | General VLM |
| On-device edge extraction | Extract model with llama.cpp / Ollama |
Common image-to-JSON questions
These questions reflect what practitioners actually ask before adopting a structured extraction model. Answers are limited to what the published model card states; no performance is claimed outside the benchmark's single-image, flat-JSON setup described above. Use them as a checklist before wiring the model into a pipeline.
What license covers the weights?
The model is released under the LFM Open License v1.0, listed as lfm1.0 in the model metadata. Check the license text before commercial deployment.
Does it support nested JSON?
The model card describes a flat JSON object as the output form. Nested structures are outside the evaluated setup and should not be assumed to work reliably.
Can it process several images at once?
No. The documented input is a single image at dynamic resolution; multi-image reasoning is explicitly named as a task the benchmark does not cover.
Which fields work best for product images?
The model card names retail and e-commerce attribute tagging as a target use case. A practical schema uses short, objective fields such as colour, texture, pattern or material, with enum hints where the value set is known. Avoid fields that require reasoning across several images or external knowledge.
Do I need a GPU?
The model card does not publish a minimum hardware specification. Its Transformers example uses device_map="auto", and quantized builds are listed for llama.cpp, Ollama and LM Studio, which are common local paths. Server backends such as vLLM and SGLang are typically deployed on GPUs.
How do I reproduce the benchmark?
Liquid bundles the full evaluation pipeline in the repository's model_eval/ directory. It covers extraction, judging with a separate vision model and metric aggregation. You need your own (image, schema, JSON) set; the published 2,000-sample corpus is described but not distributed as a download in the model card.