Image-Text-to-Text
Transformers
Safetensors
lfm3_vl
liquid
lfm3
edge
conversational
custom_code
Eval Results
Instructions to use LiquidAI/LFM3-VL-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM3-VL-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LiquidAI/LFM3-VL-2B", trust_remote_code=True) 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 AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("LiquidAI/LFM3-VL-2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/LFM3-VL-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM3-VL-2B" # 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/LFM3-VL-2B", "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/LFM3-VL-2B
- SGLang
How to use LiquidAI/LFM3-VL-2B 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/LFM3-VL-2B" \ --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/LFM3-VL-2B", "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/LFM3-VL-2B" \ --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/LFM3-VL-2B", "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/LFM3-VL-2B with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM3-VL-2B
Inference table: add LM Studio to GGUF; neutral desktop app sentence
Browse files
README.md
CHANGED
|
@@ -131,7 +131,7 @@ Choose a checkpoint variant for your inference framework and hardware.
|
|
| 131 |
</tr>
|
| 132 |
<tr style="border: 0;">
|
| 133 |
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-VL-2B-GGUF">GGUF</a></td>
|
| 134 |
-
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://docs.liquid.ai/deployment/on-device/llama-cpp">llama.cpp</a></td>
|
| 135 |
<td style="border: 0; padding: 0.55em 0.75em;">Local inference on CPUs and GPUs.</td>
|
| 136 |
</tr>
|
| 137 |
<tr style="border: 0;">
|
|
@@ -201,7 +201,7 @@ print(processor.batch_decode(generated_ids, skip_special_tokens=True)[0])
|
|
| 201 |
<details>
|
| 202 |
<summary><strong>On-device inference with llama.cpp</strong></summary>
|
| 203 |
|
| 204 |
-
For most on-device use cases, we recommend [llama.cpp](https://github.com/ggml-org/llama.cpp) b11960 or newer with the [GGUF checkpoints](https://huggingface.co/LiquidAI/LFM3-VL-2B-GGUF).
|
| 205 |
|
| 206 |
From a terminal, start a web chat UI and an OpenAI-compatible API at `http://localhost:8080`. With `-hf`, llama.cpp downloads the model and the matching vision projector (mmproj):
|
| 207 |
|
|
|
|
| 131 |
</tr>
|
| 132 |
<tr style="border: 0;">
|
| 133 |
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-VL-2B-GGUF">GGUF</a></td>
|
| 134 |
+
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://docs.liquid.ai/deployment/on-device/llama-cpp">llama.cpp</a>, <a href="https://docs.liquid.ai/deployment/on-device/lm-studio">LM Studio</a></td>
|
| 135 |
<td style="border: 0; padding: 0.55em 0.75em;">Local inference on CPUs and GPUs.</td>
|
| 136 |
</tr>
|
| 137 |
<tr style="border: 0;">
|
|
|
|
| 201 |
<details>
|
| 202 |
<summary><strong>On-device inference with llama.cpp</strong></summary>
|
| 203 |
|
| 204 |
+
For most on-device use cases, we recommend [llama.cpp](https://github.com/ggml-org/llama.cpp) b11960 or newer with the [GGUF checkpoints](https://huggingface.co/LiquidAI/LFM3-VL-2B-GGUF). To run it in a desktop app such as [Llama.app](https://llama.app) or [LM Studio](https://lmstudio.ai), click **Use this model** on the [GGUF page](https://huggingface.co/LiquidAI/LFM3-VL-2B-GGUF) and pick the app.
|
| 205 |
|
| 206 |
From a terminal, start a web chat UI and an OpenAI-compatible API at `http://localhost:8080`. With `-hf`, llama.cpp downloads the model and the matching vision projector (mmproj):
|
| 207 |
|