Instructions to use steampunque/LFM2-VL-1.6B-MP-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use steampunque/LFM2-VL-1.6B-MP-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="steampunque/LFM2-VL-1.6B-MP-GGUF", filename="LFM2-VL-1.6B.Q8_0_H.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use steampunque/LFM2-VL-1.6B-MP-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H # Run inference directly in the terminal: llama cli -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H # Run inference directly in the terminal: llama cli -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H # Run inference directly in the terminal: ./llama-cli -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H # Run inference directly in the terminal: ./build/bin/llama-cli -hf steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
Use Docker
docker model run hf.co/steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
- LM Studio
- Jan
- Ollama
How to use steampunque/LFM2-VL-1.6B-MP-GGUF with Ollama:
ollama run hf.co/steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
- Unsloth Studio
How to use steampunque/LFM2-VL-1.6B-MP-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for steampunque/LFM2-VL-1.6B-MP-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for steampunque/LFM2-VL-1.6B-MP-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for steampunque/LFM2-VL-1.6B-MP-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use steampunque/LFM2-VL-1.6B-MP-GGUF with Docker Model Runner:
docker model run hf.co/steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
- Lemonade
How to use steampunque/LFM2-VL-1.6B-MP-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull steampunque/LFM2-VL-1.6B-MP-GGUF:Q8_0_H
Run and chat with the model
lemonade run user.LFM2-VL-1.6B-MP-GGUF-Q8_0_H
List all available models
lemonade list
Mixed Precision GGUF layer quantization of LFM2-VL-1.6B by LiquidAI
Original model: https://huggingface.co/LiquidAI/LFM2-VL-1.6B
license lfm1.0
The hybrid quant employs different quantization levels on a per layer basis to enable both high performance and small file size at the same time. This particular quant achieves a ~1.07G gguf with the same perplexity as a ~1.24G Q8_0 GGUF. The quants employed are all K to avoid slow CPU or older GPU processing of IQ quants. For this file the layer quants are as follows:
Q6_K_S : Q6_K
Q6_K_M : Q6_K_S + attn_v = Q8_0, ffn_d = Q8_0
Q6_K_L : Q6_K_M + attn_o = Q8_0
LAYER_TYPES='[
[0 ,"Q8_0" ],[1 ,"Q6_K_L"],[2 ,"Q6_K_M"],[3 ,"Q6_K_S"],
[4 ,"Q6_K_S"],[5 ,"Q6_K_S"],[6 ,"Q6_K_S"],[7 ,"Q6_K_S"],
[8 ,"Q6_K_M"],[9 ,"Q6_K_M"],[10,"Q6_K_M"],[11,"Q6_K_M"],
[12,"Q6_K_L"],[13,"Q6_K_L"],[14,"Q6_K_L"],[15,"Q8_0" ]
]'
FLAGS="--token-embedding-type Q8_0 --output-tensor-type Q8_0 --layer-types-high"
Comparison:
| Quant | size | PPL | Comment |
|---|---|---|---|
| Q8_0 | 1.24e9 | 12.9 | Q8_0 with default embedding and output |
| Q8_0_H | 1.07e9 | 12.9 | Hybrid quant with Q8_0 embedding Q8_0 output |
Usage:
LFM2-VL-1.6B is a vision capable edge model. It can be used together with its multimedia projector layers to process images and text inputs and generate text outputs. The mmproj file is made available in this repository. The mmproj for this model is made available in default (F16), Q8_0, and Q4_0 quants for possible use with constrained memory/compute on edge devices. To create Q8_0 and Q4_0 mmproj quants the clip ffn tensor length is zero padded to be divisible by 32 (from 4304 to 4320).
To test vision mode follow the docs in the mtmd readme in the tools directory of the source tree https://github.com/ggml-org/llama.cpp/blob/master/tools/mtmd/README.md .
A llama.cpp bug fix for LFM2-VL-1.6B inference was completed at b7210 which is minimum version which should be used to run model as it results in noticeably improved vision evals.
Benchmarks:
A full set of benchmarks for the model is given here: https://huggingface.co/spaces/steampunque/benchlm . Benches were run after b7210 fix for LFM2-VL.
Download the file from below:
| Link | Type | Size/e9 B | Notes |
|---|---|---|---|
| LFM2-VL-1.6B.Q8_0_H.gguf | Q8_0_H | 1.07e9 B | 0.17B smaller than Q8_0 |
| LFM2-VL-1.6B.mmproj.gguf | F16 | 0.83e9 B | multimedia projector |
| LFM2-VL-1.6B.mmproj.Q8_0.gguf | Q8_0 | 0.44e9 B | multimedia projector |
| LFM2-VL-1.6B.mmproj.Q4_0.gguf | Q4_0 | 0.24e9 B | multimedia projector |
A discussion thread about the hybrid layer quant approach can be found here on the llama.cpp git repository:
- Downloads last month
- 53
8-bit
Model tree for steampunque/LFM2-VL-1.6B-MP-GGUF
Base model
LiquidAI/LFM2-VL-1.6B