For future reference, the solution is to add idata_kwargs={"log_likelihood": True} to the pm.sample call when running the model. Then the resulting trace/InferenceData will have a new log_likelihood group that will be included and saved to the netcdf file, etc. I found it here Model comparison — PyMC 5.3.1 documentation and here pymc.to_inference_data — PyMC 5.3.1 documentation