Predictive typing for single words is usually based on a locally stored dictionary, and for sentences it can be done with a model like prediction by partial matching. The device functionality is similar to a system used for speech recognition, in that better accuracy would only be gained by sending motion and text data to the cloud at the very least in the training stage and then aggregate and analyse data using a prediction model.
However, no-one seems to care that most voice recognition tools like Siri nowadays send and store data on servers, and nearly all those aren't OSS.