A large-deviations criterion is proposed for optimality of nonparametric regression estimators. The criterion is one of minimaxity of the large-deviations probabilities. We study the case where the underlying class of regression functions is either Lipschitz or Holder, and when the loss function involves estimation at a point or in supremum norm. Exact minimax asymptotics are found in the Gaussian case.