TSolMod. C++ Class Library of Models of Mixing in Phases-Solutions. Predicting the stability and thermodynamic properties of nonideal solution phases over wide ranges of pressure and temperature requires that theoretically sound and sufficiently accurate equation of state and activity models are used within a generalized GEM framework. The variety of such models calls for a novel, flexible and computationally efficient code architecture that supports diverse solution phase models with different mathematical structure and input data setup. This was the main motivation for developing the TSolMod C++ class library for equation of state and activity models, which ensures broad applicability of the GEM software, in particular, GEM-Selektor v.3 geochemical modeling package and standalone GEMS3K code. Key innovative features of the TSolMod library are: generic and flexible model parameter setup; computationally efficient data exchange with the GEM IPM equilibrium solver; open conceptual design that allows straightforward extension to incorporate any models for solution phases. The current version of TSolMod library features a comprehensive selection of fluid, gas, liquid, and solid solution models of interest to a wide range of geochemical, petrological, material science, and chemical engineering applications.