Politepix is an iOS toolkit that uses CMU Sphinx (free, self-contained) for listening and another toolkit for saying words and provides phrase limiting for sphinx for an additional fee.
Android voice recognition provides some Android documentation. I think it still calls the cloud though.