We introduce a class of generalized Lipkin-Meshkov-Glick (gLMG) models with su$(m)$ interactions of Haldane-Shastry type. We have computed the partition function of these models in closed form by exactly evaluating the partition function of the restriction of a spin chain Hamiltonian of Haldane-Shastry type to subspaces with well-defined magnon numbers. As a byproduct of our analysis, we have obtained strong numerical evidence of the Gaussian character of the level density of the latter restricted Hamiltonians, and studied the distribution of the spacings of consecutive unfolded levels. We have also discussed the thermodynamic behavior of a large family of su(2) and su(3) gLMG models, showing that it is qualitatively similar to that of a two-level system.