  We study a system of self-gravitating massive fermions in the framework of
the general-relativistic Thomas-Fermi model. We postulate the free energy
functional and show that its extremization is equivalent to solving the
Einstein's field equations. A self-gravitating fermion gas we then describe by
a set of Thomas-Fermi type self-consistency equations.
