Optical levitation of nanoscale particles promises a completely new experiment in force sensing and the foundations of quantum physics and thermodynamics. However, most of these experiments have hardly made use of the extraordinary versatility of optical micromanipulation technology. We present a novel optical holographic trapping platform that levitates a nanosphere in vacuum in a fully controllable double-well potential. We show the power and versatility of our platform by demonstrating a generalised version of Landauer’s principle, where a memory is first encoded in an out-of-equilibrium classically-squeezed state. We infer produced work and heat over a large number of repetitions of the protocols, and we observe that the energy cost to erase a memory is greatly reduced and can in principle be made negative. Our results pave the way to fully customizable vacuum optical trapping in arbitrary potentials, and opens up to the study of non-linearities in ground-state cooled particles.