  Context. The He i 1083 nm is a powerful diagnostic for inferring properties
of the upper solar chromosphere, in particular for the magnetic field. The
basic formation of the line in one-dimensional models is well understood, but
the influence of the complex 3D structure of the chromosphere and corona has
however never been investigated. This structure must play an essential role
because images taken in He i 1083 nm show structures with widths down to 100
km. Aims. To understand the effect of the three-dimensional temperature and
density structure in the solar atmosphere on the formation of the He i 1083 nm
line. Methods. We solve the non-LTE radiative transfer problem assuming
statistical equilibrium for a simple 9-level helium atom that nevertheless
captures all essential physics. As a model atmosphere we use a snapshot from a
3D radiation-MHD simulation computed with the Bifrost code. Ionising radiation
from the corona is self-consistently taken into account. Results. The emergent
intensity in the He i 1083 nm is set by the source function and the opacity in
the upper chromosphere. The former is dominated by scattering of photospheric
radiation and does not vary much with spatial location. The latter is
determined by the photonionisation rate in the He i ground state continuum, as
well as the electron density in the chromosphere. The spatial variation of the
flux of ionising radiation is caused by the spatially-structured emissivity of
the ionising photons from material at T = 100 kK in the transition region. The
hotter coronal material produces more ionising photons, but the resulting
radiation field is smooth and does not lead to small-scale variation of the UV
flux. The corrugation of the transition region further increases the spatial
variation of the amount of UV radiation in the chromosphere.
