badluma/lfm2.5-vl-450m-wildfire
058
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
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 2048Then 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