Instructions to use badluma/lfm2.5-vl-450m-wildfire with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use badluma/lfm2.5-vl-450m-wildfire with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="badluma/lfm2.5-vl-450m-wildfire", filename="lfm2.5-vl-450m-wildfire-Q8_0.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use badluma/lfm2.5-vl-450m-wildfire with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf badluma/lfm2.5-vl-450m-wildfire:Q8_0 # Run inference directly in the terminal: llama-cli -hf badluma/lfm2.5-vl-450m-wildfire:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf badluma/lfm2.5-vl-450m-wildfire:Q8_0 # Run inference directly in the terminal: llama-cli -hf badluma/lfm2.5-vl-450m-wildfire:Q8_0
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 badluma/lfm2.5-vl-450m-wildfire:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf badluma/lfm2.5-vl-450m-wildfire:Q8_0
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 badluma/lfm2.5-vl-450m-wildfire:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf badluma/lfm2.5-vl-450m-wildfire:Q8_0
Use Docker
docker model run hf.co/badluma/lfm2.5-vl-450m-wildfire:Q8_0
- LM Studio
- Jan
- vLLM
How to use badluma/lfm2.5-vl-450m-wildfire with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "badluma/lfm2.5-vl-450m-wildfire" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "badluma/lfm2.5-vl-450m-wildfire", "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/badluma/lfm2.5-vl-450m-wildfire:Q8_0
- Ollama
How to use badluma/lfm2.5-vl-450m-wildfire with Ollama:
ollama run hf.co/badluma/lfm2.5-vl-450m-wildfire:Q8_0
- Unsloth Studio new
How to use badluma/lfm2.5-vl-450m-wildfire 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 badluma/lfm2.5-vl-450m-wildfire 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 badluma/lfm2.5-vl-450m-wildfire to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for badluma/lfm2.5-vl-450m-wildfire to start chatting
- Docker Model Runner
How to use badluma/lfm2.5-vl-450m-wildfire with Docker Model Runner:
docker model run hf.co/badluma/lfm2.5-vl-450m-wildfire:Q8_0
- Lemonade
How to use badluma/lfm2.5-vl-450m-wildfire with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull badluma/lfm2.5-vl-450m-wildfire:Q8_0
Run and chat with the model
lemonade run user.lfm2.5-vl-450m-wildfire-Q8_0
List all available models
lemonade list
lfm2.5-vl-450m-wildfire
A wildfire risk classification model finetuned from LiquidAI/LFM2-VL-450M on satellite imagery. Given an RGB satellite image, returns a structured JSON risk assessment.
Model Details
| Base model | LiquidAI/LFM2-VL-450M |
| Architecture | Lfm2VlForConditionalGeneration (hybrid conv/attention + SigLIP2 vision encoder) |
| Parameters | ~450M |
| Finetuning method | LoRA (r=8, alpha=16) via TRL SFTTrainer |
| Training compute | Modal H100 |
| Epochs | 3 |
| Dataset | Paulescu/wildfire-prevention |
Output Format
The model returns a raw JSON object (no markdown, no explanation):
{
"risk_level": "low | moderate | high | critical",
"dry_vegetation_present": true,
"steep_terrain": false,
"urban_interface": true,
"water_body_present": false,
"image_quality_limited": false
}
Usage
With transformers
from transformers import AutoModelForImageTextToText, AutoProcessor
from PIL import Image
model = AutoModelForImageTextToText.from_pretrained("badluma/lfm2.5-vl-450m-wildfire")
processor = AutoProcessor.from_pretrained("badluma/lfm2.5-vl-450m-wildfire")
image = Image.open("satellite.png")
messages = [
{
"role": "system",
"content": "You are a wildfire risk analyst. Examine the satellite image and assess wildfire risk based strictly on what is visible. Respond with ONLY a raw JSON object β no markdown, no explanation, no code fences. Fields: risk_level (string: low/moderate/high/critical), dry_vegetation_present (boolean), steep_terrain (boolean), urban_interface (boolean), water_body_present (boolean), image_quality_limited (boolean)."
},
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Analyze this satellite image. Return only the JSON."}
]
}
]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=128, temperature=0.0, do_sample=False)
print(processor.decode(output[0], skip_special_tokens=True))
With llama-server (GGUF)
Download the quantized GGUF files from this repo:
lfm2.5-vl-450m-wildfire-Q8_0.ggufβ main model weights (Q8_0)mmproj-LFM2.5-VL-450m-Q8_0.ggufβ multimodal projector
llama-server \
-m lfm2.5-vl-450m-wildfire-Q8_0.gguf \
--mmproj mmproj-LFM2.5-VL-450m-Q8_0.gguf \
--port 8190 --host 127.0.0.1 -c 2048
Then POST to http://127.0.0.1:8190/v1/chat/completions with standard OpenAI-compatible format.
Finetuning Code
The full training pipeline is included in the finetune/ directory of this repo:
finetune/
βββ configs/finetune_lfm_450M.yaml # Training hyperparameters
βββ src/wildfire_prevention/ # Training source code
β βββ fine_tune.py # Main training script (Modal)
β βββ data_preparation.py # Dataset formatting
β βββ loaders.py # Model + dataset loading
β βββ config.py # Config schema
βββ scripts/
β βββ merge_lora.py # Merge LoRA adapter into base
β βββ export_gguf.sh # Convert to GGUF via llama.cpp
βββ Makefile # make train / make download-checkpoint
βββ pyproject.toml # Dependencies (uv)
Requirements: Python 3.12+, uv, Modal account, W&B account, HF token.
cd finetune
uv sync
make train # Runs on Modal H100
make download-checkpoint
bash scripts/export_gguf.sh
- Downloads last month
- 141
Model tree for badluma/lfm2.5-vl-450m-wildfire
Base model
LiquidAI/LFM2-VL-450M