use flatbuffers to encode the model