We present simulations of star-forming filaments incorporating on of the largest chemical network used to date on-the-fly in a 3D-magnetohydrodynamic (MHD) simulation. The network contains 37 chemical species and about 300 selected reaction rates. For this, we use the newly developed package krome (Grassi et al.). We combine the krome package with an algorithm which allows us to calculate the column density and attenuation of the interstellar radiation field necessary to properly model heating and ionization rates. Our results demonstrate the feasibility of using such a complex chemical network in 3D-MHD simulations on modern supercomputers. We perform simulations with different strengths of the interstellar radiation field and the cosmic ray ionization rate. We find that, towards the centre of the filaments, there is gradual conversion of hydrogen from H to H2 as well as of C+ over C to CO. Moreover, we find a decrease of the dust temperature towards the centre of the filaments in agreement with recent HERSCHEL observations.