  The complex physics governing nebular emission in galaxies, particularly in
the early universe, often defy simple low-dimensional models. This has proven
to be a significant barrier in understanding the (often diverse) ionizing
sources powering this emission. We present Cue, a highly flexible tool for
interpreting nebular emission across a wide range of abundances and ionizing
conditions of galaxies at different redshifts. Unlike typical nebular models
used to interpret extragalactic nebular emission, our model does not require a
specific ionizing spectrum as a source, instead approximating the ionizing
spectrum with a 4-part piece-wise power-law. We train a neural net emulator
based on the CLOUDY photoionization modeling code and make self-consistent
nebular continuum and line emission predictions. Along with the flexible
ionizing spectra, we allow freedom in [O/H], [N/O], [C/O], gas density, and
total ionizing photon budget. This flexibility allows us to either marginalize
over or directly measure the incident ionizing radiation, thereby directly
interrogating the source of the ionizing photons in distant galaxies via their
nebular emission. Our emulator demonstrates a high accuracy, with $\sim$1%
uncertainty in predicting the nebular continuum and $\sim$5% uncertainty in the
emission lines. Mock tests suggest Cue is well-calibrated and produces useful
constraints on the ionizing spectra when $S/N (\mathrm{H}_\alpha) \gtrsim 10$,
and furthermore capable of distinguishing between the ionizing spectra
predicted by single and binary stellar models. The compute efficiency of neural
networks facilitates future applications of Cue for rapid modeling of the
nebular emission in large samples and Monte Carlo sampling techniques.
