Views
No views yet
| 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 |
1{
2 "risk_level": "low | moderate | high | critical",
3 "dry_vegetation_present": true,
4 "steep_terrain": false,
5 "urban_interface": true,
6 "water_body_present": false,
7 "image_quality_limited": false
8}1from transformers import AutoModelForImageTextToText, AutoProcessor
2from PIL import Image
3
4model = AutoModelForImageTextToText.from_pretrained("badluma/lfm2.5-vl-450m-wildfire")
5processor = AutoProcessor.from_pretrained("badluma/lfm2.5-vl-450m-wildfire")
6
7image = Image.open("satellite.png")
8
9messages = [
10 {
11 "role": "system",
12 "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)."
13 },
14 {
15 "role": "user",
16 "content": [
17 {"type": "image", "image": image},
18 {"type": "text", "text": "Analyze this satellite image. Return only the JSON."}
19 ]
20 }
21]
22
23inputs = processor.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
24output = model.generate(**inputs, max_new_tokens=128, temperature=0.0, do_sample=False)
25print(processor.decode(output[0], skip_special_tokens=True))lfm2.5-vl-450m-wildfire-Q8_0.gguf — main model weights (Q8_0)mmproj-LFM2.5-VL-450m-Q8_0.gguf — multimodal projector1llama-server \
2 -m lfm2.5-vl-450m-wildfire-Q8_0.gguf \
3 --mmproj mmproj-LFM2.5-VL-450m-Q8_0.gguf \
4 --port 8190 --host 127.0.0.1 -c 2048http://127.0.0.1:8190/v1/chat/completions with standard OpenAI-compatible format.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)1cd finetune
2uv sync
3make train # Runs on Modal H100
4make download-checkpoint
5bash scripts/export_gguf.sh