The primary way to stop electrical fires is cut the power. Power is coming from the batteries, so try to stop current by disconnecting load.
Another thread reports a fire involving 16s7p battery. Not certain the cause, but the 7 strings of cells were paralleled through fuses only, no relay or BMS FETs to disconnect. That would be a good addition. Idea is to stop over-charging or over-discharging before there is catastrophic failure, and be able to operate with a string out of the circuit if cells imbalanced.
So, after 4 to 5 years of working flawless, the 100 kwh lifepo4 battery caught fire at night and burned our house down. Luckily our family just made in out on time. Inspection of the fire expert revealed that a melt fuse melted, and created an arc between the 2 points wich ultimatly started the...
diysolarforum.com
Heat and smoke alarms could be used to trigger shutdown.
LiFePO4 vents below auto-ignition temperature, but gasses can be ignited by a spark. So want contactors and fuses of an explosion-proof type. And want gasses vented outside, so they won't built up and enter house when door opened. Forced air with fan would be good.