You need two different models, because flat-shaded and smooth-shaded models normals are different.
One of the ways is to generate 2 separate models and replace them with one another on demand.
Another way is to make a single model prepared for flat shaded render (all vertices unique) and replace only normals when switching to flat/smooth shading. For smooth-shaded normals that would mean unnecessary vertices duplication, but you will save memory on overall by keeping vertices/indices single.
Further unification is to store both normals per each vertex (x,y,z,nx1,ny1,nz1,nx2,ny2,nz2) and use required ones using a switch in the shader.
P.S. Smooth-shaded models might still need duplicate vertices along the sharp edges if there are smooth groups and/or smoothing degree threshold and/or discontinuous UVs.