Shouldn't be an issue putting inverter and LiFePO4 batteries in the same compartment. You may be thinking of venting, as in lead acid batteries??
The only real concerns are first, making certain everything is secure and can't move. Next is heat - the inverter needs good air circulation. The specs for your inverter should tell how much clearance it needs for heat ventilation.
It's best to have the inverter in fairly close proximity to the battery bank to avoid voltage loss in long cable runs.
In my class C lithium conversion I relocated the batteries from the steps to a large rear storage compartment. With planning you can put the batteries and inverter for lithium just about anywhere. Just keep in mind the cables that ran to the steps might need a heavier gauge, and of course rerouted.
__________________
|