To reveal the nature of high-energy gamma-ray sources and to understand the associated emission and acceleration mechanisms, we need detailed models capable of reproducing the observed energy spectra and morphologies. Gamma rays can be produced in non-thermal radiation processes involving protons and electrons interacting with the interstellar medium, magnetic fields and soft photon fields. These protons and electrons originate from cosmic-ray accelerators, such as supernova remnants or pulsar wind nebulae. However, the gamma-ray emission is not necessarily produced at the centre of the accelerators, as they can expand and cosmic rays can diffuse in ambient magnetic fields, ultimately transporting them through the interstellar medium.
In this contribution, we will present a software framework to model 3D distributions of cosmic-ray and gamma-ray emission around accelerators of varying complexity and to optimise the model parameters.We will also demonstrate the importance of modelling in 3D and discuss the challenges in determining the 3D location of the interstellar gas.