To improve target coverage and reduce the dose in the surrounding organsat-risks (OARs), we developed an image-guided treatment method based on a precomputed library of treatment plans controlled and delivered in real-time. Methods: A library of treatment plans is constructed by optimizing a plan for each breathing phase of a 4DCT. Treatments are delivered by simulation on a continuous sequence of synthetic CTs generated from real MRI sequences. During treatment, the plans for which the tumor is at a close distance to the current tumor position are selected to deliver their spots. The study is conducted on five liver cases. Results: We tested our approach under imperfect knowledge of the tumor positions with a 2 mm distance error. On average, compared to a 4D robustly optimized treatment plan, our approach led to a dose homogeneity increase of 5% (defined as 1 − D 5 −D 95 prescription ) in the target and a mean liver dose decrease of 23%. The treatment time was roughly increased by a factor of 2 but remained below 4 minutes on average. Conclusions: Our image-guided treatment framework outperforms state-of-the-art 4D-robust plans for all patients in this study on both target coverage and OARs sparing, with an acceptable increase in treatment time under the current accuracy of tumor tracking technology.