  Stellar ultraviolet (UV) radiation drives photochemistry, and
extreme-ultraviolet (EUV) radiation drives mass loss in exoplanet atmospheres.
However, the UV flux is partly unobservable due to interstellar absorption,
particularly in the EUV range (100--912 A). It is therefore necessary to
reconstruct the unobservable spectra in order to characterize the radiation
environment of exoplanets. In the present work, we use a radiative transfer
code SSRPM to build one-dimensional semi-empirical models of two M dwarf
exoplanet hosts, GJ 832 and GJ 581, and synthesize their spectra. SSRPM is
equipped with an extensive atomic and molecular database and full-NLTE
capabilities. We use observations in the visible, ultraviolet, and X-ray ranges
to constrain atmospheric structures of the modeled stars. The synthesized
integrated EUV fluxes are found to be in good agreement with other
reconstruction techniques, but the spectral energy distributions (SEDs)
disagree significantly across the EUV range. More than 2/3 of the EUV flux is
formed above $10^5$ K. We find that the far ultraviolet (FUV) continuum
contributes 42--54 % of the entire FUV flux between 1450--1700 A. The
comparison of stellar structures of GJ 832 and GJ 581 suggests that GJ 832 is a
more magnetically active star, which is corroborated by other activity
indicators.
