  Conceptually reconstructing the physical conditions in relativistic jets,
given the observed electromagnetic spectrum, poses a complex inverse problem.
We aim to obtain a better understanding of the mechanisms operating in
relativistic jets through the modeling of their broadband electromagnetic
spectrum. We develop an inhomogeneous jet model where the injection of
relativistic primary and secondary particles takes place in a spatially
extended region. We calculate the contribution of all particles species to the
jet emissivity due to several processes, and assess the effect of gamma-ray
absorption in internal and external photon fields. A number of specific models
with different parameters are computed to explore the possibilities of this
scenario. We obtain a variety of spectral shapes depending on the model
parameters, some of them predicting significant gamma-ray emission. The
observed broadband spectrum of the low-mass microquasar XTE J1118+480 can be
satisfactorily reproduced by the model. Our results indicate that outbursts
similar to those displayed in the past by XTE J1118+480 might be detected with
present-day gamma-ray instruments.
