We study quenched distributions on random walks in a random potential on integer lattices of arbitrary dimension and with an arbitrary finite set of admissible steps. The potential can be unbounded and can depend on a few steps of the walk. Directed, undirected, and stretched polymers, as well as random walk in random environment, are covered. The restriction needed is on the moment of the potential, in relation to the degree of mixing of the ergodic environment. We derive two variational formulas for the limiting quenched free energy and prove a process-level quenched large deviation principle (LDP) for the empirical measure. As a corollary we obtain LDPs for types of random walks in random environments not covered by earlier results. © 2012 Wiley Periodicals, Inc.