Image-Text-to-Text
Transformers
Safetensors
lfm2_vl
liquid
lfm2
lfm2-vl
edge
lfm2.5-vl
lfm2.5
conversational
Instructions to use LiquidAI/LFM2.5-VL-1.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2.5-VL-1.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LiquidAI/LFM2.5-VL-1.6B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("LiquidAI/LFM2.5-VL-1.6B") model = AutoModelForMultimodalLM.from_pretrained("LiquidAI/LFM2.5-VL-1.6B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/LFM2.5-VL-1.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM2.5-VL-1.6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2.5-VL-1.6B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2.5-VL-1.6B
- SGLang
How to use LiquidAI/LFM2.5-VL-1.6B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LiquidAI/LFM2.5-VL-1.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2.5-VL-1.6B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LiquidAI/LFM2.5-VL-1.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2.5-VL-1.6B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use LiquidAI/LFM2.5-VL-1.6B with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2.5-VL-1.6B
Commit History
-
Restore original sales team contact line in contact section
919fde3 -
Add spacing between link bar and model title
dfee6b8 -
Rename Dev community to Discord in link bar
f8cbdb2 -
Improve contact section copy and simplify link bar
22916d5 -
Add LEAP link back between Docs and Dev community
338cb33 -
Simplify link bar to Try LFM, Docs, Dev community
7b5df6d
-
Split link bar into two rows for mobile friendliness
c099462 -
Add LEAP link back to top link bar
bbb5630 -
Revert Discord invite link to liquid-ai
a165b0c -
Update top link bar: single row, shorter labels, new Discord URL
87d6656 -
Split top link bar into two rows
b762395 -
Fix pill button text colour to black
9ef52c3 -
Style top link bar as pill buttons
e3050e4 -
Improve top link bar and add Discord community link
0b10a9e
-
Add Discord community link to README
e5d207a
-
Update README.md
Verified signature064b510 -
Update chat template to make it oai compatible in vLLM
Verified signaturef65f401
-
Update transformers commit
Verified signature6080424
-
Update chat template to properly handle system message
Verified signature7e4d5e3
-
Update README.md
Verified signaturee865cc6
-
Update README.md
Verified signatured3f8a9f
-
Update README.md (#3)
Verified signature- Update README.md (096f354bb9874a9cca3e27d627ca6a1767ac5465) - Update README.md (d246a68669d21e0b9fc9e85d7d083a909c4761bc) - Update README.md (026bcd7d8ca796ce0e77a4998a6d21e5f7561c9c) Co-authored-by: Tianshu Yu <tianshu-yu@users.noreply.huggingface.co>48442fa
-
Update README.md
Verified signature9747fc8
-
Update README.md
Verified signature2a067a2
-
Update playground link
Verified signaturecbf1198 -
Update README.md
Verified signature396788b -
Update README.md
Verified signature3f89ea6 -
Update README.md
Verified signature5c03568 -
Upload LICENSE
Verified signature1a09d2f -
Upload folder using huggingface_hub
Verified signaturedf18191 -
initial commit
Verified signature4a9120c