  Aims. We introduce a new deep learning tool that estimates stellar parameters
(such as effective temperature, surface gravity, and extinction) of young
low-mass stars by coupling the Phoenix stellar atmosphere model with a
conditional invertible neural network (cINN). Our networks allow us to infer
the posterior distribution of each stellar parameter from the optical spectrum.
  Methods. We discuss cINNs trained on three different Phoenix grids: Settl,
NextGen, and Dusty. We evaluate the performance of these cINNs on unlearned
Phoenix synthetic spectra and on the spectra of 36 Class III template stars
with well-characterised stellar parameters.
  Results. We confirm that the cINNs estimate the considered stellar parameters
almost perfectly when tested on unlearned Phoenix synthetic spectra. Applying
our networks to Class III stars, we find good agreement with deviations of at
most 5--10 per cent. The cINNs perform slightly better for earlier-type stars
than for later-type stars like late M-type stars, but we conclude that
estimations of effective temperature and surface gravity are reliable for all
spectral types within the network's training range.
  Conclusions. Our networks are time-efficient tools applicable to large
amounts of observations. Among the three networks, we recommend using the cINN
trained on the Settl library (Settl-Net), as it provides the best performance
across the largest range of temperature and gravity.
