The Sun is a known quiescent gamma-ray source. Its quiescent gamma-ray emission is produced by Galactic cosmic rays (CRs) interacting with its surface (disc component) and with its photon field (spatially extended diffuse component). This extended component, by inverse-Compton scattering of CR electrons on the solar photons of the heliosphere, extends to the whole sky and it is above the background even at large angular distances from the Sun. It was studied already with EGRET, and now with Fermi LAT with higher significance. Observations of the inverse-Compton component allow obtaining information of CRs close to the Sun and in the Heliosphere as a function of different periods of solar activity. However, precise model calculations are needed. StellarICs (Stellar Inverse-Compton scattering) is a code to compute gamma-ray emission from inverse-Compton scattering by CR electrons in the Heliosphere and in the photospheres of stars. The software is publicly available and it is under continuing development. We will present our code including up-to-date models. This code is used for analyzing the Sun in Fermi LAT data and for generating the solar template officially released with the Fermi Science Tools.