  In this letter, the production of deuterons and anti-deuterons in pp
collisions at $\sqrt{s} = 7$ TeV is studied as a function of the
charged-particle multiplicity density at mid-rapidity with the ALICE detector
at the LHC. Production yields are measured at mid-rapidity in five multiplicity
classes and as a function of the deuteron transverse momentum ($p_{\rm{T}}$).
The measurements are discussed in the context of hadron-coalescence models. The
coalescence parameter $B_{2}$, extracted from the measured spectra of
(anti-)deuterons and primary (anti-)protons, exhibits no significant
$p_{\rm{T}}$-dependence for $p_{\rm{T}} < 3$ GeV/$c$, in agreement with the
expectations of a simple coalescence picture. At fixed transverse momentum per
nucleon, the $B_{2}$ parameter is found to decrease smoothly from low
multiplicity pp Pb-Pb collisions, in qualitative agreement with more elaborate
coalescence models. The measured mean transverse momentum of (anti-)deuterons
in pp is not reproduced by the Blast-Wave model calculations that
simultaneously describe pion, kaon and proton spectra, in contrast to central
Pb-Pb collisions. The ratio between the $p_{\rm{T}}$-integrated yield of
deuterons to protons, d/p, is found to increase with the charged-particle
multiplicity, as observed in inelastic pp collisions at different
centre-of-mass energies. The d/p ratios are reported in a wide range, from the
lowest to the highest multiplicity values measured in pp collisions at the LHC.
