Quasi-static large deviations