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-450M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2.5-VL-450M 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-450M") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("LiquidAI/LFM2.5-VL-450M") model = AutoModelForMultimodalLM.from_pretrained("LiquidAI/LFM2.5-VL-450M", 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=40) 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-450M 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-450M" # 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-450M", "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-450M
- SGLang
How to use LiquidAI/LFM2.5-VL-450M 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-450M" \ --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-450M", "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-450M" \ --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-450M", "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-450M with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2.5-VL-450M
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -71,9 +71,9 @@ LFM2.5-VL-450M is a general-purpose vision-language model with the following fea
|
|
| 71 |
| Model | Description |
|
| 72 |
|-------|-------------|
|
| 73 |
| [**LFM2.5-VL-450M**](https://huggingface.co/LiquidAI/LFM2.5-VL-450M) | Original model checkpoint in native format. Best for fine-tuning or inference with Transformers and vLLM. |
|
| 74 |
-
| [LFM2.5-VL-450M-MLX-8bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-8bit) | MLX format for Apple Silicon. Optimized for fast on-device inference on Mac with [mlx-vlm](https://github.com/Blaizzy/mlx-vlm). Also available in [4bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-4bit), [5bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-5bit), [6bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-6bit), and [bf16](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-bf16). |
|
| 75 |
| [LFM2.5-VL-450M-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-GGUF) | Quantized format for llama.cpp and compatible tools. Optimized for CPU inference and local deployment with reduced memory usage. |
|
| 76 |
| [LFM2.5-VL-450M-ONNX](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-ONNX) | ONNX Runtime format for cross-platform deployment. Enables hardware-accelerated inference across diverse environments (cloud, edge, mobile). |
|
|
|
|
| 77 |
|
| 78 |
We recommend using it for general vision-language workloads, captioning and object detection. It’s not well-suited for knowledge-intensive tasks or fine-grained OCR.
|
| 79 |
|
|
@@ -212,7 +212,6 @@ response = processor.tokenizer.decode(outputs[0, input_ids.shape[1]:], skip_spec
|
|
| 212 |
| [vLLM](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/vllm#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1sUfQlqAvuAVB4bZ6akYVQPGmHtTDUNpF?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 213 |
| [SGLang](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/sglang#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1qJlAFag223yFOZGzuMIkYUFhybM9ao5g?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 214 |
| [llama.cpp](https://github.com/ggml-org/llama.cpp) | Cross-platform inference with CPU offloading. | <a href="https://docs.liquid.ai/lfm/inference/llama-cpp#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1q2PjE6O_AahakRlkTNJGYL32MsdUcj7b?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 215 |
-
| [mlx-vlm](https://github.com/Blaizzy/mlx-vlm) | Apple Silicon inference with MLX. | [LFM2.5-VL-450M-MLX-8bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-8bit) | - |
|
| 216 |
|
| 217 |
## 🔧 Fine-tuning
|
| 218 |
|
|
|
|
| 71 |
| Model | Description |
|
| 72 |
|-------|-------------|
|
| 73 |
| [**LFM2.5-VL-450M**](https://huggingface.co/LiquidAI/LFM2.5-VL-450M) | Original model checkpoint in native format. Best for fine-tuning or inference with Transformers and vLLM. |
|
|
|
|
| 74 |
| [LFM2.5-VL-450M-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-GGUF) | Quantized format for llama.cpp and compatible tools. Optimized for CPU inference and local deployment with reduced memory usage. |
|
| 75 |
| [LFM2.5-VL-450M-ONNX](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-ONNX) | ONNX Runtime format for cross-platform deployment. Enables hardware-accelerated inference across diverse environments (cloud, edge, mobile). |
|
| 76 |
+
| [LFM2.5-VL-450M-MLX-8bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-8bit) | MLX format for Apple Silicon. Optimized for fast on-device inference on Mac with [mlx-vlm](https://github.com/Blaizzy/mlx-vlm). Also available in [4bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-4bit), [5bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-5bit), [6bit](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-6bit), and [bf16](https://huggingface.co/LiquidAI/LFM2.5-VL-450M-MLX-bf16). |
|
| 77 |
|
| 78 |
We recommend using it for general vision-language workloads, captioning and object detection. It’s not well-suited for knowledge-intensive tasks or fine-grained OCR.
|
| 79 |
|
|
|
|
| 212 |
| [vLLM](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/vllm#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1sUfQlqAvuAVB4bZ6akYVQPGmHtTDUNpF?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 213 |
| [SGLang](https://github.com/vllm-project/vllm) | High-throughput production deployments with GPU. | <a href="https://docs.liquid.ai/deployment/gpu-inference/sglang#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1qJlAFag223yFOZGzuMIkYUFhybM9ao5g?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
| 214 |
| [llama.cpp](https://github.com/ggml-org/llama.cpp) | Cross-platform inference with CPU offloading. | <a href="https://docs.liquid.ai/lfm/inference/llama-cpp#vision-models">Link</a> | <a href="https://colab.research.google.com/drive/1q2PjE6O_AahakRlkTNJGYL32MsdUcj7b?usp=sharing"><img src="https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/vlOyMEjwHa_b_LXysEu2E.png" width="110" alt="Colab link"></a> |
|
|
|
|
| 215 |
|
| 216 |
## 🔧 Fine-tuning
|
| 217 |
|