Large deviation theory:

Sanov theorem: large deviation principle and rate function for the "empirical vector" through the Gartner-Ellis theorem; discrete and continuous random variables (section 4.2)

Jaynes maximum entropy principle for independent particle through Sanov theorem for single particle energy distribution and contraction principle (example 5.1)

Reference review: "The large deviation approach to statistical mechanics" by H. Touchette (Phys. Rep. 2009)