Add support for the `flat` option for model instances