move gmp interface code to interface.py