We present and test chemical models for three-dimensional hydrodynamical simulations of galaxies. We explore the effect of changing key parameters such as metallicity, radiation and non-equilibrium versus equilibrium metal cooling approximations on the transition between the gas phases in the interstellar medium. The microphysics is modelled by employing the public chemistry package KROME and the chemical networks have been tested to work in a wide range of densities and temperatures. We describe a simple H/He network following the formation of H$_2$, and a more sophisticated network which includes metals. Photochemistry, thermal processes, and different prescriptions for the H$_2$ catalysis on dust are presented and tested within a one-zone framework. The resulting network is made publicly available on the KROME webpage. We find that employing an accurate treatment of the dust-related processes induces a faster HI--H$_2$ transition. In addition, we show when the equilibrium assumption for metal cooling holds, and how a non-equilibrium approach affects the thermal evolution of the gas and the HII--HI transition. These models can be employed in any hydrodynamical code via an interface to KROME and can be applied to different problems including isolated galaxies, cosmological simulations of galaxy formation and evolution, supernova explosions in molecular clouds, and the modelling of star-forming regions. The metal network can be used for a comparison with observational data of CII 158 $\mu$m emission both for high-redshift as well as for local galaxies.