Hi Miguel,
There are two ways that you can reduce the disk space usage. One is to turn off parallel evaluation - if you specify n_jobs=1 to batch.predict, it will only use a single process and will not persist the model.
The other is to use Python 3.8 or newer. Python 3.8 provides robust shared memory facilities, and if they are available, LensKit will use them to persist the model into shared memory instead of a file on disk. This requires enough memory for two copies of the model, because it needs to be copied into shared memory. If you use train_isolated prior to predict, it will drop the original model object after copying, so all you have in memory is the one model. (Note that you have to call .close() on the result object from train_isolated after you are done predicting to free up the shared memory.)
- Michael