The ability to engineer cavity-mediated interactions has emerged as a powerful tool for the generation of non-local correlations and the investigation of non-equilibrium phenomena in many-body systems. Levitated optomechanical systems have recently entered the multi-particle regime, with promise for using arrays of massive strongly coupled oscillators for exploring complex interacting systems and sensing. Here, by combining advances in multi-particle optical levitation and cavity-based quantum control, we demonstrate, for the first time, programmable cavity-mediated interactions between nanoparticles in vacuum. The interaction is mediated by photons scattered by spatially separated particles in a cavity, resulting in strong coupling (Gzz/Ωz = 0.238 ± 0.005) that does not decay with distance within the cavity mode volume. We investigate the scaling of the interaction strength with cavity detuning and inter-particle separation, and demonstrate the tunability of interactions between different mechanical modes. Our work paves the way towards exploring many-body effects in nanoparticle arrays with programmable cavity-mediated interactions, generating entanglement of motion, and using interacting particle arrays for optomechanical sensing