Gurobi can export your model to several different formats. This export is done by using the write function of the appropriate API. The file name extension (.lp, .mps. etc.) of the string argument provided to the write function determines the type of file that will be written. You can also append an extension to specify a compression algorithm (.bz2, .zip, etc.).
The write functions for each supported programming language are listed below.