Model compiler